main() { CSL_init(); /* Configure McBSP0 and AIC23 */ Config_DSK6713_AIC23(); /* Configure McBSP1*/ hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); MCBSP_config(hMcbsp, &datainterface_config); /* configure EDMA */ config_EDMA(); DSK6713_LED_off(0); DSK6713_LED_on(1); DSK6713_LED_off(2); DSK6713_LED_on(3); /* finally the interrupts */ config_interrupts(); MCBSP_start(hMcbsp, MCBSP_XMIT_START | MCBSP_RCV_START, 0xffffffff); // Start Audio IN & OUT transmision MCBSP_write(hMcbsp, 0x0); /* one shot */ configComplete = 1; //t_reg = DSK6713_rget(DSK6713_MISC); //t_reg |= MCBSP1SEL; // Set MCBSP1SEL to 1 (extern) //DSK6713_rset(DSK6713_MISC,t_reg); } /* finished*/
void toggle_LED(int led) { if(led_prev){ DSK6713_LED_off(led); led_prev = 0; }else{ DSK6713_LED_on(led); led_prev=1; } }
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 */ }
void tsk_led_toggle(void) { /* initializatoin of the task */ /* nothing to do */ /* process */ while(1) { SEM_pendBinary(&SEM_LEDToggle, SYS_FOREVER); if(configComplete) configComplete ++; if(configComplete >= 2) { t_reg = DSK6713_rget(DSK6713_MISC); t_reg &= ~MCBSP1SEL; // Set MCBSP1SEL to 1 (extern) DSK6713_rset(DSK6713_MISC,t_reg); configComplete = 0; //DSK6713_rset(DSK6713_MISC,MCBSP1SEL); //t_reg = DSK6713_rget(DSK6713_MISC); //t_reg &= ~MCBSP1SEL; // Set MCBSP1SEL to 1 (extern) //DSK6713_rset(DSK6713_MISC,t_reg); DSK6713_LED_on(0); DSK6713_LED_on(1); DSK6713_LED_on(2); DSK6713_LED_on(3); } DSK6713_LED_toggle(0); DSK6713_LED_toggle(1); DSK6713_LED_toggle(2); DSK6713_LED_toggle(3); } }
void leds_output(short led_state){ if(led_state == LED_STATE_ACTIVE){ DSK6713_LED_on(0); DSK6713_LED_off(1); DSK6713_LED_off(2); DSK6713_LED_off(3); }else{ DSK6713_LED_off(0); DSK6713_LED_off(1); DSK6713_LED_off(2); DSK6713_LED_off(3); } }