/* `t_thermal` 的两个回调在 ESP32-S3 上的实现(A16)。**只进 IDF 目标。** 温度:ADC1 oneshot + 曲线拟合校准 → mV → `ntc_mc_from_mv()`; TACH:两个 PCNT 单元数上升沿(累计计数,uint32 回绕安全)。 */ #ifndef THERMAL_ESP_H #define THERMAL_ESP_H #include #include #include "hal_err.h" /* 起 ADC 与 PCNT。失败不 abort:温度读不到 t_thermal 会满速(§10.10), TACH 读不到就不判停转 —— 两者都是降级,不是固件写错了。 返回第一个错误码;已经起来的那一半照常可用。 */ hal_err_t thermal_esp_init(void); bool thermal_esp_temp(void *ctx, int idx, int32_t *milli_c); /* therm_temp_fn */ bool thermal_esp_tach(void *ctx, int idx, uint32_t *edges); /* therm_tach_fn */ /* 最近一次读到的两路原始毫伏(调试 / 标定用;读失败是 −1)。 */ int32_t thermal_esp_last_mv(int idx); #endif /* THERMAL_ESP_H */