?? codec_c.c
字號(hào):
//******************************************************************************
// SJTU DSP Tech. Center
// Copyright (c) 2002 SJTU DSP Tech. Center. All Rights Reserved.
// History:
// Date Authors Changes
// 2003/08/30 Fu Xuan Created.
//******************************************************************************
#include "codec_c.h"
//******************************************************************************
//* MAIN
//******************************************************************************
void main()
{
//light the LEDs for a short time
leds_on();
delay(1000);
leds_off();
delay(1000);
//initialize McBSP
init_mcbsp();
//initialize DMA
init_dma();
//initialize CODEC reg_1=0x01, reg_2=0x10, reg_3=0x00, reg_4=0xC8
init_codec(0x0101, 0x0210, 0x0300, 0x04C8);
//start capture and play
input_pingpong_flag=0;
output_pingpong_flag=0;
dmac0_int_flag=0;
dmac4_int_flag=0;
enable_codec();
while(1)
{ //test trans finish
if(dmac4_int_flag)
dmac4_int_flag=0;
//test receive finish
if(dmac0_int_flag)
{ //here, have receive data, then process
dmac0_int_flag=0;
if(input_pingpong_flag)
in_buf = in_data_pong;
else
in_buf = in_data_ping;
if(output_pingpong_flag)
out_buf = out_data_pong;
else
out_buf = out_data_ping;
//do samples processing
processing(in_buf, out_buf, data_size);
}
}
return;
}
//==================================================
void delay(s16 period)
{
int i, j;
for(i=0; i<period; i++)
{
for(j=0; j<period>>1; j++);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -