feat(ge_interface): 添加按钮输入功能并优化定时器
- 新增 button4_4 按钮输入模块,实现 4x4 按钮矩阵的扫描和处理 - 添加 ge_timer 模块,提供基本的定时功能 - 优化 ge_render 模块,调整屏幕尺寸的类型 - 修复 init_lcd 函数的定义,使其返回类型为 void
This commit is contained in:
25
libs/ge_interface/member/ge_mem_input.h
Normal file
25
libs/ge_interface/member/ge_mem_input.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef __GE_MEM_INPUT_H__
|
||||
#define __GE_MEM_INPUT_H__
|
||||
|
||||
#include <main.h>
|
||||
#include <gpio.h>
|
||||
#include <stdint.h>
|
||||
#include "../ge_interface.h"
|
||||
int Button4_4_Scan(void);
|
||||
|
||||
#define delay_ms HAL_Delay
|
||||
#define GPIO_ReadInputDataBit HAL_GPIO_ReadPin
|
||||
#define GPIO_SetBits(port, pin) HAL_GPIO_WritePin(port, pin, 1)
|
||||
#define GPIO_ResetBits(port, pin) HAL_GPIO_WritePin(port, pin, 0)
|
||||
#ifdef __GE_INPUT_IMPLIMEMT__
|
||||
|
||||
void mem_input_btn_func(ge_input_t* ctx) {
|
||||
uint16_t code = Button4_4_Scan();
|
||||
ge_input_event_t event;
|
||||
event.num = GE_ITYPE_KEY_L1H1 + code;
|
||||
ctx->func_send(ctx, event);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user