Audio.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #include "rtl.h"
  11. #define BEEP_PIN GPIO_Pin_1
  12. #define BEEP_PORT GPIOA
  13. //#define MIC_MUTE_PIN GPIO_Pin_4 //先定义为无用脚
  14. //#define MIC_MUTE_PORT GPIOC
  15. #define SPK_MUTE_PIN GPIO_Pin_8
  16. #define SPK_MUTE_PORT GPIOC
  17. //#define SPK_EX_PIN GPIO_Pin_11 //耳机输出
  18. //#define SPK_EX_PORT GPIOC
  19. #define EAR_CHEK_PIN GPIO_Pin_5
  20. #define EAR_CHEK_PORT GPIOC
  21. #define MicEnable() // MIC_MUTE_PORT->BRR=MIC_MUTE_PIN;//Set Pin Low ,MIC Enalbe//BRR
  22. #define MicDisable() //MIC_MUTE_PORT->BSRR=MIC_MUTE_PIN;//Set Pin High ,MIC MUTE//BSRR
  23. #define TMR_INF_BEEP 1
  24. #define TMR_INF_MIC 2
  25. #define TMR_INF_RING 3
  26. typedef struct{
  27. unsigned short freq;
  28. unsigned short time;
  29. }SUT_RING_ELEMENT;
  30. typedef struct{
  31. unsigned short start;//0-stop 1-start
  32. unsigned short handle;//当前播放到的位置
  33. unsigned short ElementNum;
  34. SUT_RING_ELEMENT *pElement;
  35. }SUT_RING;
  36. extern SUT_RING sutRing;
  37. extern OS_ID idBeepTimer;
  38. extern OS_ID idRingTimer;
  39. void MicrophoneInit(void);
  40. void MicrophoneCtrl(int en);
  41. void SpeakerInit(void);
  42. void SpeakerCtrl(int en);
  43. void BeepInit(void);
  44. void SetBeep(int fre,int tick);
  45. void SetBeepByNoOS(int fre,int ms);
  46. void DelayMs(unsigned short ms);
  47. void Ear_check(char type);
  48. void SetRingFreq(int fre);
  49. extern int cntMeiTiao;
  50. extern unsigned char Earcheck;
  51. /*********************************begin*****************************************/
  52. /**********************************end******************************************/
  53. #endif