| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /********************************************************************************
- * File Name: Audio.h
- * Function Describe: Header file for Audio.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-6-15
- *******************************************************************************/
- #ifndef __AUDIO_H
- #define __AUDIO_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() HAL_GPIO_WritePin(MIC_EN_GPIO_Port,MIC_EN_Pin, GPIO_PIN_RESET);
- #define MicEnableEX() HAL_GPIO_WritePin(MIC_ENB_GPIO_Port,MIC_ENB_Pin, GPIO_PIN_RESET);
- //Set Pin Low ,MIC Enalbe//BRR
- #define MicDisable() HAL_GPIO_WritePin(MIC_EN_GPIO_Port,MIC_EN_Pin, GPIO_PIN_SET);//Set Pin High ,MIC MUTE//BSRR
- #define MicDisableEX() HAL_GPIO_WritePin(MIC_ENB_GPIO_Port,MIC_ENB_Pin, GPIO_PIN_SET);//Set Pin High ,MIC MUTE//BSRR
- #define SpeakerEnable() HAL_GPIO_WritePin(SPK_EN1_GPIO_Port,SPK_EN1_Pin, GPIO_PIN_SET);//Speaker Enable//BSRR
- #define SpeakerDisable() HAL_GPIO_WritePin(SPK_EN1_GPIO_Port,SPK_EN1_Pin, GPIO_PIN_RESET);//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;
- 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
|