123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /********************************************************************************
- * File Name: Key.h
- * Function Describe: Header file for Key.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-1-30
- *******************************************************************************/
- #ifndef __KEY_LED_H
- #define __KEY_LED_H
- /*********************************begin*****************************************/
- #define CHARGE_IC_PIN GPIO_Pin_4 //充电IC 开启
- #define CHARGE_IC_PORT GPIOC
-
- #define CHARGE_IC_LOW CHARGE_IC_PORT->BRR = CHARGE_IC_PIN
- #define CHARGE_IC_HIGH CHARGE_IC_PORT->BSRR = CHARGE_IC_PIN
-
- #define CHARGE_STATUE_PIN GPIO_Pin_15 //判饱脚
- #define CHARGE_STATUE_PORT GPIOA
- #define KEY_LED_PIN GPIO_Pin_8 //手电筒
- #define KEY_LED_PORT GPIOB
- #define KEY_LED(bit) bit?(GPIO_SetBits(KEY_LED_PORT,KEY_LED_PIN)):(GPIO_ResetBits(KEY_LED_PORT,KEY_LED_PIN))
-
- #define CHARGEChek_PIN GPIO_Pin_13 //判充脚
- #define CHARGEChek_PORT GPIOC //
-
- #define CHARGELED_PIN GPIO_Pin_14 //充电指示灯
- #define CHARGELED_PORT GPIOC //
-
- #define CHARGE_LED_LOW CHARGELED_PORT->BRR = CHARGELED_PIN
- #define CHARGE_LED_HIGH CHARGELED_PORT->BSRR = CHARGELED_PIN
-
- #define KEY_PANEL_MENU_PIN GPIO_Pin_4
- #define KEY_PANEL_MENU_PORT GPIOB
-
- #define KEY_PANEL_UP_PIN GPIO_Pin_5
- #define KEY_PANEL_UP_PORT GPIOB
-
- #define KEY_PANEL_DOWN_PIN GPIO_Pin_6
- #define KEY_PANEL_DOWN_PORT GPIOB
-
- #define KEY_PANEL_EXIT_PIN GPIO_Pin_3
- #define KEY_PANEL_EXIT_PORT GPIOB
- #define KeyPwrStatus (KEY_PANEL_EXIT_PORT->IDR & KEY_PANEL_EXIT_PIN)
- #define KEY_SOS_OK_PIN GPIO_Pin_7 //K1
- #define KEY_SOS_OK_PORT GPIOB
- #define KEY_PPT_PIN GPIO_Pin_3 //k2
- #define KEY_PPT_PORT GPIOC
-
- #define KEY_INFO_PIN GPIO_Pin_1 //K3
- #define KEY_INFO_PORT GPIOC
-
- #define KEY_FUNC_P1_PIN GPIO_Pin_2 //K4 p1 KEY_POWER_PIN
- #define KEY_FUNC_P1_PORT GPIOB //KEY_POWER_PORT
-
- #define KEY_FUNC_P2_PIN GPIO_Pin_10 //K5 p2
- #define KEY_FUNC_P2_PORT GPIOC
- // #define KEY_PPT_MIC_PIN GPIO_Pin_3
- // #define KEY_PPT_MIC_PORT GPIOC
-
- //////////////////////////////////////////
- #define KEY_ALL_PORTB (KEY_PANEL_UP_PIN|KEY_PANEL_DOWN_PIN|KEY_SOS_OK_PIN|KEY_PANEL_EXIT_PIN|KEY_PANEL_MENU_PIN|KEY_FUNC_P1_PIN)
- #define KEY_ALL_PORTC (KEY_PPT_PIN|KEY_FUNC_P2_PIN|KEY_INFO_PIN)
-
- #define KEY_SOS_OK 0xfc002a //上1 ////SOS
-
- #define KEY_INFO 0x7c040a // 左一
- #define KEY_PPT 0xfc0402 //左2
-
- #define KEY_FUNC_P2 0xfc0408 //左3
- #define KEY_FUNC_P3 0xf8040a //左4 ///down
- #define KEY_PANEL_MENU 0x00ec040a //正1
- #define KEY_PANEL_UP 0x00bc040a //正2
- #define KEY_PANEL_DOWN 0x00dc040a //正3
- #define KEY_PANEL_EXIT 0x00f4040a //正4
-
- //#define KEY_PPT_MIC 0xfc0422
- #define KEY_EXIT_DOWN_GT 0xd4040a //DOWN+EXIT 此值用于进入GT模式 //d4042a //b4042a
- #define KEY_P1_P3_UPDATE 0xf8082e //此值用于进入对讲版本升级
- #define KEY_OK_DOWN_GPS 0xac042a //OK+DOWN
- #define KEY_PTT_EXIT 0xf40402//0xf40422
-
- extern unsigned char g_ucDKC;
- 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;
- void KeyInit(void);
- int GetKey(void);
- void KeyToModem(int flag);
- void KeyCount(void);
- void OnOff_Init(void);
- void SoftPwrOffCheck(void);
- /**********************************end******************************************/
- #endif
|