app: use DAQ driver
Replace the register-level ADC, DAC and DMA handling in daq_driver.c by the new DAQ driver. The application only maps the measurements to the power ports and DC buses and handles the alerts. The factory calibration values are removed from mcu.h, as they are provided by the driver now. All boards are migrated to the new libresolar,stm32-daq compatible. The unit tests use the emulated DAQ. The high-side overvoltage limit is now set after the DAQ setup. Before, the limit was calculated before any reading of the internal reference voltage was available, so that the alert never triggered on boards without fixed reference voltage (STM32F0 and STM32L0). Note for out-of-tree boards: The adc-inputs node must use the compatible libresolar,stm32-daq instead of adc-inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
82c5d1542d
commit
55f1c86523
+5
-4
@@ -42,10 +42,6 @@ int main(void)
|
||||
battery_conf_init(&bat_conf, CONFIG_BAT_TYPE, CONFIG_BAT_NUM_CELLS, CONFIG_BAT_CAPACITY_AH);
|
||||
battery_conf_overwrite(&bat_conf, &bat_conf_user); // initialize conf_user with same values
|
||||
|
||||
#if BOARD_HAS_DCDC
|
||||
daq_set_hv_limit(DT_PROP(DT_PATH(pcb), hs_voltage_max));
|
||||
#endif
|
||||
|
||||
#if CONFIG_HV_TERMINAL_SOLAR || CONFIG_LV_TERMINAL_SOLAR || CONFIG_PWM_TERMINAL_SOLAR
|
||||
solar_terminal.init_solar();
|
||||
#endif
|
||||
@@ -60,6 +56,11 @@ int main(void)
|
||||
// Data Acquisition (DAQ) setup
|
||||
daq_setup();
|
||||
|
||||
#if BOARD_HAS_DCDC
|
||||
// requires the reference voltage, which may be calculated from initial measurements
|
||||
daq_set_hv_limit(DT_PROP(DT_PATH(pcb), hs_voltage_max));
|
||||
#endif
|
||||
|
||||
charger.detect_num_batteries(&bat_conf); // check if we have 24V instead of 12V system
|
||||
charger.init_terminal(&bat_conf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user