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>
29 lines
626 B
C
29 lines
626 B
C
/*
|
|
* Copyright (c) The Libre Solar Project Contributors
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef DAQ_STUB_H_
|
|
#define DAQ_STUB_H_
|
|
|
|
/** Data to fill readings of the emulated DAQ during unit-tests
|
|
*/
|
|
typedef struct
|
|
{
|
|
float solar_voltage;
|
|
float battery_voltage;
|
|
float dcdc_current;
|
|
float load_current;
|
|
float bat_temperature;
|
|
float internal_temperature;
|
|
} AdcValues;
|
|
|
|
/** Set the readings of the emulated DAQ for the next samples */
|
|
void prepare_adc_readings(AdcValues values);
|
|
|
|
/** Set the filtered values of the emulated DAQ to the current readings */
|
|
void prepare_adc_filtered();
|
|
|
|
#endif
|