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_9
- #define BEEP_PORT GPIOB
- #define SPK_MUTE_PIN GPIO_Pin_15
- #define SPK_MUTE_PORT GPIOA
- #define HEADSET_PIN GPIO_Pin_10 //耳机检测
- #define HEADSET_PORT GPIOB
- #define MicEnable()
- #define MicDisable()
- //static const char *SendheadsetAt="AT+CACCP=1,2,2,\"04002400d3ff000004002400d6ff000004002e00d9ff0000040\
- // 02e00dcff000004002e00dfff000004002e00e2ff000004002e00e5ff000004002e00e8ff000004002e00ebff000004002e00eeff000004002e00f1ff000004002e00f4ff000004002e00f7ff000004002e00faff000004002e00fdff00000400f40000000000\"\r\n";
- #define HEADSETVOL "AT+CACCP=1,2,2,\"04007e00d3ff000004007f00d6ff00000400b400d9ff00000400b500dcff000004003e00dfff00000400b600e2ff000004007a00e5ff00000400b700e8ff000004002e00ebff00000400b800eeff00000400b800f1ff00000400b900f4ff00000400ba0\
- 0f7ff00000400bc00faff00000400be00fdff00000400f50000000000\"\r\n"
- //#define SpeakerEnable() SPK_MUTE_PORT->BSRR=SPK_MUTE_PIN//Speaker Enable//BSRR
- //#define SpeakerDisable() SPK_MUTE_PORT->BRR=SPK_MUTE_PIN//Speaker Disable //BRR
- 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 int cntMeiTiao;
- 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);
- void SpeakerEnable(void);
- void SpeakerDisable();
- /*********************************begin*****************************************/
- /**********************************end******************************************/
- #endif
|