| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /**
- ******************************************************************************
- * @file Logic_temperature.h
- * @brief 温度数据逻辑层 (Logic)
- *
- * @note 本文件为逻辑层 (Logic) 接口, 供 UI 页面层获取温度数据。
- * 实时温度取自 CPLD 快照 "24 路 BMC 原始温度读数" (经 Mid_temp
- * 缓存); 预加热温度取自 CT7428 前 4 路 (映射见 Mid_temp)。
- *
- * 温度通道划分:
- * 通道 0 ~ 11 -> CPU0
- * 通道 12 ~ 23 -> CPU1 (共 24 条, 前 12 条 CPU0, 后 12 条 CPU1)
- ******************************************************************************
- */
- #ifndef __LOGIC_TEMPERATURE_H
- #define __LOGIC_TEMPERATURE_H
- #include <stdint.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* 温度相关常量 */
- #define LOGIC_TEMP_TOTAL_CH 24 /* 温度通道总数 */
- #define LOGIC_TEMP_CPU_CH_COUNT 12 /* 每个 CPU 的通道数 */
- #define LOGIC_TEMP_INVALID (-127) /* 无数据/无效温度哨兵值 (UI 据此显示 "--") */
- /* 功能函数 ----------------------------------------------------------------*/
- /**
- * @brief 获取指定通道的温度值 (BMC 24 路真实读数)
- * @param ch : 通道号 (0 ~ LOGIC_TEMP_TOTAL_CH-1)
- * @retval 温度值 (摄氏度, 整数); 无数据/通道无效/越界返回 LOGIC_TEMP_INVALID
- */
- int8_t Logic_temperature_get(uint8_t ch);
- /**
- * @brief 获取指定通道所属的 CPU 编号
- * @param ch : 通道号
- * @retval 0 = CPU0, 1 = CPU1; 越界返回 -1
- */
- int8_t Logic_temperature_get_cpu(uint8_t ch);
- /* 预加热温度 (CT7428 4 路) */
- #define LOGIC_PREHEAT_TEMP_NUM 4 /* 预加热温度数量 */
- /**
- * @brief 获取预加热传感器的温度值
- * @note 真实数据源: CPLD 快照内 CT7428 (映射暂定 = 前 4 路, 见 Mid_temp.h)
- * @param idx : 序号 (0 ~ LOGIC_PREHEAT_TEMP_NUM-1); 0/1 = CPU0, 2/3 = CPU1
- * @retval 温度值 (摄氏度); 无数据/无效/越界返回 LOGIC_TEMP_INVALID
- */
- int8_t Logic_preheat_get(uint8_t idx);
- #ifdef __cplusplus
- }
- #endif
- #endif /* __LOGIC_TEMPERATURE_H */
|