Key.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /********************************************************************************
  2. * File Name: Key.h
  3. * Function Describe: Header file for Key.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-1-30
  7. *******************************************************************************/
  8. #ifndef __KEY_LED_H
  9. #define __KEY_LED_H
  10. /*********************************begin*****************************************/
  11. #define KEY_LED_PIN GPIO_Pin_8
  12. #define KEY_LED_PORT GPIOB
  13. #define KEY_LED(bit) bit?(GPIO_SetBits(KEY_LED_PORT,KEY_LED_PIN)):(GPIO_ResetBits(KEY_LED_PORT,KEY_LED_PIN))
  14. #define KEY_PPT_PIN GPIO_Pin_3
  15. #define KEY_PPT_PORT GPIOC
  16. #define KEY_PANEL_UP_PIN GPIO_Pin_5
  17. #define KEY_PANEL_UP_PORT GPIOB
  18. #define KEY_PANEL_DOWN_PIN GPIO_Pin_6
  19. #define KEY_PANEL_DOWN_PORT GPIOB
  20. #define KEY_PANEL_OK_PIN GPIO_Pin_7
  21. #define KEY_PANEL_OK_PORT GPIOB
  22. #define KEY_PANEL_EXIT_PIN GPIO_Pin_4
  23. #define KEY_PANEL_EXIT_PORT GPIOB
  24. #define KEY_PANEL_MENU_PIN GPIO_Pin_3
  25. #define KEY_PANEL_MENU_PORT GPIOB
  26. #define KEY_PPT_MIC_PIN GPIO_Pin_5
  27. #define KEY_PPT_MIC_PORT GPIOC
  28. //////////////////////////////////////////
  29. #define KEY_FUNC_PIN GPIO_Pin_10
  30. #define KEY_FUNC_PORT GPIOC
  31. #define KEY_INFO_PIN GPIO_Pin_1
  32. #define KEY_INFO_PORT GPIOC
  33. #define KEY_POWER_PIN GPIO_Pin_2
  34. #define KEY_POWER_PORT GPIOB
  35. #define KEY_ALL_PORTB (KEY_PANEL_UP_PIN|KEY_PANEL_DOWN_PIN|KEY_PANEL_OK_PIN|KEY_PANEL_EXIT_PIN|KEY_PANEL_MENU_PIN|KEY_POWER_PIN)
  36. #define KEY_ALL_PORTC (KEY_PPT_PIN| KEY_PPT_MIC_PIN|KEY_FUNC_PIN|KEY_INFO_PIN)
  37. #define KEY_OPTION 0xf8042a //左1 选项按键
  38. #define KEY_PPT 0xfc0422 //左2
  39. #define KEY_PANEL_OK 0xfc002a //左3
  40. #define KEY_INFO 0x7c042a //左4 代替 原KEY_UP,群组上
  41. #define KEY_FUNC 0xfc0428 //左5 代替 原KEY_DOWN,群组下
  42. #define KEY_PANEL_MENU 0xec042a //正1
  43. #define KEY_PANEL_UP 0xdc042a //正2
  44. #define KEY_PANEL_DOWN 0xbc042a //正3
  45. #define KEY_PANEL_EXIT 0xf4042a //正4
  46. #if 0
  47. #define KEY_UP 0xf81c2a
  48. #define KEY_DOWN 0xf81c2c
  49. #define KEY_PANEL_P1 0xf8182e
  50. #define KEY_PANEL_P2 0xf8142e
  51. #define KEY_PANEL_P3 0xf80c2e
  52. #endif
  53. #define KEY_PPT_MIC 0xfc040a
  54. #define KEY_EXIT_DOWN_GT 0xb4042a //DOWN+EXIT 此值用于进入GT模式
  55. #define KEY_P1_P3_UPDATE 0xf8082e //此值用于进入对讲版本升级
  56. #define KEY_OK_DOWN_GPS 0xac042a //OK+DOWN
  57. extern unsigned char g_ucDKC;
  58. extern unsigned char g_ucUKC;
  59. extern unsigned char g_ucKeyFree;
  60. extern unsigned char g_ucKeyMode;
  61. extern unsigned long g_ulKeyValue; //key value
  62. extern unsigned char g_ucKeyPPTPress;
  63. extern int g_iEncode;
  64. void KeyInit(void);
  65. int GetKey(void);
  66. int GetEncodeKey(void);
  67. void KeyToModem(int flag);
  68. void KeyCount(void);
  69. void OnOff_Init(void);
  70. /**********************************end******************************************/
  71. #endif