Files
Motor_v2/Robot_V2/device/adc.h
T

40 lines
730 B
C++
Raw Normal View History

2025-09-23 00:27:51 +08:00
#ifndef _ADC_H
#define _ADC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"
class sampler {
2025-10-30 20:20:14 +08:00
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];
2025-11-23 18:31:47 +08:00
u8 current_sample_index;
float tempora_sample;
2025-10-30 20:20:14 +08:00
public:
2025-12-08 02:48:59 +08:00
u8 init(void);
void update_mcu_temp(void);
void update_drv_temp(void);
void update_vbus_voltage(void);
void update_current(void);
2025-10-30 20:20:14 +08:00
float get_mcu_temp(void);
float get_drv_temp(void);
float get_vbus_voltage(void);
float get_current(char);
};
2025-09-23 00:27:51 +08:00
#ifdef __cplusplus
}
#endif
#endif