mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
update key
This commit is contained in:
@@ -7,21 +7,42 @@ extern "C" {
|
||||
|
||||
#include "main.h"
|
||||
|
||||
//KEY1
|
||||
#define KEY1_PORT GPIOA
|
||||
#define KEY1_PIN GPIO_PIN_0
|
||||
#define KEY1 HAL_GPIO_ReadPin(KEY1_PORT,KEY1_PIN)
|
||||
// boot, yes, right, left, no
|
||||
#define KEYB_NUM 1
|
||||
#define KEYY_NUM 2
|
||||
#define KEYL_NUM 3
|
||||
#define KEYR_NUM 4
|
||||
#define KEYN_NUM 5
|
||||
|
||||
//KEY2
|
||||
#define KEY2 0
|
||||
//KEYB
|
||||
#define KEYB_PORT GPIOA
|
||||
#define KEYB_PIN GPIO_PIN_0
|
||||
#define KEYB HAL_GPIO_ReadPin(KEYB_PORT,KEYB_PIN)
|
||||
|
||||
//KEYY
|
||||
#define KEYY_PORT GPIOA
|
||||
#define KEYY_PIN GPIO_PIN_1
|
||||
#define KEYY HAL_GPIO_ReadPin(KEYY_PORT,KEYY_PIN)
|
||||
|
||||
//KEYL
|
||||
#define KEYL_PORT GPIOA
|
||||
#define KEYL_PIN GPIO_PIN_2
|
||||
#define KEYL HAL_GPIO_ReadPin(KEYL_PORT,KEYL_PIN)
|
||||
|
||||
//KEYR
|
||||
#define KEYR_PORT GPIOA
|
||||
#define KEYR_PIN GPIO_PIN_3
|
||||
#define KEYR HAL_GPIO_ReadPin(KEYR_PORT,KEYR_PIN)
|
||||
|
||||
//KEYN
|
||||
#define KEYN_PORT GPIOA
|
||||
#define KEYN_PIN GPIO_PIN_4
|
||||
#define KEYN HAL_GPIO_ReadPin(KEYN_PORT,KEYN_PIN)
|
||||
|
||||
void Key_Port_Init(void);
|
||||
void Key_Interrupt_Callback(void);
|
||||
uint8_t KeyScan(uint8_t mode);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user