Files
STM32F4-Base/simulator/sim_port.h
T
2026-08-31 17:09:59 +08:00

39 lines
1.0 KiB
C

/*
* 模块名称:Simulator Display Port (SDL2 模拟器端口)
* 模块功能:为 PC 模拟器提供 LVGL SDL2 显示与键盘输入端口
* 适用平台:Windows / Linux / macOS (SDL2)
* 说明:替代 MCU 端的 ui_port.c,用于 PC 上 UI 开发与调试
*/
#ifndef __SIM_PORT_H
#define __SIM_PORT_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* 函数功能:初始化 SDL2 显示窗口与键盘输入设备
* 入口参数:hor_res - 水平分辨率 int32_t
* ver_res - 垂直分辨率 int32_t
* 返回值:0 - 成功,-1 - 失败
* 限定条件:lv_init() 已调用
* 函数说明:创建 SDL 窗口、键盘输入设备及默认输入组
*/
int sim_port_init(int32_t hor_res, int32_t ver_res);
/*
* 函数功能:获取 SDL 显示设备句柄
* 入口参数:无
* 返回值:显示设备指针 lv_display_t * 可能为 NULL
* 限定条件:sim_port_init() 已成功调用
*/
void *sim_port_get_display(void);
#ifdef __cplusplus
}
#endif
#endif /* __SIM_PORT_H */