Audio.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_8
  11. #define BEEP_PORT GPIOB
  12. #define SPK_MUTE_PIN GPIO_Pin_2
  13. #define SPK_MUTE_PORT GPIOB
  14. #define HEADSET_PIN GPIO_Pin_13 //耳机检测
  15. #define HEADSET_PORT GPIOC
  16. #define CHARGE_PIN GPIO_Pin_3 //充电检测
  17. #define CHARGE_PORT GPIOB
  18. #define MicEnable()
  19. #define MicDisable()
  20. #define HEADSETVOL "AT+CACCP=1,2,2,\"04007e00d3ff000004007f00d6ff00000400b400d9ff00000400b500dcff000004003e00dfff00000400b600e2ff000004007a00e5ff00000400b700e8ff000004002e00ebff00000400b800eeff00000400b800f1ff00000400b900f4ff00000400ba0\
  21. 0f7ff00000400bc00faff00000400be00fdff00000400f50000000000\"\r\n"
  22. typedef struct{
  23. unsigned short freq;
  24. unsigned short time;
  25. }SUT_RING_ELEMENT;
  26. typedef struct{
  27. unsigned short start;//0-stop 1-start
  28. unsigned short handle;//当前播放到的位置
  29. unsigned short ElementNum;
  30. SUT_RING_ELEMENT *pElement;
  31. }SUT_RING;
  32. extern SUT_RING sutRing;
  33. extern int cntMeiTiao;
  34. void SpeakerInit(void);
  35. void SpeakerCtrl(int en);
  36. void BeepInit(void);
  37. void SetBeep(int fre,int tick);
  38. void SetBeepByNoOS(int fre,int ms);
  39. void DelayMs(unsigned short ms);
  40. void SetRingFreq(int fre);
  41. void SpeakerEnable(void);
  42. void SpeakerDisable();
  43. /*********************************begin*****************************************/
  44. /**********************************end******************************************/
  45. #endif