refactor(algorithm): 移除冗余头文件 移除不必要的stdint.h头文件引用,统一使用<cstdint> refactor(sys): 清理系统级头文件依赖 移除未使用的头文件引用,统一整型类型定义,优化初始 化过程中的GPIO配置
40 lines
730 B
C++
40 lines
730 B
C++
#ifndef _ADC_H
|
|
#define _ADC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "config.h"
|
|
|
|
class sampler {
|
|
private:
|
|
float vbus_samples[ADC_FILTER_SIZE + 1];
|
|
float currU_samples[ADC_FILTER_SIZE + 1];
|
|
float currV_samples[ADC_FILTER_SIZE + 1];
|
|
float currW_samples[ADC_FILTER_SIZE + 1];
|
|
float mcu_temp_samples[ADC_FILTER_SIZE + 1];
|
|
float drv_temp_samples[ADC_FILTER_SIZE + 1];
|
|
u8 current_sample_index;
|
|
|
|
float tempora_sample;
|
|
|
|
public:
|
|
u8 init(void);
|
|
void update_mcu_temp(void);
|
|
void update_drv_temp(void);
|
|
void update_vbus_voltage(void);
|
|
void update_current(void);
|
|
|
|
float get_mcu_temp(void);
|
|
float get_drv_temp(void);
|
|
float get_vbus_voltage(void);
|
|
float get_current(char);
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|