Files
Rader_IQ/src/io_flash.h

43 lines
1.3 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 IO_FLASH_H
#define IO_FLASH_H
#include <Arduino.h>
#include <Preferences.h>
// 引脚定义
#define BOOT_BUTTON_PIN 0 // Boot按钮引脚
#define NETWORK_LED_PIN 35 // 网络状态LED指示灯开发板48引脚雷达板35引脚
#define CONFIG_CLEAR_PIN 4 // 配置清除指示灯
#define Radar_Start 36 // 定义雷达启动引脚拉高启动
#define GPIO8 8 // 自定义GPIO8
#define GPIO9 9 // 自定义GPIO9
// 配置清除指示灯状态枚举
enum ConfigClearStatus {
CONFIG_NORMAL, // 正常运行 - LOW
CONFIG_PREPARING, // 准备清除 - HIGH
CONFIG_CLEARING, // 清除过程中 - 呼吸灯
CONFIG_COMPLETED // 清除完成 - 快速闪烁3次
};
// 全局变量声明
extern Preferences preferences;
extern uint16_t currentDeviceId; // 当前设备ID
extern bool clearConfigRequested; // 清除配置请求标志
extern bool forceLedOff; // 强制关闭LED标志
extern ConfigClearStatus currentConfigClearStatus; // 当前配置清除状态
// 函数声明
void checkBootButton();
void loadDeviceId();
void saveDeviceId();
void clearStoredConfig();
void io_flash_init();
// 任务声明
void configClearLedTask(void *parameter);
void bootButtonMonitorTask(void *parameter);
void ledControlTask(void *parameter);
#endif // IO_FLASH_H