12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef __KEY_H_
- #define __KEY_H_
- //////////////////////////////////////////
- #define KEY_FUNC_PIN GPIO_Pin_0
- #define KEY_FUNC_PORT GPIOB
- #define KEY_INFO_PIN GPIO_Pin_1
- #define KEY_INFO_PORT GPIOB
- #define KEY_PPT_PIN GPIO_Pin_2
- #define KEY_PPT_PORT GPIOB
- #define KEY_POWER_PIN GPIO_Pin_3
- #define KEY_POWER_PORT GPIOB
- #define KeyPwrStatus (KEY_POWER_PORT->IDR & KEY_POWER_PIN)
- #define KEY_POWER_HIGH KEY_POWER_PORT->BSRR = KEY_POWER_PIN //BSRR
- #define KEY_POWER_LOW KEY_POWER_PORT->BRR = KEY_POWER_PIN //BRR
- #define KEY_ALL_PORTB (KEY_POWER_PIN|KEY_PPT_PIN| KEY_FUNC_PIN|KEY_INFO_PIN)
- //#define KEY_ALL_PORTC (KEY_PPT_PIN| KEY_FUNC_PIN|KEY_INFO_PIN)
- #define KEY_OPTION 0x070000 //左1 选项按键
- #define KEY_PPT 0x0b0000 //左1
- #define KEY_PANEL_OK 0xfc002a //左3
- #define KEY_INFO 0x0d0000 //左4 代替 原KEY_UP,vol+
- #define KEY_FUNC 0x0e0000 //左5 代替 原KEY_DOWN,vol-
- #define KEY_PANEL_MENU 0xec042a //正1
- #define KEY_PANEL_UP 0xdc042a //正2
- #define KEY_PANEL_DOWN 0xbc042a //正3
- #define KEY_PANEL_EXIT 0xf4042a //正4
- #define KEY_PPT_MIC 0xfc040a
- #define KEY_EXIT_DOWN_GT 0x0C0000 //侧键UP+DOWN 此值用于进入GT模式
- #define KEY_P1_P3_UPDATE 0xf8082e //此值用于进入对讲版本升级
- #define KEY_UP_DOWN_IP 0xac042a //OK+DOWN
- #define KEY_IDLE 0xfc042a
- extern unsigned char g_ucUKC;
- extern unsigned char g_ucKeyFree;
- extern unsigned char g_ucKeyMode;
- extern unsigned long g_ulKeyValue; //key value
- extern unsigned char g_ucKeyPPTPress;
- extern int g_iEncode;
- extern unsigned char PttKeyFlag;
- void KeyInit(void);
- int GetKey(void);
- int GetKeyVBAT(void);
- void KeyCount(void);
- void SoftPwrOffCheck(void);
- #endif
|