📄 key.h
字号:
/*
*********************************************************************************************************
* Embedded Systems Building Blocks
*********************************************************************************************************
*/
#include "data_cpu.h"
#include "reg935.h"
#include "intrins.h"
#include "ADS1211.h"
#ifndef CFG_H
#define KEY_BUF_SIZE 3 //键盘缓冲区的大小
//#define KEY_PORT_ROW _pd /* The port address of the keyboard matrix ROWs */
//#define KEY_PORT_COL _pd /* The port address of the keyboard matrix COLUMNs */
//#define KEY_PORT_CTRL _pdc /* The port address of the I/O ports control word */
#define KEY_MIN_ROWS 3 //键盘横向扫描最小值
#define KEY_MAX_ROWS 6 //键盘横向扫描最大值
#define KEY_MAX_COLS 3 //键盘纵向扫描最大值
#define KEY_RPT_DLY 2 //按键连续处理时按键间隔时间
#define KEY_RPT_START_DLY 30 //第一次按下到连续处理之间的间隔时间
#define KEY_STATE_UP 1 //按键起始位置
#define KEY_STATE_DEBOUNCE 2 //按键的第二个状态
#define KEY_STATE_RPT_START_DLY 3
#define KEY_STATE_RPT_DLY 4
#endif
#define KEY_ALL_ROWS 0xFF /* Select all rows (i.e. all rows LOW) */
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
void KeyFlush(void); //清空按键缓冲区
INT8U KeyGetKey(void); //取出按键值函数
BOOLEAN KeyHit(void); //判断缓冲区内是否有按键
void KeyInit(void); //按键初始化函数
void KeyScanISR(void *ddata); //按键扫描函数
//void KeyInitPort(void); /* Initialize I/O ports */
//INT8U KeyGetCol(void); /* Read COLUMNs */
//void KeySelRow(INT8U row); /* Select a ROW
extern INT8U KeyBuf[KEY_BUF_SIZE]; //键盘缓冲区
extern INT8U KeyBufInIx; //按键放入位置
extern INT8U KeyBufOutIx; //按键输出位置
//INT8U KeyDownTmr; //按键按下时间
extern INT8U KeyNRead; //缓冲区中有按键的个数
extern INT8U KeyScanState; //按键状态函数
extern INT8U KeyRptStartDlyCtr; //累加延时时间 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -