Files
DTU-LCD/Drivers/BSP/KEY/key.h
2026-01-24 20:03:14 +08:00

36 lines
993 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef __KEY_H__
#define __KEY_H__
#include "./SYSTEM/sys/sys.h"
#include "MultiButton.h"
typedef enum
{
KEY_NONE = 0, // 没有按键
KEY_ENTER, // 确认
KEY_UP, // 向上
KEY_DOWN, // 向下
KEY_ESC, //取消
KEY_ADD, //加
KEY_DEC, //减
KEY_LEFT, //左
KEY_RIGHT, //右
KEY_RESET, //复位
KEY_FACTORY, //工厂
} KEY_TYPE;
// 按键回调函数类型定义(业务逻辑层使用)
// 参数: key_type - 按键类型
typedef void (*KeyCallback)(KEY_TYPE key_type);
// 按键驱动函数在key.c中实现使用MultiButton库
void Key_Init(void); // 按键初始化
void Key_RegisterCallback(KeyCallback callback); // 注册按键回调函数(业务逻辑层调用)
#define Button_Ticks() button_ticks()
#endif