Files
STM32F103/STM32F103C8T6/User/menu.h

56 lines
1.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 __MENU_H
#define __MENU_H
#ifdef __cplusplus
extern "C" {
#endif
#include "main.h"
/* 参数数量 */
#define PARAM_COUNT 4
/* 参数ID枚举 */
typedef enum {
PARAM_PWM1 = 0, /* PA6 TIM3_CH1 */
PARAM_PWM2, /* PA7 TIM3_CH2 */
PARAM_PWM3, /* PB0 TIM3_CH3 */
PARAM_PWM4, /* PB1 TIM3_CH4 */
} ParamId_t;
/*
* 函数功能:菜单系统初始化
* 入口参数:无
* 返回值:无
* 函数说明从EEPROM加载参数清屏绘制初始界面
*/
void menu_init(void);
/*
* 函数功能:菜单系统循环处理
* 入口参数:无
* 返回值:无
* 函数说明:轮询按键事件,更新参数/界面。需在主循环中频繁调用
*/
void menu_process(void);
/*
* 函数功能:获取指定参数的当前值
* 入口参数id - 参数ID
* 返回值:参数值
*/
int32_t menu_get_param(ParamId_t id);
/*
* 函数功能强制保存参数到EEPROM
* 入口参数:无
* 返回值0=成功,负值=失败
*/
int menu_save_params(void);
#ifdef __cplusplus
}
#endif
#endif /* __MENU_H */