123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /********************************************************************************
- * 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_0
- #define MIC_MUTE_PORT GPIOC
- #define SPK_MUTE_PIN GPIO_Pin_8
- #define SPK_MUTE_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 SpeakerEnable() SPK_MUTE_PORT->BSRR=SPK_MUTE_PIN//Speaker Enable//BSRR
- #define SpeakerDisable() SPK_MUTE_PORT->BRR=SPK_MUTE_PIN//Speaker Disable //BRR
- #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 SetRingFreq(int fre);
- extern int cntMeiTiao;
- /*********************************begin*****************************************/
- /**********************************end******************************************/
- #endif
|