12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /********************************************************************************
- * File Name: Audio.h
- * Function Describe: Header file for Audio.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-6-15
- *******************************************************************************/
- #ifndef __AUDIO_H
- #define __AUDIO_H
- #include "rtl.h"
- #define BEEP_PIN GPIO_Pin_1
- #define BEEP_PORT GPIOA
- //#define MIC_MUTE_PIN GPIO_Pin_4 //先定义为无用脚
- //#define MIC_MUTE_PORT GPIOC
- #define SPK_MUTE_PIN GPIO_Pin_8
- #define SPK_MUTE_PORT GPIOC
- //#define SPK_EX_PIN GPIO_Pin_11 //耳机输出
- //#define SPK_EX_PORT GPIOC
- #define EAR_CHEK_PIN GPIO_Pin_5
- #define EAR_CHEK_PORT GPIOC
- #define MicEnable() // MIC_MUTE_PORT->BRR=MIC_MUTE_PIN;//Set Pin Low ,MIC Enalbe//BRR
- #define MicDisable() //MIC_MUTE_PORT->BSRR=MIC_MUTE_PIN;//Set Pin High ,MIC MUTE//BSRR
- #define TMR_INF_BEEP 1
- #define TMR_INF_MIC 2
- #define TMR_INF_RING 3
- typedef struct{
- unsigned short freq;
- unsigned short time;
- }SUT_RING_ELEMENT;
- typedef struct{
- unsigned short start;//0-stop 1-start
- unsigned short handle;//当前播放到的位置
- unsigned short ElementNum;
- SUT_RING_ELEMENT *pElement;
- }SUT_RING;
- extern SUT_RING sutRing;
- extern OS_ID idBeepTimer;
- extern OS_ID idRingTimer;
- void MicrophoneInit(void);
- void MicrophoneCtrl(int en);
- void SpeakerInit(void);
- void SpeakerCtrl(int en);
- void BeepInit(void);
- void SetBeep(int fre,int tick);
- void SetBeepByNoOS(int fre,int ms);
- void DelayMs(unsigned short ms);
- void Ear_check(char type);
- void SetRingFreq(int fre);
- extern int cntMeiTiao;
- extern unsigned char Earcheck;
- /*********************************begin*****************************************/
- /**********************************end******************************************/
- #endif
|