⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keypaddef.h

📁 LV24000的单片机DEMO程序
💻 H
字号:
// keypadDef.h: data/structure for keypad

//-----------------------------------------------------------------------------
// Key mapping table, used by the keypad dispatcher (ProcessKey)
//-----------------------------------------------------------------------------
	// Definitions for key codes: we have 4 rows and 4 column.
	// So use bit [1:0] for column, bit [3:2] for row (the key code will fix in low nibble of a byte)
	// The 16 keys have code 0...F
	#define KB_COL_0		0x0
	#define KB_COL_1		0x1
	#define KB_COL_2		0x2
	#define KB_COL_3		0x3

	#define KB_ROW_0		(0x0<<2)
	#define KB_ROW_1		(0x1<<2)
	#define KB_ROW_2		(0x2<<2)
	#define KB_ROW_3		(0x3<<2)

	// Keypad codes
	#define KP_NO_KEY		0xFF
	#define KP_LONG			0x10	// Long key flag
#ifdef PCB_L2
// ----
	#define KP_DOWN			0x0		// Row 0
	#define KP_LEFT			0x1
	#define KP_RIGHT		0x2
	#define KP_UP			0x3
	#define KP_4			0x4		// Row 1
	#define KP_7			0x5
	#define KP_1			0x6
	#define KP_S			0x7		// Star (*)
	#define KP_5			0x8		// Row 2
	#define KP_8			0x9
	#define KP_2			0xA
	#define KP_0			0xB
	#define KP_6			0xC		// Row 3
	#define KP_9			0xD
	#define KP_3			0xE
	#define KP_H			0xF		// Hek (#)
// ----
#endif //PCB_L2

#ifdef PCB_L3
// ----
	#define KP_DOWN			0xC
	#define KP_LEFT			0x0
	#define KP_RIGHT		0x8
	#define KP_UP			0x4
	#define KP_4			0x9
	#define KP_7			0x5
	#define KP_1			0xD
	#define KP_S			0x1		// Star (*)
	#define KP_5			0xA		// Row 2
	#define KP_8			0x6
	#define KP_2			0xE
	#define KP_0			0x2
	#define KP_6			0xB		// Row 3
	#define KP_9			0x7
	#define KP_3			0xF
	#define KP_H			0x3		// Hek (#)
// ----
#endif //PCB_L3

//-----------------------------------------------------------------------------
// Function pointer (mapping menu ID to a function), used by the keypad dispatcher (ProcessKey)
//-----------------------------------------------------------------------------
typedef BYTE (*KPMENU_FUNC)(BYTE);	// Keypad menu function

/* -------------------------------EOF------------------------------------------ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -