refactor(ADC): 重构采样逻辑并封装为 sampler 类 refactor(CAN): 更新 CAN 发送器以使用新的sampler 接口 refactor(timer): 调整定时器中断结构并优化任务调度
39 lines
594 B
C++
39 lines
594 B
C++
#ifndef _ADC_H
|
|
#define _ADC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "stdint.h"
|
|
|
|
class sampler {
|
|
private:
|
|
float vbus_samples[7];
|
|
float currU_samples[7];
|
|
float currV_samples[7];
|
|
float currW_samples[7];
|
|
float mcu_temp_samples[7];
|
|
float drv_temp_samples[7];
|
|
|
|
float tempora_sample;
|
|
public:
|
|
void init();
|
|
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
|