Other Parts Discussed in Thread: CCSTUDIO
Dear All
I am trying to learn about dsp kit 6713 and AIC23 codec and i have came across an example program(code attached here in this question) but i am unable to understand functions related to AIC23 codec,i tried to google on this topic but couldn't get much useful help
Please help me to understand,by sharing link of any webpage or document that discusses working of these functions realted to AIC23 codec especially the ones in below ones lines
Forexample what is the meaning & effect of following code lines and how are they working
DSK6713_AIC23_Config config
DSK6713_AIC23_CodecHandle hCodec;
hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ);
while (!DSK6713_AIC23_read(hCodec, &IN));
while (!DSK6713_AIC23_write(hCodec, OUT_L));
DSK6713_AIC23_closeCodec(hCodec);
#include<dsk6713.h> #include<dsk6713_aic23.h> #include<dsk6713_led.h> #include<dsk6713_dip.h> #include<math.h> // to configure codec DSK6713_AIC23_Config config = { 0x0017, /* 0 - DSK6713_AIC23_LEFTINVOL Left line input channel volume */ 0x0017, /* 1 - DSK6713_AIC23_RIGHTINVOL Right line input channel volume */ 0x01f9, /* 2 - DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ 0x01f9, /* 3 - DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ 0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ 0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ 0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ 0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ 0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ 0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ }; void main(){ DSK6713_AIC23_CodecHandle hCodec; Uint32 IN,OUT; Uint16 OUT_L,OUT_R; DSK6713_init(); // Initialize the DSK6713 board DSK6713_LED_init();// Initialize the DSK6713 board leds hCodec = DSK6713_AIC23_openCodec(0, &config); // Start the codec DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ); // Set codec frequency to 8KHz while(1) { /* Read 32 bit sample from the audio channel */ while (!DSK6713_AIC23_read(hCodec, &IN)); /*Typecasting */ OUT_L = IN; OUT_R = IN; /* Read 16-bit samples to right and left audio channel */ while (!DSK6713_AIC23_write(hCodec, OUT_L)); while (!DSK6713_AIC23_write(hCodec, OUT_R)); if(DSK6713_DIP_get(1)==0) break; } /* Close the codec */ DSK6713_LED_on(1); DSK6713_AIC23_closeCodec(hCodec); }