36 lines
686 B
C
36 lines
686 B
C
#ifndef __BSP_KEY_H__
|
|
#define __BSP_KEY_H__
|
|
|
|
#include "CONFIG.h"
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define KEY_SCAN_EVT (0x0001 << 0)
|
|
#define KEY_WAKEUP_EVT (0x0001 << 1)
|
|
#define KEY_RELEASE_EVT (0x0001 << 2)
|
|
#define KEY_IDLE_TIMEOUT_EVT (0x0001 << 2)
|
|
|
|
// KEY_B_PIN at PB7,low->active
|
|
#define KEY_B_PIN GPIO_Pin_7
|
|
|
|
#define IS_KEY_Vaild() ((GPIOB_ReadPortPin(KEY_B_PIN) ? 0 : 1))
|
|
|
|
typedef enum
|
|
{
|
|
kKeyShort = 0,
|
|
kKeyLong,
|
|
kKeyRelease,
|
|
} TeAppEvtType;
|
|
|
|
|
|
void BSP_KEY_EnterLowpower(void);
|
|
void BSP_KEY_ExitLowpower(void);
|
|
|
|
void BSP_KEY_Init(void);
|
|
|
|
void KEY_ProcessLoop(void);
|
|
|
|
|
|
#endif // !__BSP_KEY_H__
|