Audio.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /********************************************************************************
  2. * File Name: Audio.h
  3. * Function Describe: Header file for Audio.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-6-15
  7. *******************************************************************************/
  8. #ifndef __AUDIO_H
  9. #define __AUDIO_H
  10. #define BEEP_PIN GPIO_Pin_3
  11. #define BEEP_PORT GPIOB
  12. #define SPK_MAIN_MUTE_PIN GPIO_Pin_13
  13. #define SPK_MAIN_MUTE_PORT GPIOC
  14. #define SPK_MAIN_MUTE_LOW SPK_MAIN_MUTE_PORT->BRR=SPK_MAIN_MUTE_PIN
  15. #define SPK_MAIN_MUTE_HIGH SPK_MAIN_MUTE_PORT->BSRR=SPK_MAIN_MUTE_PIN
  16. #define SPK_MUTE_PIN GPIO_Pin_14
  17. #define SPK_MUTE_PORT GPIOC
  18. #define SPK_BOOST_PIN GPIO_Pin_15
  19. #define SPK_BOOST_PROT GPIOC
  20. #define MicEnable()
  21. #define MicDisable()
  22. //#define SpeakerEnable() SPK_MUTE_PORT->BRR=SPK_MUTE_PIN//Speaker Enable//BSRR
  23. #define SpeakerDisable() SPK_MUTE_PORT->BRR=SPK_MUTE_PIN//Speaker Disable //BRR
  24. typedef struct{
  25. unsigned short freq;
  26. unsigned short time;
  27. }SUT_RING_ELEMENT;
  28. typedef struct{
  29. unsigned short start;//0-stop 1-start
  30. unsigned short handle;//µ±Ç°²¥·Åµ½µÄλÖÃ
  31. unsigned short ElementNum;
  32. SUT_RING_ELEMENT *pElement;
  33. }SUT_RING;
  34. extern SUT_RING sutRing;
  35. extern unsigned char MuteFlag;
  36. void SpeakerInit(void);
  37. void SpeakerCtrl(int en);
  38. void SetBeep(int fre,int tick);
  39. void SetBeepByNoOS(int fre,int ms);
  40. void DelayMs(unsigned short ms);
  41. void SetRingFreq(int fre);
  42. extern int cntMeiTiao;
  43. void SpeakerEnable(void);
  44. /*********************************begin*****************************************/
  45. /**********************************end******************************************/
  46. #endif