FYI-Here is a very small item that caused me some confusion while using the sgtl5000 Audio Library routines. I did not find it mentioned anywhere in the forum so I thought I would document it for reference.
The Audio Library method for adjusting the line in gains on the sgtl5000 ADCs is:
bool AudioControlSGTL5000::lineInLevel(uint8_t left, uint8_t right)
{
if (left > 15) left = 15;
if (right > 15) right = 15;
return write(CHIP_ANA_ADC_CTRL, (left << 4) | right);
}
But the sgtl5000 data sheet details the CHIP_ANA_ADC_CTRL register as:
So the method has the left/right reversed.
As I said, very small issue, but it took me a bit to figure out why my code wasn't controlling the left/right ADC gains correctly.
The Audio Library method for adjusting the line in gains on the sgtl5000 ADCs is:
bool AudioControlSGTL5000::lineInLevel(uint8_t left, uint8_t right)
{
if (left > 15) left = 15;
if (right > 15) right = 15;
return write(CHIP_ANA_ADC_CTRL, (left << 4) | right);
}
But the sgtl5000 data sheet details the CHIP_ANA_ADC_CTRL register as:
So the method has the left/right reversed.
As I said, very small issue, but it took me a bit to figure out why my code wasn't controlling the left/right ADC gains correctly.