Allow custom DC/DC control functions
A Kconfig CUSTOM_DCDC_CONTROLLER is introduced to enable implementation of more sophisticated control functions than the standard perturb and observe. A function dcdc_low_level_controller() must be implemented and is called from the DMA interrupt after each new current sensor reading. The default Dcdc::control() function is defined __weak.
This commit is contained in:
-10
@@ -34,16 +34,6 @@ static volatile AdcAlert adc_alerts_lower[NUM_ADC_CH] = {};
|
||||
|
||||
extern DeviceStatus dev_stat;
|
||||
|
||||
#ifdef CONFIG_SOC_SERIES_STM32G4X
|
||||
// Using internal reference buffer at VREF+ pin, set to 2048 mV
|
||||
#define VREF (2048)
|
||||
#else
|
||||
// internal STM reference voltage
|
||||
#define VREF (VREFINT_VALUE * VREFINT_CAL / adc_value(ADC_POS_VREF_MCU))
|
||||
#endif
|
||||
|
||||
#define ADC_GAIN(name) ((float)DT_ADC_GAIN_##name##_NUMERATOR / DT_ADC_GAIN_##name##_DENOMINATOR)
|
||||
|
||||
/**
|
||||
* Average value for ADC channel
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user