34 lines
903 B
Plaintext
34 lines
903 B
Plaintext
/**
|
|||
|
|
* @file temp_sensor.h
|
||
|
|
* @brief 温度传感采样接口定义。
|
||
|
|
*/
|
||
|
|
#ifndef DEVICE_TEMP_SENSOR_H
|
||
|
|
#define DEVICE_TEMP_SENSOR_H
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include "device/adc.h"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 温度传感采样数据类型别名。
|
||
|
|
* @note 复用 ADC 采样结果结构,统一保存温度与参考电压原始值及换算值。
|
||
|
|
*/
|
||
|
|
typedef adc_sample_t temp_sensor_data_t;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 初始化温度传感采样所需硬件资源。
|
||
|
|
* @param[in] 无。
|
||
|
|
* @param[out] 无。
|
||
|
|
* @retval 无返回值。
|
||
|
|
* @note 当前通过初始化 ADC 模块完成内部温度通道准备。
|
||
|
|
*/
|
||
|
|
void temp_sensor_init(void);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 采集一次温度传感样本并输出结果。
|
||
|
|
* @param[out] data 指向输出样本结构体的指针;其语义与 adc_collect_sample() 一致。
|
||
|
|
* @retval 无返回值。
|
||
|
|
*/
|
||
|
|
void temp_sensor_sample(temp_sensor_data_t *data);
|
||
|
|
|
||
|
|
#endif /* DEVICE_TEMP_SENSOR_H */
|