Hello,
I would like to have tips for configuring the audio card CODEC. I configured a LINE input (left channel) and an I2S_DOUT output and I get the following signals.
Here my code :
I tried to store 128 values in an array but I get random values, could you tell me if my code is correct to configure the CODEC? Thank you for your help.
I would like to have tips for configuring the audio card CODEC. I configured a LINE input (left channel) and an I2S_DOUT output and I get the following signals.
Here my code :
Code:
void SGTL5000_init(void){
write(CHIP_ANA_POWER_ADD, 0x0432); // VDDD is externally driven with 1.8V+ SGTL5000 Silicon Errata. PLL
CHIP_ANA_POWER.data = read(CHIP_ANA_POWER_ADD); // Check
write(CHIP_LINREG_CTRL_ADD, 0x006C); // VDDA & VDDIO both over 3.1V
write(CHIP_REF_CTRL_ADD, 0x01FE); // VAG=1.575, normal ramp, -50% bias current
write(CHIP_LINE_OUT_CTRL_ADD, 0x0000); // Not used
write(CHIP_SHORT_CTRL_ADD, 0x0000); // Not used
//---------------- Route LINEIN\ADC\I2S_OUT---------------------
write(CHIP_ANA_CTRL_ADD, 0x046); // enable zero cross detectors, LINEIN input, HP
write(CHIP_ANA_HP_CTRL_ADD, 0x0000); // +12dB = LEFT and RIGHT
// write(CHIP_SSS_CTRL_ADD, 0x0000); // ADC to I2S_OUT
write(CHIP_DIG_POWER_ADD, 0x0073); // power up ADC and I2S_OUT and all digital stuff
HAL_Delay(400);
write(CHIP_LINE_OUT_VOL_ADD, 0x1D1D); // Not used
write(CHIP_CLK_CTRL_ADD, 0x0004); // 256*Fs, 44.1 kHz
write(CHIP_I2S_CTRL_ADD, 0x0030); // Slave Mode, 16bit, I2S format
//---------------- PLL Configuration ---------------------
write(CHIP_CLK_TOP_CTRL_ADD, 0x0000);
write(CHIP_PLL_CTRL_ADD, 0x101C);
//---------------- Input Volume Control---------------------
// Configure ADC left and right analog volume to desired default.
// Example shows volume of 0dB
write(CHIP_ANA_ADC_CTRL_ADD, 0x0000);
}