reworeked some stuff in ADC.c

added geter for comparators of mcpwm.c for ADC synchromisation
This commit is contained in:
2025-01-31 21:04:56 +01:00
parent 208f8cbb78
commit 14191cbef9
8 changed files with 342 additions and 140 deletions

View File

@@ -3,11 +3,10 @@
#include "esp_adc/adc_oneshot.h"
extern adc_cali_handle_t cali_handle;
adc_oneshot_unit_handle_t configure_ADC1();
uint32_t get_voltage_in(adc_oneshot_unit_handle_t adc1_handle);
uint32_t get_torque(adc_oneshot_unit_handle_t adc1_handle);
int32_t get_current_ASC712(adc_oneshot_unit_handle_t adc1_handle, int ADC_pin);
int32_t get_current_bridge(adc_oneshot_unit_handle_t adc1_handle, int ADC_pin);
void configure_ADC1();
uint32_t get_voltage_in();
uint32_t get_torque();
int32_t get_current_ASC712(int ADC_pin);
int32_t get_current_bridge(int ADC_pin);
#endif

View File

@@ -1,6 +1,7 @@
#ifndef MCPWM_H
#define MCPWM_H
#include "hal/mcpwm_types.h"
#include "driver/mcpwm_prelude.h"
typedef enum {
PHASE_U,
PHASE_V,
@@ -10,5 +11,5 @@ typedef enum {
void mcpwm_init();
void set_mcpwm_output(Phase highside, Phase lowside, float Duty);
void set_mcpwm_duty(float Duty);
void get_comps(mcpwm_cmpr_handle_t comps[3]);
#endif