Files
base/app/app_temp.h
2025-08-26 10:53:01 +08:00

53 lines
987 B
C

#ifndef APP_TEMP_H
#define APP_TEMP_H
#ifdef __cplusplus
extern "C"
{
#endif
// 定义温度状态枚举
typedef enum
{
TEMP_NORMAL,
TEMP_WARNING,
TEMP_CRITICAL
} TempState;
// 定义温度控制模式枚举
typedef enum
{
TEMP_MODE_AUTO,
TEMP_MODE_MANUAL
} TempMode;
typedef struct
{
TempState state;
TempMode mode;
int16_t current_temp[8]; // 当前温度,对应8个通道
int16_t target_temp; // 目标温度
uint8_t fan_speed; // 风扇速度
Timer timer; // 定时器
} TempSystem;
// 在头文件中声明外部变量
extern TempSystem temp_data;
// 使用内联函数
static inline uint8_t setFanOn(void) { return 1; }
static inline uint8_t setFanOff(void) { return 0; }
void tempAppInit(void);
void setTempMode(TempMode mode);
void setTargetTemp(int16_t temp);
void setFanSpeed(uint8_t speed);
#ifdef __cplusplus
}
#endif
#endif // APP_TEMP_H