1. 按键驱动重构:GPIO中断+手动去抖 → iot_button组件(单击/双击/长按) 2. 新增key_nav按键导航管理器:上下文状态机 + Set界面焦点蓝色边框高亮 3. 移除所有触摸手势/点击事件(ScreenHome/ScreenImg/ScreenSet) 4. 应援灯颜色切换优化:DISPOFF→直接写GRAM→DISPON,消除分band刷新 5. 亮度调节按键化:BOOT +10% / KEY -10% / KEY长按退出 6. 休眠管理适配:按键唤醒统一由key_nav处理 7. 新增迁移总结文档 docs/touch-to-button-migration.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
771 B
C
35 lines
771 B
C
/*
|
|
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "esp_err.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct button_driver_t button_driver_t; /*!< Type of button object */
|
|
|
|
struct button_driver_t {
|
|
/*!< (optional) Need Support Power Save */
|
|
bool enable_power_save;
|
|
|
|
/*!< (necessary) Get key level */
|
|
uint8_t (*get_key_level)(button_driver_t *button_driver);
|
|
|
|
/*!< (optional) Enter Power Save cb */
|
|
esp_err_t (*enter_power_save)(button_driver_t *button_driver);
|
|
|
|
/*!< (optional) Del the hardware driver and cleanup */
|
|
esp_err_t (*del)(button_driver_t *button_driver);
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|