期末大作业-增加矩阵键盘
This commit is contained in:
22
FinalHomework/Core/Inc/MatrixKey.h
Normal file
22
FinalHomework/Core/Inc/MatrixKey.h
Normal 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
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user