?? audio.c
字號:
// 測試時音頻插孔J5接音源,J7接揚聲器。語音數據保存到lpWork緩沖區的
#include "5509.h"
#include "util.h"
//***參數解釋:FRAME--480 幀長度
//** BETWEEN---160 幀與幀間隔
//**Fs--12000 采樣頻率
#define FRAME 480
#define BETWEEN 160
#define Fs 12000
//**對調用的自相關函數聲明**//
//void PitchesDetect(int sample[],int length);
void wait( unsigned int cycles );
void EnableAPLL( );
void main()
{
SDRAM_init();
EnableAPLL();
PLL_Init(40);
AIC23_Init();
for(;;)
{
AIC23_Mixer();
}
}
void wait( unsigned int cycles )
{
int i;
for ( i = 0 ; i < cycles ; i++ ){ }
}
void EnableAPLL( )
{
/* Enusre DPLL is running */
*( ioport volatile unsigned short* )0x1f00 = 4;
wait( 25 );
*( ioport volatile unsigned short* )0x1f00 = 0;
// MULITPLY
*( ioport volatile unsigned short* )0x1f00 = 0x3000;
// COUNT
*( ioport volatile unsigned short* )0x1f00 |= 0x4F8;
wait( 25 );
//*( ioport volatile unsigned short* )0x1f00 |= 0x800
// MODE
*( ioport volatile unsigned short* )0x1f00 |= 2;
wait( 30000 );
// APLL Select
*( ioport volatile unsigned short* )0x1e80 = 1;
// DELAY
wait( 60000 );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -