📄 audio.c
字号:
// 测试时音频插孔J5接音源,J7接扬声器。
#include "5509.h"
#include "util.h"
void wait( unsigned int cycles );
void EnableAPLL( );
void main()
{
SDRAM_init();
EnableAPLL();
PLL_Init(144);
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 + -