12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef __KEY_H_
- #define __KEY_H_
- #define ONOFF_CK_PIN GPIO_Pin_2
- #define ONOFF_CK_PORT GPIOD
- #define HC165_READ_PIN GPIO_Pin_10
- #define HC165_READ_PORT GPIOC
- #define HC165_PL_PIN GPIO_Pin_11
- #define HC165_PL_PORT GPIOC
- #define HC165_CP_PIN GPIO_Pin_12
- #define HC165_CP_PORT GPIOC
- #define HC165_DATA_READ GPIO_ReadInputDataBit(HC165_READ_PORT,HC165_READ_PIN) //9
- #define HC165_CP_HIGH HC165_CP_PORT->BSRR = HC165_CP_PIN
- #define HC165_CP_LOW HC165_CP_PORT->BRR = HC165_CP_PIN
- #define HC165_PL_HIGH HC165_PL_PORT->BSRR= HC165_PL_PIN
- #define HC165_PL_LOW HC165_PL_PORT->BRR= HC165_PL_PIN
- //////////////////////////////////////////
- #define KEY_FUNC_PIN GPIO_Pin_10
- #define KEY_FUNC_PORT GPIOA
- #define KEY_INFO_PIN GPIO_Pin_11
- #define KEY_INFO_PORT GPIOA
- #define KEY_PPT_PIN GPIO_Pin_12
- #define KEY_PPT_PORT GPIOA
- #define KEY_POWER_PIN GPIO_Pin_3
- #define KEY_POWER_PORT GPIOB
- #define KeyPwrStatus (KEY_POWER_PORT->IDR & KEY_POWER_PIN)
- #define KEY_ALL_IDLE 0xFFF8//0xFFFC
- //#define KEY_ALL_IDLE2 0xFFFB //耳机接入
- #define HEDESET_DET (KEY_ALL_IDLE &~(0x01<<2)) //耳机接入
- #define KEY_PPT_MIC (KEY_ALL_IDLE &~(0x01<<3)) //耳机PTT
- #define KEY_OPTION (KEY_ALL_IDLE &~(0x01<<4))//左1 选项按键
- #define KEY_PPT (KEY_ALL_IDLE &~(0x01<<5)) //左2
- #define KEY_INFO (KEY_ALL_IDLE &~(0x01<<6) ) //左3 代替 原KEY_UP,vol+
- #define KEY_FUNC (KEY_ALL_IDLE &~(0x01<<7)) //左4 代替 原KEY_DOWN,vol-
- #define KEY_PANEL_MENU (KEY_ALL_IDLE &~(0x01<<15)) //正1
- #define KEY_PANEL_UP (KEY_ALL_IDLE &~(0x01<<14)) //正2
- #define KEY_PANEL_EXIT (KEY_ALL_IDLE &~(0x01<<13) ) //正3
- #define KEY_PANEL_P1 (KEY_ALL_IDLE &~(0x01<<12)) //正4
- #define KEY_PANEL_DOWN (KEY_ALL_IDLE &~(0x01<<11)) //正5
- #define KEY_PANEL_P2 (KEY_ALL_IDLE &~(0x01<<10)) //正6
- #define KEY_PANEL_P3 (KEY_ALL_IDLE &~(0x01<<9) ) //正7
- #define KEY_PANEL_P4 (KEY_ALL_IDLE &~(0x01<<8)) //正8
- //#define KEY_PPT_MIC 0xfc040a
- #define KEY_EXIT_DOWN_GT (KEY_INFO&KEY_FUNC ) //侧键UP+DOWN 此值用于进入GT模式
- #define KEY_UP_DOWN (KEY_PANEL_UP&KEY_PANEL_DOWN) //上+下 用于查看IP
- /*以下所述键值暂未用到*/
- #define KEY_P1_P3_UPDATE 0xf8082e //此值用于进入对讲版本升级
- #define KEY_OK_DOWN_GPS 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 signed char Headsetsta;
- void KeyInit(void);
- int GetKey(void);
- void KeyCount(void);
- void SoftPwrOffCheck(void);
- void OnOff_Init(void);
- #endif
|