期末大作业-增加矩阵键盘

This commit is contained in:
2025-01-07 13:14:55 +08:00
parent cc80d09aeb
commit 618ae827f1
7 changed files with 277 additions and 26 deletions

View File

@@ -0,0 +1,22 @@
#ifndef __MATRIXKEY_H
#define __MATRIXKEY_H
#include<stdint.h>
enum {State0=0, State1, State2};
#define NO_KEY 0xFF
#ifdef __cplusplus
extern "C" {
#endif
uint8_t MatrixKeyScan(void);
extern uint8_t const KeyTable[16];
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -69,12 +69,16 @@ void Error_Handler(void);
#define OE_GPIO_Port GPIOC
#define SegLedData_Pin GPIO_PIN_0
#define SegLedData_GPIO_Port GPIOA
#define KeyLine_Pin GPIO_PIN_0
#define KeyLine_GPIO_Port GPIOB
#define LCD_RST_Pin GPIO_PIN_11
#define LCD_RST_GPIO_Port GPIOB
#define LCD_CS_Pin GPIO_PIN_12
#define LCD_CS_GPIO_Port GPIOB
#define LCD_RS_Pin GPIO_PIN_14
#define LCD_RS_GPIO_Port GPIOB
#define KeyRow_Pin GPIO_PIN_4
#define KeyRow_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */