board.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __BOARD_H_
  2. #define __BOARD_H_
  3. #include "stdbool.h"
  4. #define MAX_SPK_VOL 8
  5. #define KEY_TIMER_TICK 30
  6. #define KS_ALL_IDLE 0
  7. //组合键值,用于底层处理使用
  8. typedef enum{
  9. MKEY_VALUE_1=1,
  10. MKEY_VALUE_2=2,
  11. MKEY_VALUE_3=3,
  12. MKEY_VALUE_4=4,
  13. MKEY_VALUE_5=5,
  14. MKEY_VALUE_6=6,
  15. MKEY_VALUE_7=7,
  16. MKEY_VALUE_8=8, //加制将MIC_PTT放进来,放到最后吧
  17. MKEY_VALUE_9=9,
  18. MKEY_VALUE_NONE=15//不使用
  19. }MKEY_VALUEENUM;
  20. #define MKEY_VALUE_PTT (1<<MKEY_VALUE_3)
  21. #define MKEY_VALUE_F1 (1<<MKEY_VALUE_6)
  22. #define MKEY_VALUE_F2 (1<<MKEY_VALUE_NONE)
  23. #define MKEY_VALUE_MENU (1<<MKEY_VALUE_7) //短按确认,长按锁屏
  24. #define MKEY_VALUE_DOWN (1<<MKEY_VALUE_2) //菜单键/下一项键
  25. #define MKEY_VALUE_ESC (1<<MKEY_VALUE_1)
  26. #define MKEY_VALUE_UP (1<<MKEY_VALUE_9)
  27. #define MKEY_VALUE_CB_GT (MKEY_VALUE_F1|MKEY_VALUE_ESC)//(MKEY_VALUE_MENU | MKEY_VALUE_ESC)
  28. #define MKEY_VALUE_CB_IP (MKEY_VALUE_ESC | MKEY_VALUE_DOWN)
  29. #define MKEY_VALUE_MIC_PTT (1<<MKEY_VALUE_8)
  30. #define MKEY_VALUE_CB_PTT (MKEY_VALUE_PTT|MKEY_VALUE_MIC_PTT)
  31. #define CTL_LCD_BL(bit) lcdBackList(bit) ////暂时未有控制,电源直接点亮了,需要后面改硬件搞个IO来控制
  32. #define CTL_POWER_HOLD(bit) pwrHoldCtl(bit)//暂时无控制,当前电池直接驱动了
  33. #define TONE_NORMAL 880
  34. #define TONE_SPECIAL 880
  35. void redLedCtl(bool onoff);
  36. void greenLedCtl(bool onoff);
  37. void spkCtl(bool onoff);
  38. void lcdBackList(char onoff);
  39. void pwrHoldCtl(bool onoff);
  40. void msgAtSend(char *at);
  41. void msgAtSends(char *at ,int len);
  42. void boardInit(void);
  43. void usbOutPut(unsigned char *info, int len);
  44. unsigned int getAppTick(void);
  45. void keySendEvent(unsigned short key, unsigned char keyType);
  46. void stopKeyTimer(void);
  47. void paControl(bool status);
  48. unsigned short getKeyValue();
  49. void startBackLightTimer(int time);
  50. void pttBeepStart(bool isMicReq);
  51. void beepStart(int freq);
  52. #endif