/* * * aic3204_test( ) * * Test different configurations of the AIC3204 */ Int16 aic3204_test( ) { /* Set A20_MODE for GPIO mode */ CSL_FINST(CSL_SYSCTRL_REGS->EBSR, SYS_EBSR_A20_MODE, MODE1); /* Use GPIO to enable AIC3204 chip */ USBSTK5505_GPIO_init(); USBSTK5505_GPIO_setDirection(GPIO26, GPIO_OUT); USBSTK5505_GPIO_setOutput( GPIO26, 1 ); // Take AIC3201 chip out of reset /* Initialize I2C */ USBSTK5505_I2C_init( ); /* Codec tests */ printf( " -> 1 KHz Tone on Headphone.\n" ); if ( aic3204_tone_headphone( ) ) // Output test return 1; USBSTK5505_wait( 100 ); // Wait printf( "<-> Audio Loopback from Stereo IN --> to HP OUT\n" ); if ( aic3204_loop_linein( ) ) // Loop test return 3; USBSTK5505_GPIO_setOutput( GPIO26, 0 ); // Disable AIC3204 return 0; }
void aic3204_hardware_init(void) { SYS_EXBUSSEL |= 0x0020; // Select A20/GPIO26 as GPIO26 USBSTK5505_GPIO_init(); USBSTK5505_GPIO_setDirection(GPIO26, GPIO_OUT); USBSTK5505_GPIO_setOutput( GPIO26, 1 ); // Take AIC3204 chip out of reset USBSTK5505_I2C_init( ); // Initialize I2C USBSTK5505_wait( 100 ); // Wait }
void aic3204_disable(void) { AIC3204_rset( 1, 1 ); // Reset codec USBSTK5505_GPIO_setOutput( GPIO26, 0 ); // Put AIC3204 into reset I2S0_CR = 0x00; }