
#define Tone_C7 13
#define Tone_CS7 14
#define Tone_D7 15
#define Tone_DS7 16
#define Tone_E7 17
#define Tone_F7 18
#define Tone_FS7 19
#define Tone_G7 20
#define Tone_GS7 21
#define Tone_A7 22
#define Tone_AS7 23
#define Tone_B7 24
#define END 0//音频结束位
#define SYS_FREQ 8 // MHZ 系统时钟
#define TIMER_CNT_BASE 1000000*SYS_FREQ/2 //定时器计数基数
#define BUZZER_IO P3_bit.no1 //BEEP IO
#define BUZZER_OUT PM3_bit.no1=0 //Mode OUT
#define BUZZER_PULL PU3_bit.no1=1 //Pull up
#define PWR_CTRL P13_bit.no0 //蜂鸣器供电控制脚
#define BUZZERIO_INIT {BUZZER_OUT;BUZZER_PULL;}
/*=========================音调频率表=======================*/
const uint Tune_Tbl[24]=
{
//C6,CS6, D6 ,DS6 ,E6 F6 ,FS6 ,G6 ,GS6 ,A6 ,AS6 ,B6
1047,1109,1175,1245,1319,1397,1480,1568,1661,1760,1865,1976,
//C7,CS7, D7 ,DS7 ,E7 F7 ,FS7 ,G7 ,GS7 ,A7 ,AS7 ,B7
2093,2217,2349,2489,2637,2794,2960,3136,3322,3520,3729,3951,
};
/*======================关机和弦 1,2,3...====================*/
const uchar Sound_ShutDown[10]=
{
Tone_C7,2,14,Tone_D7,2,6,Tone_E7,6,60,END
};
/*======================开机和弦 3,2,1...====================*/
const uchar Sound_PowerOn[10]=
{
Tone_E7,2,6,Tone_D7,2,14,Tone_C7,6,60,END