board.h 2.1 KB

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