add keypad module, fix keys gpio define

This commit is contained in:
Sheikah
2023-01-24 00:44:56 +08:00
parent df4db6d8c4
commit 22f90eb896
9 changed files with 154 additions and 32 deletions

21
Core/App/Input/keypad.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#define kp_NOP 0x0
#define kp_KEY_DOWN 0x1
#define kp_KEY_UP 0x2
#define kp_ROTATE_LEFT 0x3
#define kp_ROTATE_RIGHT 0x4
#define kp_KEY1 0x0
#define kp_KEY2 0x1
#define kp_KEY3 0x2
#define kp_KEY4 0x3
#define kp_KEY5 0x4
#define kp_KEY6 0x5
#define kp_KEYENCODER 0x6
#define kp_Type(x) (x & 0b1111)
#define kp_Value(x) (x >> 4)
// query and return keypad event
uint8_t kp_query();