Boen_Shi 8be2866433 feat(base): 初始化 MSPM0 开发环境
- 添加头文件和配置文件支持
- 更新.gitignore忽略编译和IDE相关文件
- 添加基础的bsp代码
2026-07-16 14:45:26 +08:00

39 lines
620 B
C++

#ifndef KEY_H
#define KEY_H
#include "ti_msp_dl_config.h"
#define KEY1 0
#define KEY2 1
#define KEY3 2
#define KEY4 3
#define KEY_LEFT KEY1
#define KEY_RIGHT KEY2
#define KEY_ACCESS KEY3
#define KEY_CANCEL KEY4
#define KEY1_PIN_ID 7
#define KEY2_PIN_ID 10
#define KEY3_PIN_ID 11
#define KEY4_PIN_ID 14
class Key {
public:
struct KeyData {
uint8_t id;
GPIO_Regs *port;
uint32_t pin;
uint8_t state;
};
static KeyData keys[];
static void init();
static uint8_t getState(uint8_t id);
static void setState(uint8_t id, uint8_t state);
private:
};
#endif //KEY_H