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:
Martin Jäger
2026-11-01 12:16:45 +01:00
co-authored by Claude Opus 5.5
parent 82c5d1542d
commit 55f1c86523
27 changed files with 158 additions and 859 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ void PwmSwitch::test()
}
else if (!pwm_active() && enable == true) {
// turning the PWM switch on creates a short voltage rise, so inhibit alerts by 50 ms
adc_upper_alert_inhibit(ADC_POS(v_low), 50);
daq_inhibit_alert(DAQ_DEV, DAQ_CH(v_low), DAQ_ALERT_UPPER, 50);
pwm_signal_start(0.9F);
LOG_INF("PWM test mode start.");
}
@@ -127,7 +127,7 @@ void PwmSwitch::control()
&& uptime() > (off_timestamp + restart_interval) && enable == true)
{
// turning the PWM switch on creates a short voltage rise, so inhibit alerts by 50 ms
adc_upper_alert_inhibit(ADC_POS(v_low), 50);
daq_inhibit_alert(DAQ_DEV, DAQ_CH(v_low), DAQ_ALERT_UPPER, 50);
if (dev_stat.has_error(ERR_PWM_SWITCH_OVERVOLTAGE)) {
// start with minimum duty cycle in order to prevent another overvoltage event