void codec_init(void){ manejador = DSK6713_AIC23_openCodec(0,&configuracion); DSK6713_AIC23_setFreq(manejador,fs); DSK6713_DIP_init(); DSK6713_LED_init(); }
int main(void) { /* Initialize the CSL and the CPLD */ CSL_init(); DSK6713_init(); DSK6713_LED_init(); /* Turn on one LED so we can see it executed at least the main function */ DSK6713_LED_on(0); /* Initialize the DIP switches to be able to read them */ DSK6713_DIP_init(); /* Configure the codec according to the definitions in config_AIC23.c * via the McBSP0 interface */ conf_AIC23(); /* Configure the McBSP to transfer the data from and to the codec */ conf_MCBSP(); /* Start the MCBSP */ start_MCBSP(); /* Configure EDMA */ conf_EDMA(); /* Time to initialize the buffer and zerofill it */ for(i = 0; i < 10; i++) FIFO_I[i] = 0; for(i = 0; i < 10; i++) FIFO_Q[i] = 0; /* Config Interrupts */ IRQ_enable(IRQ_EVT_EDMAINT); IRQ_map(IRQ_EVT_EDMAINT, 8); IRQ_globalEnable(); /* Enable the EDMA channels */ EDMA_enableChannel(hEDMATrx); /******************************************************/ /* We should be done here by now. The McBSP generates an * Interrupt (called "event" in this case) each time * there's a new word ready to be written or ready to * be transferred from the serial port to the * input buffer. We use it for the golden wire config * and will disable the input when we throw in the * QPSK modulation algorithm as it is not needed by then. */ /******************************************************/ /* End main - RTOS takes over */ }
/* * main() - The main user task. Performs application initialization and * starts the data transfer. */ void main() { /* Initialize Board Support Library */ DSK6713_init(); /* Initialize LEDs and DIP switches */ DSK6713_LED_init(); DSK6713_DIP_init(); /* Clear buffers */ memset((void *)gBufferXmtPing, 0, BUFFSIZE * 4 * 2); AIC23_setParams(&config); // Configure the codec initMcbsp(); // Initialize McBSP1 for audio transfers IRQ_globalDisable(); // Disable global interrupts during setup initEdma(); // Initialize the EDMA controller initIrq(); // Initialize interrupts IRQ_globalEnable(); // Re-enable global interrupts }