Files
tc264smart/code/user_menu.h
T
32343 843447835d Initial commit: TC264 smart car project with IPS200 menu system
- IPS200 display menu with real-time status and parameter settings
- Camera image processing and line tracking
- IMU attitude solution and PID control
- WiFi SPI oscilloscope data transmission
2026-05-10 21:38:49 +08:00

80 lines
4.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef _USER_MENU_H_
#define _USER_MENU_H_
#include "zf_common_typedef.h"
#include "zf_device_mt9v03x_double.h"
#include "zf_device_ips200.h"
/*============================================================
* 菜单页面定义
*============================================================*/
#define MENU_PAGE_REALTIME 0 /* 页面0: 实时状态显示页 */
#define MENU_PAGE_PARAMETER 1 /* 页面1: 参数设置页 */
/*============================================================
* 参数表定义
*============================================================*/
#define PARAM_TOTAL_NUM 9 /* 参数总数: WiFi+4浮点+PID选择+3PID值 */
#define PARAM_PER_PAGE 10 /* 每页显示参数个数 */
/*============================================================
* 屏幕布局宏定义 (IPS200 竖屏 240x320)
*============================================================*/
#define SCREEN_WIDTH 240 /* 屏幕宽度 */
#define SCREEN_HEIGHT 320 /* 屏幕高度 */
/* 状态栏区域 */
#define STATUSBAR_Y 0 /* 状态栏起始Y坐标 */
#define STATUSBAR_H 32 /* 状态栏高度(两行:BAT行 + CPU行,每行16px) */
#define STATUSBAR_FONT_SIZE IPS200_8X16_FONT /* 状态栏字体大小 */
/* 图像显示区域 */
#define IMAGE_Y (STATUSBAR_Y + STATUSBAR_H + 2) /* 图像起始Y坐标 */
#define IMAGE_CAM_W MT9V03X_1_W /* 摄像头图像宽度 */
#define IMAGE_CAM_H MT9V03X_1_H /* 摄像头图像高度 */
#define IMAGE_X ((SCREEN_WIDTH - IMAGE_CAM_W) / 2) /* 图像居中X */
/* 实时数据区域 */
#define DATA_Y (IMAGE_Y + IMAGE_CAM_H + 2) /* 数据起始Y坐标 */
#define DATA_LINE_H 16 /* 每行数据高度 */
#define DATA_FONT_SIZE IPS200_8X16_FONT
/* 参数页面布局 */
#define PARAM_PAGE_TITLE_Y 0 /* 参数页标题Y坐标 */
#define PARAM_START_Y 20 /* 参数内容起始Y坐标 */
#define PARAM_LINE_H 16 /* 参数行高 */
/*============================================================
* 进度条颜色定义 (从低到高 红->黄->绿)
*============================================================*/
#define COLOR_BAR_LOW RGB565_RED
#define COLOR_BAR_MID RGB565_YELLOW
#define COLOR_BAR_HIGH RGB565_GREEN
#define COLOR_BG RGB565_BLACK /* 背景色 */
#define COLOR_TEXT RGB565_WHITE /* 文字色 */
#define COLOR_HIGHLIGHT RGB565_CYAN /* 高亮色 */
#define COLOR_BAR_BG RGB565_BLUE /* 进度条底色 */
extern uint8 camera_frame_buffer[MT9V03X_1_H * MT9V03X_1_W]; /* 帧缓冲区 */
/*============================================================
* 函数声明
*============================================================*/
void user_menu_init (void); /* 菜单初始化 */
void user_menu_loop (void); /* 菜单主循环 */
void user_menu_key_dispose (void); /* 按键处理 */
void user_menu_switch_page (void); /* 页面切换 */
void user_menu_draw_status_bar (void); /* 绘制顶部状态栏 */
void user_menu_draw_progress_bar (uint16 x, uint16 y, uint16 w, uint16 percent, uint16 color); /* 绘制进度条 */
void user_menu_draw_camera (void); /* 绘制摄像头灰度图像 */
void user_menu_draw_camera_binary(void); /* 绘制摄像头二值化图像 */
void user_menu_draw_realtime_data(void); /* 绘制实时数据 */
void user_menu_draw_param_page (void); /* 绘制参数设置页面 */
void user_menu_draw_param_table (void); /* 绘制参数表格 */
#endif