Skip to content

Commit

Permalink
Add sample rate to constructor
Browse files Browse the repository at this point in the history
This is a breaking but necessary change
  • Loading branch information
MCUdude committed Jan 12, 2021
1 parent 3ebd90f commit 170318b
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 208 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ On the other side many of the modules are fairly easy to reverse engineer, and c


## Supported DSPs
Only the ADAU1701 is supported for now. I'm planing to add the ADAU1442/ADAU1445/ADAU1446 in the future.
Only the ADAU1701, ADAU1702 and ADAU1401 are supported.


## Exporting a SigmaStudio project for use with the SigmaDSP library
Expand Down
4 changes: 2 additions & 2 deletions examples/0_Template/0_Template.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand Down
6 changes: 3 additions & 3 deletions examples/1_Volume/1_Volume.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand Down Expand Up @@ -82,4 +82,4 @@ void loop()
dsp.volume_slew(MOD_SWVOL1_ALG0_TARGET_ADDR, i); // Slew rate is default 12
delay(200);
}
}
}
4 changes: 2 additions & 2 deletions examples/2_First_order_EQ/2_First_order_EQ.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand Down
22 changes: 11 additions & 11 deletions examples/3_Second_order_EQ/3_Second_order_EQ.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| a master volume slider. |
| |
| See the SigmaStudio project file if you want |
| to learn more, tweak or do modifications. |
| to learn more, tweak or do modifications. |
|**********************************************/

// Include Wire and SigmaDSP library
Expand All @@ -20,9 +20,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand All @@ -39,8 +39,8 @@ secondOrderEQ eqBand2;
secondOrderEQ eqBand3;
secondOrderEQ eqBand4;

void setup()
{
void setup()
{
Serial.begin(9600);
Serial.println(F("3_Second_order_EQ example\n"));

Expand All @@ -50,14 +50,14 @@ void setup()

delay(2000);


Serial.println(F("Pinging i2c lines...\n0 -> deveice is present\n2 -> device is not present"));
Serial.print(F("DSP response: "));
Serial.println(dsp.ping());
//Serial.print(F("EEPROM ping: "));
//Serial.println(ee.ping());


// Use this step if no EEPROM is present
Serial.print(F("\nLoading DSP program... "));
loadProgram(dsp);
Expand Down Expand Up @@ -93,8 +93,8 @@ void setup()
}


void loop()
{
void loop()
{
// Adjust band 1
Serial.println(F("+10dB boost at 80Hz (band1)"));
eqBand1.freq = 80;
Expand Down Expand Up @@ -154,5 +154,5 @@ void loop()
eqBand4.boost = i;
dsp.EQsecondOrder(MOD_MIDEQ1_ALG0_STAGE3_B0_ADDR, eqBand4);
delay(500);
}
}
}
18 changes: 9 additions & 9 deletions examples/4_State_variable_filter/4_State_variable_filter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| highpass and bandpass option. |
| |
| See the SigmaStudio project file if you want |
| to learn more, tweak or do modifications. |
| to learn more, tweak or do modifications. |
|**********************************************/

// Include Wire and SigmaDSP library
Expand All @@ -21,9 +21,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand All @@ -37,8 +37,8 @@ SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
// Variable to store calculated sweep tone
uint16_t frequency;

void setup()
{
void setup()
{
Serial.begin(9600);
Serial.println(F("SigmaDSP 4_State_variable_filter example\n"));

Expand All @@ -48,14 +48,14 @@ void setup()

delay(2000);


Serial.println(F("Pinging i2c bus...\n0 -> deveice is present\n2 -> device is not present"));
Serial.print(F("DSP response: "));
Serial.println(dsp.ping());
//Serial.print(F("EEPROM ping: "));
//Serial.println(ee.ping());


// Use this step if no EEPROM is present
Serial.print(F("\nLoading DSP program... "));
loadProgram(dsp);
Expand All @@ -73,7 +73,7 @@ void setup()
}


void loop()
void loop()
{
Serial.print(F("F=500Hz Q=0.71"));
dsp.stateVariable(MOD_STATEVARFILTER1_ALG0_STATEVARALG1FREQ_ADDR, 500, 0.71);
Expand Down
18 changes: 9 additions & 9 deletions examples/5_Signal_generator/5_Signal_generator.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| This example we use the DSP as a crude |
| Signal generator. |
| See the SigmaStudio project file if you want |
| to learn more, tweak or do modifications. |
| to learn more, tweak or do modifications. |
|**********************************************/

// Include Wire and SigmaDSP library
Expand All @@ -19,9 +19,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand All @@ -34,8 +34,8 @@ SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
// Variable to store calculated sweep tone
uint16_t frequency;

void setup()
{
void setup()
{
Serial.begin(9600);
Serial.println(F("5_Signal_generator example\n"));

Expand All @@ -45,14 +45,14 @@ void setup()

delay(2000);


Serial.println(F("Pinging i2c bus...\n0 -> deveice is present\n2 -> device is not present"));
Serial.print(F("DSP response: "));
Serial.println(dsp.ping());
//Serial.print(F("EEPROM ping: "));
//Serial.println(ee.ping());


// Use this step if no EEPROM is present
Serial.print(F("\nLoading DSP program... "));
loadProgram(dsp);
Expand All @@ -70,7 +70,7 @@ void setup()
}


void loop()
void loop()
{
Serial.println(F("Sine sweep"));
dsp.mux(MOD_WAVEFORM_SELECT_MONOSWSLEW_ADDR, 0);
Expand Down
4 changes: 2 additions & 2 deletions examples/6_Dynamic_bass_boost/6_Dynamic_bass_boost.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

// The first parameter is the Wire object we'll be using when communicating wth the DSP
// The second parameter is the DSP i2c address, which is defined in the parameter file
// The third parameter is the SigmaDSP type
// The third parameter is the sample rate
// An optional fourth parameter is the pin to physically reset the DSP
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, ADAU1701 /*,12*/);
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);


// Only needed if an external i2c EEPROM is present + the DSP is in selfboot mode
Expand Down
Loading

0 comments on commit 170318b

Please sign in to comment.