foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
database_cfg.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file database_cfg.h
44  * @author foxBMS Team
45  * @date 2015-08-18 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup ENGINE_CONFIGURATION
49  * @prefix DATA
50  *
51  * @brief Database configuration header
52  *
53  * @details Provides interfaces to database configuration
54  *
55  */
56 
57 #ifndef FOXBMS__DATABASE_CFG_H_
58 #define FOXBMS__DATABASE_CFG_H_
59 
60 /*========== Includes =======================================================*/
61 
62 #include "battery_system_cfg.h"
63 
64 #include "mcu.h"
65 
66 #include <math.h>
67 #include <stdbool.h>
68 #include <stdint.h>
69 
70 /*========== Macros and Definitions =========================================*/
71 /** configuration struct of database channel (data block) */
72 typedef struct {
73  void *pDatabaseEntry; /*!< pointer to the database entry */
74  uint32_t dataLength; /*!< length of the entry */
75 } DATA_BASE_s;
76 
77 /** data block identification numbers */
78 typedef enum {
115  DATA_BLOCK_ID_MAX, /**< DO NOT CHANGE, MUST BE THE LAST ENTRY */
117 
119  (int16_t)DATA_BLOCK_ID_MAX < UINT8_MAX,
120  "Maximum number of database entries exceeds UINT8_MAX; adapted length "
121  "checking in DATA_Initialize and DATA_IterateOverDatabaseEntries");
122 
123 /** data block header */
124 typedef struct {
125  DATA_BLOCK_ID_e uniqueId; /*!< uniqueId of database entry */
126  uint32_t timestamp; /*!< timestamp of last database update */
127  uint32_t previousTimestamp; /*!< timestamp of previous database update */
129 
130 /** data block struct of cell voltage */
131 typedef struct {
132  /* This struct needs to be at the beginning of every database entry. During
133  * the initialization of a database struct, uniqueId must be set to the
134  * respective database entry representation in enum DATA_BLOCK_ID_e. */
135  DATA_BLOCK_HEADER_s header; /*!< Data block header */
136  uint8_t state; /*!< for future use */
137  int32_t stringVoltage_mV[BS_NR_OF_STRINGS]; /*!< uint: mV */
139  [BS_NR_OF_CELL_BLOCKS_PER_MODULE]; /*!< unit: mV */
140  uint64_t
141  invalidCellVoltage[BS_NR_OF_STRINGS]
142  [BS_NR_OF_MODULES_PER_STRING]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
143  uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid voltages */
144  uint32_t moduleVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]; /*!< unit: mV */
145  bool validModuleVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]; /*!< 0 -> if PEC okay; 1 -> PEC error */
147 
148 /** data block struct of cell temperatures */
149 typedef struct {
150  /* This struct needs to be at the beginning of every database entry. During
151  * the initialization of a database struct, uniqueId must be set to the
152  * respective database entry representation in enum DATA_BLOCK_ID_e. */
153  DATA_BLOCK_HEADER_s header; /*!< Data block header */
154  uint8_t state; /*!< for future use */
155  int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]
156  [BS_NR_OF_TEMP_SENSORS_PER_MODULE]; /*!< unit: deci &deg;C */
157  uint16_t invalidCellTemperature
158  [BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]; /*!< bitmask if temperatures are valid. 0->valid, 1->invalid */
159  uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid temperatures in each string */
161 
162 /** data block struct of minimum and maximum values */
163 typedef struct {
164  /* This struct needs to be at the beginning of every database entry. During
165  * the initialization of a database struct, uniqueId must be set to the
166  * respective database entry representation in enum DATA_BLOCK_ID_e. */
167  DATA_BLOCK_HEADER_s header; /*!< Data block header */
168 
169  int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< average cell voltages, unit: mV */
170  int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< minimum cell voltages, unit: mV */
171  int16_t previousMinimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous minimum cell voltages, unit: mV */
172  int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< maximum cell voltages, unit: mV */
173  int16_t previousMaximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous maximum cell voltages, unit: mV */
174  uint16_t nrModuleMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with minimum cell voltage */
175  uint16_t nrCellMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with minimum cell voltage */
176  uint16_t nrModuleMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with maximum cell voltage */
177  uint16_t nrCellMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with maximum cell voltage */
178  uint16_t validMeasuredCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid measured cell voltages */
179  float_t averageTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
180  int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
181  uint16_t nrModuleMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with minimum temperature */
182  uint16_t nrSensorMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with minimum temperature */
183  int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
184  uint16_t nrModuleMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with maximum temperature */
185  uint16_t nrSensorMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with maximum temperature */
186  uint16_t validMeasuredCellTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid measured cell temperatures */
187  uint8_t state; /*!< state of the min max module */
189 
190 /** data block struct of pack measurement values */
191 typedef struct {
192  /* This struct needs to be at the beginning of every database entry. During
193  * the initialization of a database struct, uniqueId must be set to the
194  * respective database entry representation in enum DATA_BLOCK_ID_e. */
195  DATA_BLOCK_HEADER_s header; /*!< Data block header */
196 
197  int32_t packCurrent_mA; /*!< current in the whole battery pack, unit: mA */
198  uint8_t invalidPackCurrent; /*!< bitmask if current is valid. 0->valid, 1->invalid */
199  int32_t batteryVoltage_mV; /*!< voltage between negative and positive battery pole, unit: mV */
200  uint8_t invalidBatteryVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
201  int32_t
202  highVoltageBusVoltage_mV; /*!< voltage between negative battery pole and after positive main contactor, unit: mV */
203  uint8_t invalidHvBusVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
204  int32_t packPower_W; /*!< power provided by respectively supplied to the battery pack, unit: W */
205  uint8_t invalidPackPower; /*!< bitmask if power is valid. 0->valid, 1->invalid */
206  int32_t stringVoltage_mV[BS_NR_OF_STRINGS]; /*!< voltage of each string, unit: mV */
207  uint8_t invalidStringVoltage[BS_NR_OF_STRINGS]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
208  int32_t stringCurrent_mA[BS_NR_OF_STRINGS]; /*!< current in each string, unit: mA */
209  uint8_t invalidStringCurrent[BS_NR_OF_STRINGS]; /*!< bitmask if currents are valid. 0->valid, 1->invalid */
210  int32_t stringPower_W[BS_NR_OF_STRINGS]; /*!< power of each string, unit: W */
211  uint8_t invalidStringPower[BS_NR_OF_STRINGS]; /*!< bitmask if power values are valid. 0->valid, 1->invalid */
213 
214 /** data block struct of current measurement */
215 typedef struct {
216  /* This struct needs to be at the beginning of every database entry. During
217  * the initialization of a database struct, uniqueId must be set to the
218  * respective database entry representation in enum DATA_BLOCK_ID_e. */
219  DATA_BLOCK_HEADER_s header; /*!< Data block header */
220  int32_t current_mA[BS_NR_OF_STRINGS]; /*!< unit: mA */
221  uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
222  uint8_t newCurrent; /*!< 0: measurement valid, 1: measurement invalid */
223  uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
224  uint32_t timestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
225  int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: 0.1&deg;C */
226  uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
227  int32_t power_W[BS_NR_OF_STRINGS]; /*!< unit: W */
228  uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
229  uint8_t newPower; /*!< counter that indicates a new power measurement */
230  uint32_t previousTimestampPower[BS_NR_OF_STRINGS]; /*!< previous timestamp of power measurement */
231  uint32_t timestampPower[BS_NR_OF_STRINGS]; /*!< timestamp of power measurement */
232  int32_t currentCounter_As[BS_NR_OF_STRINGS]; /*!< unit: A.s */
233  uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
234  uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of CC measurement */
235  uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< timestamp of CC measurement */
236  int32_t energyCounter_Wh[BS_NR_OF_STRINGS]; /*!< unit: Wh */
237  uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
238  uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of EC measurement */
239  uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< timestamp of EC measurement */
240  uint8_t invalidHighVoltageMeasurement
241  [BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< 0: measurement valid, 1: measurement invalid */
242  int32_t highVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< unit: mV */
243  uint32_t previousTimestampHighVoltage
245  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< previous timestamp of high voltage measurement */
246  uint32_t timestampHighVoltage[BS_NR_OF_STRINGS]
247  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< timestamp of high voltage measurement */
249 
250 /** data structure declaration of DATA_BLOCK_BALANCING_CONTROL */
251 typedef struct {
252  /* This struct needs to be at the beginning of every database entry. During
253  * the initialization of a database struct, uniqueId must be set to the
254  * respective database entry representation in enum DATA_BLOCK_ID_e. */
255  DATA_BLOCK_HEADER_s header; /*!< Data block header */
256  uint8_t enableBalancing; /*!< Switch for enabling/disabling balancing */
257  uint8_t threshold_mV; /*!< balancing threshold in mV */
258  uint8_t request; /*!< balancing request per CAN */
259  uint8_t balancingState[BS_NR_OF_STRINGS]
260  [BS_NR_OF_CELL_BLOCKS_PER_STRING]; /*!< 0: no balancing, 1: balancing active */
261  uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS]
262  [BS_NR_OF_CELL_BLOCKS_PER_STRING]; /*!< Difference in Depth-of-Discharge in mAs */
263  uint16_t nrBalancedCells[BS_NR_OF_STRINGS];
265 
266 /** data structure declaration of DATA_BLOCK_USER_IO_CONTROL */
267 typedef struct {
268  /* This struct needs to be at the beginning of every database entry. During
269  * the initialization of a database struct, uniqueId must be set to the
270  * respective database entry representation in enum DATA_BLOCK_ID_e. */
271  DATA_BLOCK_HEADER_s header; /*!< Data block header */
272  uint8_t state; /*!< for future use */
273  uint32_t eepromReadAddressToUse; /*!< address to read from for slave EEPROM */
274  uint32_t eepromReadAddressLastUsed; /*!< last address used to read from slave EEPROM */
275  uint32_t eepromWriteAddressToUse; /*!< address to write to for slave EEPROM */
276  uint32_t eepromWriteAddressLastUsed; /*!< last address used to write to for slave EEPROM */
277  uint8_t ioValueOut[BS_NR_OF_MODULES_PER_STRING]; /*!< data to be written to the port expander */
278  uint8_t ioValueIn[BS_NR_OF_MODULES_PER_STRING]; /*!< data read from to the port expander */
279  uint8_t eepromValueWrite[BS_NR_OF_MODULES_PER_STRING]; /*!< data to be written to the slave EEPROM */
280  uint8_t eepromValueRead[BS_NR_OF_MODULES_PER_STRING]; /*!< data read from to the slave EEPROM */
281  uint8_t
282  externalTemperatureSensor[BS_NR_OF_MODULES_PER_STRING]; /*!< temperature from the external sensor on slave */
284 
285 /** data block struct of cell balancing feedback */
286 typedef struct {
287  /* This struct needs to be at the beginning of every database entry. During
288  * the initialization of a database struct, uniqueId must be set to the
289  * respective database entry representation in enum DATA_BLOCK_ID_e. */
290  DATA_BLOCK_HEADER_s header; /*!< Data block header */
291  uint8_t state; /*!< for future use */
292  uint16_t value[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING]; /*!< unit: mV (optocoupler output) */
294 
295 /** data block struct of user multiplexer values */
296 typedef struct {
297  /* This struct needs to be at the beginning of every database entry. During
298  * the initialization of a database struct, uniqueId must be set to the
299  * respective database entry representation in enum DATA_BLOCK_ID_e. */
300  DATA_BLOCK_HEADER_s header; /*!< Data block header */
301  uint8_t state; /*!< for future use */
302  uint16_t value[BS_NR_OF_STRINGS][8u * 2u * BS_NR_OF_MODULES_PER_STRING]; /*!< unit: mV (mux voltage input) */
304 
305 /** data block struct of cell open wire */
306 typedef struct {
307  /* This struct needs to be at the beginning of every database entry. During
308  * the initialization of a database struct, uniqueId must be set to the
309  * respective database entry representation in enum DATA_BLOCK_ID_e. */
310  DATA_BLOCK_HEADER_s header; /*!< Data block header */
311  uint8_t state; /*!< for future use */
312  uint16_t nrOpenWires[BS_NR_OF_STRINGS]; /*!< number of open wires */
313  uint8_t openWire[BS_NR_OF_STRINGS]
315  (BS_NR_OF_CELL_BLOCKS_PER_MODULE + 1u)]; /*!< 1 -> open wire, 0 -> everything ok */
317 
318 /** data block struct of GPIO voltage */
319 typedef struct {
320  /* This struct needs to be at the beginning of every database entry. During
321  * the initialization of a database struct, uniqueId must be set to the
322  * respective database entry representation in enum DATA_BLOCK_ID_e. */
323  DATA_BLOCK_HEADER_s header; /*!< Data block header */
324  uint8_t state; /*!< for future use */
325  int16_t gpioVoltages_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING * BS_NR_OF_GPIOS_PER_MODULE]; /*!< unit: mV */
326  int16_t gpaVoltages_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES_PER_STRING * BS_NR_OF_GPAS_PER_MODULE]; /*!< unit: mV */
327  uint16_t
328  invalidGpioVoltages[BS_NR_OF_STRINGS]
329  [BS_NR_OF_MODULES_PER_STRING]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
331 
332 /** data block struct of error flags */
333 typedef struct {
334  /* This struct needs to be at the beginning of every database entry. During
335  * the initialization of a database struct, uniqueId must be set to the
336  * respective database entry representation in enum DATA_BLOCK_ID_e. */
337  DATA_BLOCK_HEADER_s header; /*!< Data block header */
338  bool afeCommunicationCrcError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
339  bool afeSlaveMultiplexerError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
340  bool afeCommunicationSpiError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
341  bool afeConfigurationError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
342  bool afeCellVoltageInvalidError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
343  bool afeCellTemperatureInvalidError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
344  bool baseCellVoltageMeasurementTimeoutError; /*!< false -> no error, true -> error */
345  bool redundancy0CellVoltageMeasurementTimeoutError; /*!< false -> no error, true -> error */
346  bool baseCellTemperatureMeasurementTimeoutError; /*!< false -> no error, true -> error */
347  bool redundancy0CellTemperatureMeasurementTimeoutError; /*!< false -> no error, true -> error */
348  bool currentMeasurementTimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
349  bool currentMeasurementInvalidError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
350  bool currentSensorVoltage1TimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
351  bool currentSensorVoltage2TimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
352  bool currentSensorVoltage3TimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
353  bool currentSensorPowerTimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
354  bool currentSensorCoulombCounterTimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
355  bool currentSensorEnergyCounterTimeoutError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
356  bool powerMeasurementInvalidError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
357  bool mainFuseError; /*!< false -> fuse ok, true -> fuse tripped */
358  bool stringFuseError[BS_NR_OF_STRINGS]; /*!< false -> fuse ok, true -> fuse tripped */
359  bool openWireDetectedError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
360  bool stateRequestTimingViolationError; /*!< false -> no error, true -> error */
361  bool canRxQueueFullError; /*!< false -> no error, true -> error */
362  bool canTxQueueFullError; /*!< false -> no error, true -> error */
363  bool coinCellLowVoltageError; /*!< false -> no error, true -> error */
364  bool plausibilityCheckPackVoltageError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
365  bool plausibilityCheckCellVoltageError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
366  bool plausibilityCheckCellVoltageSpreadError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
367  bool plausibilityCheckCellTemperatureError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
368  bool plausibilityCheckCellTemperatureSpreadError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
369  bool currentSensorNotRespondingError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
370  bool contactorInNegativePathOfStringFeedbackError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
371  bool contactorInPositivePathOfStringFeedbackError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
372  bool prechargeContactorFeedbackError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
373  bool interlockOpenedError; /*!< false -> no error, true -> error */
374  bool insulationMeasurementInvalidError; /*!< false -> no error, true -> error */
375  bool criticalLowInsulationResistanceError; /*!< false -> no critical resistance , true -> critical low resistance */
376  bool warnableLowInsulationResistanceError; /*!< false -> no warnable resistance, true -> warnable low resistance */
377  bool
378  insulationGroundFaultDetectedError; /*!< false -> no insulation fault between HV and chassis detected, true -> insulation fault detected */
379  bool prechargeAbortedDueToVoltage[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
380  bool prechargeAbortedDueToCurrent[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
381  bool deepDischargeDetectedError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
382  bool currentOnOpenStringDetectedError[BS_NR_OF_STRINGS]; /*!< false -> no error, true -> error */
383  bool mcuDieTemperatureViolationError; /*!< false -> no error, true -> error */
384  bool mcuSbcFinError; /*!< false -> no error, true -> error: short-circuit to RSTB */
385  bool mcuSbcRstbError; /*!< false -> no error, true -> error: RSTB not working */
386  bool pexI2cCommunicationError; /*!< the I2C port expander does not work as expected */
387  bool i2cRtcError; /*!< problem in I2C communication with RTC */
388  bool framReadCrcError; /*!< false if read CRC matches with CRC of read data, true otherwise */
389  bool rtcClockIntegrityError; /*!< RTC time integrity not guaranteed, because oscillator has stopped */
390  bool rtcBatteryLowError; /*!< RTC battery voltage is low */
391  bool taskEngineTimingViolationError; /*!< timing violation in engine task */
392  bool task1msTimingViolationError; /*!< timing violation in 1ms task */
393  bool task10msTimingViolationError; /*!< timing violation in 10ms task */
394  bool task100msTimingViolationError; /*!< timing violation in 100ms task */
395  bool task100msAlgoTimingViolationError; /*!< timing violation in 100ms algorithm task */
396  bool alertFlagSetError; /*!< true: ALERT situation detected, false: everything okay */
397  bool aerosolAlert; /*!< true: high aerosol concentration detected */
399 
400 /** data block struct of contactor feedback */
401 typedef struct {
402  /* This struct needs to be at the beginning of every database entry. During
403  * the initialization of a database struct, uniqueId must be set to the
404  * respective database entry representation in enum DATA_BLOCK_ID_e. */
405  DATA_BLOCK_HEADER_s header; /*!< Data block header */
406  uint32_t contactorFeedback; /*!< feedback of all contactors, without interlock */
408 
409 /** data block struct of interlock feedback */
410 typedef struct {
411  /* This struct needs to be at the beginning of every database entry. During
412  * the initialization of a database struct, uniqueId must be set to the
413  * respective database entry representation in enum DATA_BLOCK_ID_e. */
414  DATA_BLOCK_HEADER_s header; /*!< Data block header */
415  uint8_t interlockFeedback_IL_STATE; /*!< feedback of interlock, connected to pin */
416  float_t interlockVoltageFeedback_IL_HS_VS_mV; /*!< voltage feedback of interlock, connected to ADC input 2 */
417  float_t interlockVoltageFeedback_IL_LS_VS_mV; /*!< voltage feedback of interlock, connected to ADC input 3 */
418  float_t interlockCurrentFeedback_IL_HS_CS_mA; /*!< current feedback of interlock, connected to ADC input 4 */
419  float_t interlockCurrentFeedback_IL_LS_CS_mA; /*!< current feedback of interlock, connected to ADC input 5 */
421 
422 /** data block struct of sof limits */
423 typedef struct {
424  /* This struct needs to be at the beginning of every database entry. During
425  * the initialization of a database struct, uniqueId must be set to the
426  * respective database entry representation in enum DATA_BLOCK_ID_e. */
427  DATA_BLOCK_HEADER_s header; /*!< Data block header */
428  float_t recommendedContinuousPackChargeCurrent_mA; /*!< recommended continuous operating pack charge current */
429  float_t
430  recommendedContinuousPackDischargeCurrent_mA; /*!< recommended continuous operating pack discharge current */
431  float_t recommendedPeakPackChargeCurrent_mA; /*!< recommended peak operating pack charge current */
432  float_t recommendedPeakPackDischargeCurrent_mA; /*!< recommended peak operating pack discharge current */
433  float_t recommendedContinuousChargeCurrent_mA
434  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating charge current */
435  float_t recommendedContinuousDischargeCurrent_mA
436  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating discharge current */
437  float_t recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating charge current */
438  float_t recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating discharge current */
440 
441 /** data block struct of system state */
442 typedef struct {
443  /* This struct needs to be at the beginning of every database entry. During
444  * the initialization of a database struct, uniqueId must be set to the
445  * respective database entry representation in enum DATA_BLOCK_ID_e. */
446  DATA_BLOCK_HEADER_s header; /*!< Data block header */
447  int32_t bmsCanState; /*!< system state for CAN messages (e.g., standby, normal) */
449 
450 /** data block struct of the maximum safe limits */
451 typedef struct {
452  /* This struct needs to be at the beginning of every database entry. During
453  * the initialization of a database struct, uniqueId must be set to the
454  * respective database entry representation in enum DATA_BLOCK_ID_e. */
455  DATA_BLOCK_HEADER_s header; /*!< Data block header */
456  uint8_t packChargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
457  uint8_t packDischargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
458  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
459  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
460  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
461  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
462  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
463  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
464  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
465  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
466  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
467  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
468  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
469  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
471 
472 /** data block struct of the recommended safety limit */
473 typedef struct {
474  /* This struct needs to be at the beginning of every database entry. During
475  * the initialization of a database struct, uniqueId must be set to the
476  * respective database entry representation in enum DATA_BLOCK_ID_e. */
477  DATA_BLOCK_HEADER_s header; /*!< Data block header */
478  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
479  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
480  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
481  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
482  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
483  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
484  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
485  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
486  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
487  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
488  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
489  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
491 
492 /** data block struct of the maximum operating limit */
493 typedef struct {
494  /* This struct needs to be at the beginning of every database entry. During
495  * the initialization of a database struct, uniqueId must be set to the
496  * respective database entry representation in enum DATA_BLOCK_ID_e. */
497  DATA_BLOCK_HEADER_s header; /*!< Data block header */
498  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
499  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
500  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
501  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
502  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
503  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
504  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
505  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
506  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
507  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
508  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
509  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
511 
512 /** data block struct of SOC */
513 typedef struct {
514  /* This struct needs to be at the beginning of every database entry. During
515  * the initialization of a database struct, uniqueId must be set to the
516  * respective database entry representation in enum DATA_BLOCK_ID_e. */
517  DATA_BLOCK_HEADER_s header; /*!< Data block header */
518  float_t averageSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoc <= 100.0 */
519  float_t minimumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minSoc <= 100.0 */
520  float_t maximumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maxSoc <= 100.0 */
522 
523 /** data block struct of SOH */
524 typedef struct {
525  /* This struct needs to be at the beginning of every database entry. During
526  * the initialization of a database struct, uniqueId must be set to the
527  * respective database entry representation in enum DATA_BLOCK_ID_e. */
528  DATA_BLOCK_HEADER_s header; /*!< Data block header */
529  float_t averageSoh_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoh <= 100.0 */
530  float_t minimumSoh_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minimumSoh <= 100.0 */
531  float_t maximumSoh_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maximumSoh <= 100.0 */
533 
534 /** data block struct of SOE */
535 typedef struct {
536  /* This struct needs to be at the beginning of every database entry. During
537  * the initialization of a database struct, uniqueId must be set to the
538  * respective database entry representation in enum DATA_BLOCK_ID_e. */
539  DATA_BLOCK_HEADER_s header; /*!< Data block header */
540  float_t averageSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoe <= 100.0 */
541  float_t minimumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minimumSoe <= 100.0 */
542  float_t maximumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maximumSoe <= 100.0 */
543  uint32_t maximumSoe_Wh[BS_NR_OF_STRINGS]; /*!< maximum string energy in Wh */
544  uint32_t averageSoe_Wh[BS_NR_OF_STRINGS]; /*!< average string energy in Wh */
545  uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]; /*!< minimum string energy in Wh */
547 
548 /** data block struct of can state request */
549 typedef struct {
550  /* This struct needs to be at the beginning of every database entry. During
551  * the initialization of a database struct, uniqueId must be set to the
552  * respective database entry representation in enum DATA_BLOCK_ID_e. */
553  DATA_BLOCK_HEADER_s header; /*!< Data block header */
554  uint8_t stateRequestViaCan; /*!< state request */
555  uint8_t previousStateRequestViaCan; /*!< previous state request */
556  uint8_t stateRequestViaCanPending; /*!< pending state request */
557  uint8_t stateCounter; /*!< counts state updates */
559 
560 /** data block struct of the moving average algorithm */
561 typedef struct {
562  /* This struct needs to be at the beginning of every database entry. During
563  * the initialization of a database struct, uniqueId must be set to the
564  * respective database entry representation in enum DATA_BLOCK_ID_e. */
565  DATA_BLOCK_HEADER_s header; /*!< Data block header */
566  float_t movingAverageCurrent1sInterval_mA; /*!< current moving average over the last 1s */
567  float_t movingAverageCurrent5sInterval_mA; /*!< current moving average over the last 5s */
568  float_t movingAverageCurrent10sInterval_mA; /*!< current moving average over the last 10s */
569  float_t movingAverageCurrent30sInterval_mA; /*!< current moving average over the last 30s */
570  float_t movingAverageCurrent60sInterval_mA; /*!< current moving average over the last 60s */
571  float_t movingAverageCurrentConfigurableInterval_mA; /*!< current moving average over the last configured time */
572  float_t movingAveragePower1sInterval_mA; /*!< power moving average over the last 1s */
573  float_t movingAveragePower5sInterval_mA; /*!< power moving average over the last 5s */
574  float_t movingAveragePower10sInterval_mA; /*!< power moving average over the last 10s */
575  float_t movingAveragePower30sInterval_mA; /*!< power moving average over the last 30s */
576  float_t movingAveragePower60sInterval_mA; /*!< power moving average over the last 60s */
577  float_t movingAveragePowerConfigurableInterval_mA; /*!< power moving average over the last configured time */
579 
580 /** data block struct of insulation monitoring device measurement */
581 typedef struct {
582  /* This struct needs to be at the beginning of every database entry. During
583  * the initialization of a database struct, uniqueId must be set to the
584  * respective database entry representation in enum DATA_BLOCK_ID_e. */
585  DATA_BLOCK_HEADER_s header; /*!< Data block header */
586  bool isImdRunning; /*!< true -> Insulation resistance measurement active, false -> not active */
587  bool isInsulationMeasurementValid; /*!< true -> resistance value valid, false -> resistance unreliable */
588  uint32_t insulationResistance_kOhm; /*!< insulation resistance measured in kOhm */
589  bool
590  areDeviceFlagsValid; /*!< true -> flags below this database entry valid, false -> flags unreliable e.g. if device error detected */
591  bool
592  dfIsCriticalResistanceDetected; /*!< device status flag: false -> resistance value okay, true -> resistance value too low/error */
593  bool dfIsWarnableResistanceDetected; /*!< true: warning threshold violated, false: no warning active */
594  bool dfIsChassisFaultDetected; /*!< true: short between HV potential and chassis detected, false: no error */
595  bool dfIsChassisShortToHvPlus; /*!< true: bias/tendency to the location of the insulation fault to HV plus */
596  bool dfIsChassisShortToHvMinus; /*!< true: bias/tendency to the location of the insulation fault to HV minus */
597  bool dfIsDeviceErrorDetected; /*!< true: device error detected, false: no error detected */
598  bool dfIsMeasurementUpToDate; /*!< true: measurement up to-date, false: outdated */
600 
601 /** data block struct for the I2C humidity/temperature sensor */
602 typedef struct {
603  /* This struct needs to be at the beginning of every database entry. During
604  * the initialization of a database struct, uniqueId must be set to the
605  * respective database entry representation in enum DATA_BLOCK_ID_e. */
606  DATA_BLOCK_HEADER_s header; /*!< Data block header */
608  uint8_t humidity_perc;
610 
611 /** data block struct of internal ADC voltage measurement */
612 typedef struct {
613  /* This struct needs to be at the beginning of every database entry. During
614  * the initialization of a database struct, uniqueId must be set to the
615  * respective database entry representation in enum DATA_BLOCK_ID_e. */
616  DATA_BLOCK_HEADER_s header; /*!< Data block header */
617  float_t adc1ConvertedVoltages_mV[MCU_ADC1_MAX_NR_CHANNELS]; /*!< voltages measured by the internal ADC ADC1 */
619 
620 /** data block struct for the database built-in self-test */
621 typedef struct {
622  /* This struct needs to be at the beginning of every database entry. During
623  * the initialization of a database struct, uniqueId must be set to the
624  * respective database entry representation in enum DATA_BLOCK_ID_e. */
625  DATA_BLOCK_HEADER_s header; /*!< Data block header */
626  uint8_t member1; /*!< first member of self-test struct */
627  uint8_t member2; /*!< second member of self-test struct */
629 
630 /** data block struct for the BAS6C-X00 aerosol sensor */
631 typedef struct {
632  /* This struct needs to be at the beginning of every database entry. During
633  * the initialization of a database struct, uniqueId must be set to the
634  * respective database entry representation in enum DATA_BLOCK_ID_e. */
635  DATA_BLOCK_HEADER_s header; /*!< Data block header */
636  uint8_t sensorStatus; /*!< 0: normal, 1: alarm, 2: reserved */
637  bool photoelectricError; /*!< true when sensor has photoelectric device fault */
638  bool supplyOvervoltageError; /*!< true when voltage supply supplies over voltage */
639  bool supplyUndervoltageError; /*!< true when voltage supply supplies under voltage */
640  uint16_t particulateMatterConcentration; /*!< particulate matter concentration in microgram/m^3 */
641  uint8_t crcCheckCode; /*!< */
643 
644 /** array for the database */
646 
647 /*========== Extern Constant and Variable Declarations ======================*/
648 
649 /*========== Extern Function Prototypes =====================================*/
650 
651 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
652 #ifdef UNITY_UNIT_TEST
653 #endif
654 
655 #endif /* FOXBMS__DATABASE_CFG_H_ */
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR
number of high voltage inputs measured by current sensors (like IVT-MOD)
#define BS_NR_OF_CELL_BLOCKS_PER_MODULE
number of cells per module
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
#define BS_NR_OF_TEMP_SENSORS_PER_MODULE
number of temperature sensors per battery module
#define BS_NR_OF_GPIOS_PER_MODULE
Defines the number of GPIOs.
#define BS_NR_OF_CELL_BLOCKS_PER_STRING
#define BS_NR_OF_MODULES_PER_STRING
number of modules in a string
#define BS_NR_OF_GPAS_PER_MODULE
Defines the number of GPA inputs.
DATA_BLOCK_ID_e
Definition: database_cfg.h:78
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_OPEN_WIRE_REDUNDANCY0
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
Definition: database_cfg.h:98
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:99
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_REDUNDANCY0
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_USER_MUX
Definition: database_cfg.h:114
@ DATA_BLOCK_ID_SOE
Definition: database_cfg.h:109
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:94
@ DATA_BLOCK_ID_ERROR_STATE
Definition: database_cfg.h:95
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:106
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:97
@ DATA_BLOCK_ID_SYSTEM_STATE
Definition: database_cfg.h:113
@ DATA_BLOCK_ID_STATE_REQUEST
Definition: database_cfg.h:112
@ DATA_BLOCK_ID_CELL_VOLTAGE
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_MOVING_AVERAGE
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
Definition: database_cfg.h:88
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:93
@ DATA_BLOCK_ID_MAX
Definition: database_cfg.h:115
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_SLAVE_CONTROL
Definition: database_cfg.h:107
@ DATA_BLOCK_ID_CONTACTOR_FEEDBACK
Definition: database_cfg.h:92
@ DATA_BLOCK_ID_SOF
Definition: database_cfg.h:110
@ DATA_BLOCK_ID_ADC_VOLTAGE
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_MSL_FLAG
Definition: database_cfg.h:102
@ DATA_BLOCK_ID_HTSEN
Definition: database_cfg.h:96
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:105
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
Definition: database_cfg.h:84
@ DATA_BLOCK_ID_SOH
Definition: database_cfg.h:111
@ DATA_BLOCK_ID_MOL_FLAG
Definition: database_cfg.h:100
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_REDUNDANCY0
Definition: database_cfg.h:85
@ DATA_BLOCK_ID_CELL_TEMPERATURE
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_SOC
Definition: database_cfg.h:108
@ DATA_BLOCK_ID_AEROSOL_SENSOR
Definition: database_cfg.h:80
DATA_BASE_s data_database[DATA_BLOCK_ID_MAX]
channel configuration of database (data blocks)
Definition: database_cfg.c:188
FAS_STATIC_ASSERT((int16_t) DATA_BLOCK_ID_MAX< UINT8_MAX, "Maximum number of database entries exceeds UINT8_MAX; adapted length " "checking in DATA_Initialize and DATA_IterateOverDatabaseEntries")
Headers for the driver for the MCU module.
#define MCU_ADC1_MAX_NR_CHANNELS
maximum number of channels measured by the ADC1
Definition: mcu.h:75
uint32_t dataLength
Definition: database_cfg.h:74
void * pDatabaseEntry
Definition: database_cfg.h:73
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:616
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:635
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:323
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:255
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:290
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:153
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:135
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:405
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:219
bool baseCellTemperatureMeasurementTimeoutError
Definition: database_cfg.h:346
bool redundancy0CellTemperatureMeasurementTimeoutError
Definition: database_cfg.h:347
bool redundancy0CellVoltageMeasurementTimeoutError
Definition: database_cfg.h:345
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:337
bool baseCellVoltageMeasurementTimeoutError
Definition: database_cfg.h:344
uint32_t previousTimestamp
Definition: database_cfg.h:127
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:125
int16_t temperature_ddegC
Definition: database_cfg.h:607
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:606
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:414
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:167
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:497
float_t movingAverageCurrentConfigurableInterval_mA
Definition: database_cfg.h:571
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:565
float_t movingAverageCurrent30sInterval_mA
Definition: database_cfg.h:569
float_t movingAverageCurrent10sInterval_mA
Definition: database_cfg.h:568
float_t movingAveragePowerConfigurableInterval_mA
Definition: database_cfg.h:577
float_t movingAverageCurrent60sInterval_mA
Definition: database_cfg.h:570
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:455
uint8_t packDischargeOvercurrent
Definition: database_cfg.h:457
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:310
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:195
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:477
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:271
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:517
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:539
float_t recommendedPeakPackChargeCurrent_mA
Definition: database_cfg.h:431
float_t recommendedContinuousPackChargeCurrent_mA
Definition: database_cfg.h:428
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:427
float_t recommendedContinuousPackDischargeCurrent_mA
Definition: database_cfg.h:430
float_t recommendedPeakPackDischargeCurrent_mA
Definition: database_cfg.h:432
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:528
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:553
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:446
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:300