FluxDC/components/FluxButton/FluxButton.h
2025-03-08 14:45:49 +08:00

34 lines
778 B
C

/*导入外部button组件头文件*/
#include "iot_button.h"
#include "esp_log.h"
#define BUTTON_Center_IO_NUM (42)
#define BUTTON_Left_IO_NUM (41)
#define BUTTON_Right_IO_NUM (40)
#define BUTTON_PowerIn_IO_NUM (10)
#define BUTTON_PowerOut_IO_NUM (11)
#define POWER_OFF_OUT_LEVEL 0
#define POWER_ON_OUT_LEVEL 1
#define BUTTON_ACTIVE_LEVEL 0
#define BUTTON_POWERIN_ACTIVE_LEVEL 1
/*定义按键控制指令码*/
enum button_cmd_t
{
BUTTON_CMD_POWER_ON=0,
BUTTON_CMD_POWER_OFF=1,
BUTTON_CMD_CENTER_KEY=2,
BUTTON_CMD_LEFT_KEY=3,
BUTTON_CMD_RIGHT_KEY=4,
};
#define CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE 0
void button_init_func(uint32_t button_num);
void button_init(void);