31 lines
773 B
C
31 lines
773 B
C
#pragma once
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
#include "esp_err.h"
|
||
|
||
// 按键引脚定义
|
||
#define PIN_BTN_BOOT 0 // GPIO0 BOOT按键(低电平有效)
|
||
#define PIN_BTN_KEY2 4 // GPIO4 KEY2按键(低电平有效)
|
||
|
||
// 按键事件回调函数类型
|
||
typedef void (*btn_event_cb_t)(int gpio_num, void *usr_data);
|
||
|
||
// 初始化按键驱动(GPIO中断 + 软件去抖)
|
||
esp_err_t dzbj_button_init(void);
|
||
|
||
// 注册BOOT按键按下回调
|
||
void dzbj_button_on_boot_press(btn_event_cb_t cb, void *usr_data);
|
||
|
||
// 注册KEY2按键按下回调
|
||
void dzbj_button_on_key2_press(btn_event_cb_t cb, void *usr_data);
|
||
|
||
// 吧唧模式 BOOT 单击处理(唤醒屏幕 / 退出手电筒 / 返回Home)
|
||
void dzbj_boot_click_handler(void);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|