void TLV320ADC_Init(void) { //w 9c 00 00 # Goto Page 0 //w 9c 02 81 # Wake-up device by I2C write into P0_R2 using internal AREG //w 9c 6B 05 # Linear Phase Filter with 2 channel summer mode (DSP_CFG0) //w 9c 07 30 # TDM Mode with 32 Bits/Channel //w 9c 73 c0 # Enable Ch.1 - Ch.2 //w 9c 74 c0 # Enable Ch.1 - Ch.2 ASI Output channels //w 9c 75 e0 # Power up ADC u8 r_data; u8 wack; TLV320ADC_i2c_init(); wack = TLV320ADC_IIC_WriteReg(0x00,0x00); if(wack == 0) my_dump_str_data(1,"============set page0 fail", 0, 0); if(wack == 1) my_dump_str_data(1,"============set page0 succ", 0, 0); // 要注意ARGE_SELEC的1.8V是内部产生提供还是外部提供,外部提供的时候AVDD是3.3V TLV320ADC_IIC_WriteReg(0x02,0x81); // Wake-up device TLV320ADC_IIC_WriteReg(0x6b,0x01); // TLV320ADC_IIC_WriteReg(0x07,0x60); // IIS Mode with 24 Bits/Channel TLV320ADC_IIC_WriteReg(0x13,0x01); // MCLK = 12.288 MHz, slave mode, auto clock configuration is enabled, automatic mode pll, fs is 48KHz TLV320ADC_IIC_WriteReg(0x14,0x44); // BCLK = 3.072 MHz , 48KHz #if 0// channel 1 config TLV320ADC_IIC_WriteReg(0x6d,0x21); // Input signal level threshold is -24 db, Maximum gain is 4 db TLV320ADC_IIC_WriteReg(0x3c,0x21); TLV320ADC_IIC_WriteReg(0x3d,(20<<1));// Channel gain is set to 10 dB TLV320ADC_IIC_WriteReg(0x3e,241); // Digital volume control is set to 20 dB TLV320ADC_IIC_WriteReg(0x73,0x80); // Enable Ch.1 TLV320ADC_IIC_WriteReg(0x74,0x80); // Channel 1 output slot is enabled #else // channel 2 config TLV320ADC_IIC_WriteReg(0x6d,0x21); // Input signal level threshold is -24 db, Maximum gain is 4 db TLV320ADC_IIC_WriteReg(0x2b,0x00); TLV320ADC_IIC_WriteReg(0x22,0x00); TLV320ADC_IIC_WriteReg(0x41,0x21); TLV320ADC_IIC_WriteReg(0x42,(44<<1));// Channel gain is set to 22 dB TLV320ADC_IIC_WriteReg(0x43,0xc9); // Digital volume control is set to 0 dB TLV320ADC_IIC_WriteReg(0x73,0x40); // Enable Ch.2 TLV320ADC_IIC_WriteReg(0x74,0x40); // Channel 2 output slot is enabled #endif TLV320ADC_IIC_WriteReg(0x75,0xe0); // Power up ADC, PLL, MICBIAS }