Files
DTU-HMI/src/Drv/key.h

39 lines
1.3 KiB
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 "types.h"
#define KEY_U (0x02) // 上 32
#define KEY_D (0x40) // 下 16
#define KEY_L (0x10) // 左 8
#define KEY_R (0x08) // 右 4
#define KEY_ENT (0x20) // 确认 1
#define KEY_ESC (0x01) // 取消 2
#define KEY_F1 (0x04) // F1
#define KEY_F2 (0x80) // F2
#define KEY_ADD (0x82)
#define KEY_SUB (0x84)
#define KEY_NONE (0) // (无)
enum _KEY_VALID_FLAG_ { // 按键是否有效标志
EN_KEY_FLAG_NULL =0, // 无新按键
EN_KEY_FLAG_NEW, // 有新按键
EN_KEY_FLAG_SAM, // 采样过程中(未确定)
};
typedef struct{ // 按键控制结构
uint8_t byUsrFlg; // 用户标志0x55标志 有显示已刷新,供远程显示用
uint8_t byKeyValid; // 有效标志 <见 _KEY_VALID_FLAG_ 定义>
uint8_t byKeyValue; // 键值
uint8_t bUseRkey; //是否启用远程按键
}tagRKeyCtrl;
extern tagRKeyCtrl g_tRemoteKey; //远程按键
uint8_t Key_Read(void);
void Key_Init(void);
#endif