| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #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 PWR_EN_PIN GPIO_Pin_8
- #define PWR_EN_PORT GPIOB
- #define PWR_EN_HIGH PWR_EN_PORT->BSRR = PWR_EN_PIN //BSRR
- #define PWR_EN_LOW PWR_EN_PORT->BRR = PWR_EN_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;
- extern u32 Flashtick;
- void KeyInit(void);
- int GetKey(void);
- int GetKeyVBAT(void);
- void KeyCount(void);
- void CheckPwrKeyOn(void);
- #endif
|