Key.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef __KEY_H_
  2. #define __KEY_H_
  3. //////////////////////////////////////////
  4. #define KEY_MICPTT_PIN GPIO_Pin_2
  5. #define KEY_MICPTT_PORT GPIOB
  6. #define KEY_FUNC_PIN GPIO_Pin_1
  7. #define KEY_FUNC_PORT GPIOB
  8. #define KEY_INFO_PIN GPIO_Pin_13
  9. #define KEY_INFO_PORT GPIOC
  10. #define KEY_PPT_PIN GPIO_Pin_2
  11. #define KEY_PPT_PORT GPIOB
  12. #define ONOFF_CK_PIN GPIO_Pin_3
  13. #define ONOFF_CK_PORT GPIOB
  14. #define KEY_ALL_PORTB (KEY_PPT_PIN| KEY_FUNC_PIN|KEY_MICPTT_PIN)
  15. #define KEY_ALL_PORTC KEY_INFO_PIN
  16. #define KEY_ENCODE1_PIN GPIO_Pin_4
  17. #define KEY_ENCODE1_PORT GPIOB
  18. #define KEY_ENCODE2_PIN GPIO_Pin_5
  19. #define KEY_ENCODE2_PORT GPIOB
  20. //#define KEY_ALL_PORTC (KEY_PPT_PIN| KEY_FUNC_PIN|KEY_INFO_PIN)
  21. #define KEY_OPTION 0x070000 //左1 选项按键
  22. #define KEY_PPT 0x22000 //左1
  23. #define KEY_PANEL_OK 0xfc002a //左3
  24. #define KEY_INFO 0x42000 //左4 代替 原KEY_UP,vol+
  25. #define KEY_FUNC 0x60000 //左5 代替 原KEY_DOWN,vol-
  26. #define KEY_PANEL_MENU 0xec042a //正1
  27. #define KEY_PANEL_UP 0xdc042a //正2
  28. #define KEY_PANEL_DOWN 0xbc042a //正3
  29. #define KEY_PANEL_EXIT 0xf4042a //正4
  30. #define KEY_PANEL_P1 0xf4042b
  31. #define KEY_PANEL_P2 0xf4042c
  32. #define KEY_PPT_MIC 0x380000
  33. #define KEY_EXIT_DOWN_GT 0x40000 //侧键UP+DOWN 此值用于进入GT模式
  34. #define KEY_P1_P3_UPDATE 0xf8082e //此值用于进入对讲版本升级
  35. #define KEY_UP_DOWN_IP 0xac042a //OK+DOWN
  36. #define KEY_IDLE 0xfc042a
  37. extern unsigned char g_ucUKC;
  38. extern unsigned char g_ucKeyFree;
  39. extern unsigned char g_ucKeyMode;
  40. extern unsigned long g_ulKeyValue; //key value
  41. extern unsigned char g_ucKeyPPTPress;
  42. extern unsigned char g_iEncode;
  43. extern unsigned char PttKeyFlag;
  44. void KeyInit(void);
  45. int GetKey(void);
  46. int GetKeyVBAT(void);
  47. void KeyCount(void);
  48. void SoftPwrOffCheck(void);
  49. void OnOff_Init(void);
  50. void EncodeInit();
  51. void EncodeKeyProcess(void);
  52. #endif