25 lines
576 B
Plaintext
25 lines
576 B
Plaintext
/**
|
|||
|
|
* @file temp_sensor.cpp
|
||
|
|
* @brief 温度传感采样实现。
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include "device/adc.h"
|
||
|
|
#include "device/temp_sensor.h"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 初始化温度传感采样所需硬件资源。
|
||
|
|
* @note 当前通过初始化 ADC 模块完成内部温度通道准备。
|
||
|
|
*/
|
||
|
|
void temp_sensor_init(void)
|
||
|
|
{
|
||
|
|
adc_hw_init();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 采集一次温度传感样本并输出结果。
|
||
|
|
* @param[out] data 指向输出样本结构体的指针;其语义与 adc_collect_sample() 一致。
|
||
|
|
*/
|
||
|
|
void temp_sensor_sample(temp_sensor_data_t *data)
|
||
|
|
{
|
||
|
|
adc_collect_sample(data);
|
||
|
|
}
|