?? iomcbsp.c
字號:
#include "iomcbspcfg.h"
#include <dsk5416.h>
#include <dsk5416_pcm3002.h>
DSK5416_PCM3002_Config setup = {
0x1ff, // Set-Up Reg 0 - Left channel DAC attenuation
0x1ff, // Set-Up Reg 1 - Right channel DAC attenuation
0x0, // Set-Up Reg 2 - Various ctl e.g. power-down modes
0x0 // Set-Up Reg 3 - Codec data format control
};
void main ()
{
DSK5416_PCM3002_CodecHandle hCodec;
Int16 data;
// Initialize the board support library
DSK5416_init();
// Start the codec
hCodec = DSK5416_PCM3002_openCodec(0, &setup);
// Set codec frequency to 8KHz
DSK5416_PCM3002_setFreq(hCodec, 8000);
// Endless loop IO audio codec
while(1){
// Read 16 bits of codec data, loop to retry if data port is busy
while(!DSK5416_PCM3002_read16(hCodec, &data));
// Write 16 bits to the codec, loop to retry if data port is busy
while(!DSK5416_PCM3002_write16(hCodec, data));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -