foxBMS  1.2.0
The foxBMS Battery Management System API Documentation
database_cfg.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2021, 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 2021-09-30 (date of last update)
47  * @ingroup ENGINE_CONFIGURATION
48  * @prefix DATA
49  *
50  * @brief Database configuration header
51  *
52  * Provides interfaces to database configuration
53  *
54  */
55 
56 #ifndef FOXBMS__DATABASE_CFG_H_
57 #define FOXBMS__DATABASE_CFG_H_
58 
59 /*========== Includes =======================================================*/
60 #include "general.h"
61 
62 #include "battery_system_cfg.h"
63 
64 /*========== Macros and Definitions =========================================*/
65 /** configuration struct of database channel (data block) */
66 typedef struct DATA_BASE {
67  void *pDatabaseEntry; /*!< pointer to the database entry */
68  uint32_t datalength; /*!< length of the entry */
70 
71 /** data block identification numbers */
72 typedef enum DATA_BLOCK_ID {
106  DATA_BLOCK_ID_MAX, /**< DO NOT CHANGE, MUST BE THE LAST ENTRY */
108 
109 /** data block header */
110 typedef struct DATA_BLOCKHEADER {
111  DATA_BLOCK_ID_e uniqueId; /*!< uniqueId of database entry */
112  uint32_t timestamp; /*!< timestamp of last database update */
113  uint32_t previousTimestamp; /*!< timestamp of previous database update */
115 
116 /** data block struct of cell voltage */
117 typedef struct DATA_BLOCK_CELL_VOLTAGE {
118  /* This struct needs to be at the beginning of every database entry. During
119  * the initialization of a database struct, uniqueId must be set to the
120  * respective database entry representation in enum DATA_BLOCK_ID_e. */
121  DATA_BLOCK_HEADER_s header; /*!< Data block header */
122  uint8_t state; /*!< for future use */
123  int32_t packVoltage_mV[BS_NR_OF_STRINGS]; /*!< uint: mV */
126  [BS_NR_OF_MODULES]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
127  uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid voltages */
129  bool validModuleVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]; /*!< 0 -> if PEC okay; 1 -> PEC error */
131 
132 /** data block struct of cell temperatures */
134  /* This struct needs to be at the beginning of every database entry. During
135  * the initialization of a database struct, uniqueId must be set to the
136  * respective database entry representation in enum DATA_BLOCK_ID_e. */
137  DATA_BLOCK_HEADER_s header; /*!< Data block header */
138  uint8_t state; /*!< for future use */
141  [BS_NR_OF_MODULES]; /*!< bitmask if temperatures are valid. 0->valid, 1->invalid */
142  uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid temperatures in each string */
144 
145 /** data block struct of minimum and maximum values */
146 typedef struct DATA_BLOCK_MIN_MAX {
147  /* This struct needs to be at the beginning of every database entry. During
148  * the initialization of a database struct, uniqueId must be set to the
149  * respective database entry representation in enum DATA_BLOCK_ID_e. */
150  DATA_BLOCK_HEADER_s header; /*!< Data block header */
151 
152  int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< average cell voltages, unit: mV */
153  int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< minimum cell voltages, unit: mV */
154  int16_t previousMinimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous minimum cell voltages, unit: mV */
155  int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< maximum cell voltages, unit: mV */
156  int16_t previousMaximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous maximum cell voltages, unit: mV */
157  uint16_t nrModuleMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with minimum cell voltage */
158  uint16_t nrCellMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with minimum cell voltage */
159  uint16_t nrModuleMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with maximum cell voltage */
160  uint16_t nrCellMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with maximum cell voltage */
161  uint16_t validMeasuredCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid measured cell voltages */
162  float averageTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
163  int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
164  uint16_t nrModuleMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with minimum temperature */
165  uint16_t nrSensorMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with minimum temperature */
166  int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
167  uint16_t nrModuleMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with maximum temperature */
168  uint16_t nrSensorMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with maximum temperature */
169  uint16_t validMeasuredCellTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid measured cell temperatures */
170  uint8_t state; /*!< state of the min max module */
172 
173 /** data block struct of pack measurement values */
174 typedef struct DATA_BLOCK_PACK_VALUES {
175  /* This struct needs to be at the beginning of every database entry. During
176  * the initialization of a database struct, uniqueId must be set to the
177  * respective database entry representation in enum DATA_BLOCK_ID_e. */
178  DATA_BLOCK_HEADER_s header; /*!< Data block header */
179 
180  int32_t packCurrent_mA; /*!< current in the whole battery pack, unit: mA */
181  uint8_t invalidPackCurrent; /*!< bitmask if current is valid. 0->valid, 1->invalid */
182  int32_t batteryVoltage_mV; /*!< voltage between negative and positive battery pole, unit: mV */
183  uint8_t invalidBatteryVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
184  int32_t
185  highVoltageBusVoltage_mV; /*!< voltage between negative battery pole and after positive main contactor, unit: mV */
186  uint8_t invalidHvBusVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
187  int32_t packPower_W; /*!< power provided by respectively supplied to the battery pack, unit: W */
188  uint8_t invalidPackPower; /*!< bitmask if power is valid. 0->valid, 1->invalid */
189  int32_t stringVoltage_mV[BS_NR_OF_STRINGS]; /*!< voltage of each string, unit: mV */
190  uint8_t invalidStringVoltage[BS_NR_OF_STRINGS]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
191  int32_t stringCurrent_mA[BS_NR_OF_STRINGS]; /*!< current in each string, unit: mA */
192  uint8_t invalidStringCurrent[BS_NR_OF_STRINGS]; /*!< bitmask if currents are valid. 0->valid, 1->invalid */
193  int32_t stringPower_W[BS_NR_OF_STRINGS]; /*!< power of each string, unit: W */
194  uint8_t invalidStringPower[BS_NR_OF_STRINGS]; /*!< bitmask if power values are valid. 0->valid, 1->invalid */
196 
197 /** data block struct of current measurement */
199  /* This struct needs to be at the beginning of every database entry. During
200  * the initialization of a database struct, uniqueId must be set to the
201  * respective database entry representation in enum DATA_BLOCK_ID_e. */
202  DATA_BLOCK_HEADER_s header; /*!< Data block header */
203  int32_t current_mA[BS_NR_OF_STRINGS]; /*!< unit: mA */
204  uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
205  uint8_t newCurrent; /*!< 0: measurement valid, 1: measurement invalid */
206  uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
207  uint32_t timestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
208  int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: 0.1&deg;C */
209  uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
210  int32_t power_W[BS_NR_OF_STRINGS]; /*!< unit: W */
211  uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
212  uint8_t newPower; /*!< counter that indicates a new power measurement */
213  uint32_t previousTimestampPower[BS_NR_OF_STRINGS]; /*!< previous timestamp of power measurement */
214  uint32_t timestampPower[BS_NR_OF_STRINGS]; /*!< timestamp of power measurement */
215  int32_t currentCounter_As[BS_NR_OF_STRINGS]; /*!< unit: A.s */
216  uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
217  uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of CC measurement */
218  uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< timestamp of CC measurement */
219  int32_t energyCounter_Wh[BS_NR_OF_STRINGS]; /*!< unit: Wh */
220  uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
221  uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of EC measurement */
222  uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< timestamp of EC measurement */
224  [BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< 0: measurement valid, 1: measurement invalid */
228  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< previous timestamp of high voltage measurement */
230  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< timestamp of high voltage measurement */
232 
233 /** data structure declaration of DATA_BLOCK_BALANCING_CONTROL */
235  /* This struct needs to be at the beginning of every database entry. During
236  * the initialization of a database struct, uniqueId must be set to the
237  * respective database entry representation in enum DATA_BLOCK_ID_e. */
238  DATA_BLOCK_HEADER_s header; /*!< Data block header */
239  uint8_t enableBalancing; /*!< Switch for enabling/disabling balancing */
240  uint8_t threshold_mV; /*!< balancing threshold in mV */
241  uint8_t request; /*!< balancing request per CAN */
242  uint8_t balancingState[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]; /*!< 0: no balancing, 1: balancing active */
243  uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]; /*!< Difference in Depth-of-Discharge in mAs */
246 
247 /** data structure declaration of DATA_BLOCK_USER_IO_CONTROL */
248 typedef struct DATA_BLOCK_SLAVE_CONTROL {
249  /* This struct needs to be at the beginning of every database entry. During
250  * the initialization of a database struct, uniqueId must be set to the
251  * respective database entry representation in enum DATA_BLOCK_ID_e. */
252  DATA_BLOCK_HEADER_s header; /*!< Data block header */
253  uint8_t state; /*!< for future use */
254  uint32_t eepromReadAddressToUse; /*!< address to read from for slave EEPROM */
255  uint32_t eepromReadAddressLastUsed; /*!< last address used to read fromfor slave EEPROM */
256  uint32_t eepromWriteAddressToUse; /*!< address to write to for slave EEPROM */
257  uint32_t eepromWriteAddressLastUsed; /*!< last address used to write to for slave EEPROM */
258  uint8_t ioValueOut[BS_NR_OF_MODULES]; /*!< data to be written to the port expander */
259  uint8_t ioValueIn[BS_NR_OF_MODULES]; /*!< data read from to the port expander */
260  uint8_t eepromValueWrite[BS_NR_OF_MODULES]; /*!< data to be written to the slave EEPROM */
261  uint8_t eepromValueRead[BS_NR_OF_MODULES]; /*!< data read from to the slave EEPROM */
262  uint8_t externalTemperatureSensor[BS_NR_OF_MODULES]; /*!< temperature from the external sensor on slave */
264 
265 /** data block struct of cell balancing feedback */
267  /* This struct needs to be at the beginning of every database entry. During
268  * the initialization of a database struct, uniqueId must be set to the
269  * respective database entry representation in enum DATA_BLOCK_ID_e. */
270  DATA_BLOCK_HEADER_s header; /*!< Data block header */
271  uint8_t state; /*!< for future use */
272  uint16_t value[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]; /*!< unit: mV (optocoupler output) */
274 
275 /** data block struct of user multiplexer values */
276 typedef struct DATA_BLOCK_USER_MUX {
277  /* This struct needs to be at the beginning of every database entry. During
278  * the initialization of a database struct, uniqueId must be set to the
279  * respective database entry representation in enum DATA_BLOCK_ID_e. */
280  DATA_BLOCK_HEADER_s header; /*!< Data block header */
281  uint8_t state; /*!< for future use */
282  uint16_t value[BS_NR_OF_STRINGS][8u * 2u * BS_NR_OF_MODULES]; /*!< unit: mV (mux voltage input) */
284 
285 /** data block struct of cell open wire */
286 typedef struct DATA_BLOCK_OPENWIRE {
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 nrOpenWires[BS_NR_OF_STRINGS]; /*!< number of open wires */
294  [BS_NR_OF_MODULES * (BS_NR_OF_CELLS_PER_MODULE + 1u)]; /*!< 1 -> open wire, 0 -> everything ok */
296 
297 /** data block struct of GPIO voltage */
299  /* This struct needs to be at the beginning of every database entry. During
300  * the initialization of a database struct, uniqueId must be set to the
301  * respective database entry representation in enum DATA_BLOCK_ID_e. */
302  DATA_BLOCK_HEADER_s header; /*!< Data block header */
303  uint8_t state; /*!< for future use */
306  [BS_NR_OF_MODULES]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
308 
309 /** data block struct of error flags */
310 typedef struct DATA_BLOCK_ERRORSTATE {
311  /* This struct needs to be at the beginning of every database entry. During
312  * the initialization of a database struct, uniqueId must be set to the
313  * respective database entry representation in enum DATA_BLOCK_ID_e. */
314  DATA_BLOCK_HEADER_s header; /*!< Data block header */
315  uint8_t currentSensor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
316  uint8_t stringContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
317  uint8_t prechargeContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
318  uint8_t interlock; /*!< 0 -> no error, 1 -> error */
319  uint8_t crcError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
320  uint8_t muxError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
321  uint8_t spiError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
322  uint8_t afeConfigurationError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
323  uint8_t afeCellvoltageError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
324  uint8_t afeCellTemperatureError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
325  uint8_t baseCellVoltageMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
326  uint8_t redundancy0CellVoltageMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
327  uint8_t baseCellTemperatureMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
328  uint8_t redundancy0CellTemperatureMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
329  uint8_t currentMeasurementTimeout[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
330  uint8_t currentMeasurementError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
331  uint8_t currentSensorTimeoutV1[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
332  uint8_t currentSensorTimeoutV3[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
333  uint8_t currentSensorPowerTimeout[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
334  uint8_t powerMeasurementError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
335  uint8_t insulationError; /*!< 0 -> no error, 1 -> error */
336  uint8_t fuseStateNormal[BS_NR_OF_STRINGS]; /*!< 0 -> fuse ok, 1 -> fuse tripped */
337  uint8_t fuseStateCharge[BS_NR_OF_STRINGS]; /*!< 0 -> fuse ok, 1 -> fuse tripped */
338  uint8_t open_wire[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
339  uint8_t canTiming; /*!< 0 -> no error, 1 -> error */
340  uint8_t canRxQueueFull; /*!< 0 -> no error, 1 -> error */
341  uint8_t canTimingCc[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
342  uint8_t canTimingEc[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
343  uint8_t mcuDieTemperature; /*!< 0 -> no error, 1 -> error */
344  uint8_t coinCellVoltage; /*!< 0 -> no error, 1 -> error */
345  uint8_t plausibilityCheckPackvoltage[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
346  uint8_t plausibilityCheckCellvoltage[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
347  uint8_t plausibilityCheckCellvoltageSpread[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
348  uint8_t plausibilityCheckCelltemperatureSpread[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
349  uint8_t plausibilityCheckCelltemperature[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
350  uint8_t deepDischargeDetected[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
351  uint8_t currentOnOpenString[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
352  uint8_t sbcFinState; /*!< 0 -> okay, 1 -> error: short-circuit to RSTB */
353  uint8_t sbcRstbState; /*!< 0 -> okay, 1 -> error: RSTB not working */
354  uint8_t i2cPexError; /*!< the I2C port expander does not work as expected */
356 
357 /** data block struct of contactor feedback */
358 typedef struct DATA_BLOCK_CONTFEEDBACK {
359  /* This struct needs to be at the beginning of every database entry. During
360  * the initialization of a database struct, uniqueId must be set to the
361  * respective database entry representation in enum DATA_BLOCK_ID_e. */
362  DATA_BLOCK_HEADER_s header; /*!< Data block header */
363  uint32_t contactorFeedback; /*!< feedback of all contactors, without interlock */
365 
366 /** data block struct of interlock feedback */
368  /* This struct needs to be at the beginning of every database entry. During
369  * the initialization of a database struct, uniqueId must be set to the
370  * respective database entry representation in enum DATA_BLOCK_ID_e. */
371  DATA_BLOCK_HEADER_s header; /*!< Data block header */
372  uint8_t interlockFeedback_IL_STATE; /*!< feedback of interlock, connected to pin */
373  float interlockVoltageFeedback_IL_HS_VS_mV; /*!< voltage feedback of interlock, connected to ADC input 2 */
374  float interlockVoltageFeedback_IL_LS_VS_mV; /*!< voltage feedback of interlock, connected to ADC input 3 */
375  float interlockCurrentFeedback_IL_HS_CS_mA; /*!< current feedback of interlock, connected to ADC input 4 */
376  float interlockCurrentFeedback_IL_LS_CS_mA; /*!< current feedback of interlock, connected to ADC input 5 */
378 
379 /** data block struct of sof limits */
380 typedef struct DATA_BLOCK_SOF {
381  /* This struct needs to be at the beginning of every database entry. During
382  * the initialization of a database struct, uniqueId must be set to the
383  * respective database entry representation in enum DATA_BLOCK_ID_e. */
384  DATA_BLOCK_HEADER_s header; /*!< Data block header */
385  float recommendedContinuousPackChargeCurrent_mA; /*!< recommended continuous operating pack charge current */
386  float recommendedContinuousPackDischargeCurrent_mA; /*!< recommended continuous operating pack discharge current */
387  float recommendedPeakPackChargeCurrent_mA; /*!< recommended peak operating pack charge current */
388  float recommendedPeakPackDischargeCurrent_mA; /*!< recommended peak operating pack discharge current */
390  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating charge current */
392  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating discharge current */
393  float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating charge current */
394  float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating discharge current */
395  float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */
396  float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */
397  float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */
398  float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */
399  float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */
400  float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */
401  float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */
402  float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */
403  float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */
404  float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */
405  float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */
406  float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */
408 
409 /** data block struct of system state */
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  int32_t bmsCanState; /*!< system state for CAN messages (e.g., standby, normal) */
417 
418 /** data block struct of the maximum safe limits */
419 typedef struct DATA_BLOCK_MSL_FLAG {
420  /* This struct needs to be at the beginning of every database entry. During
421  * the initialization of a database struct, uniqueId must be set to the
422  * respective database entry representation in enum DATA_BLOCK_ID_e. */
423  DATA_BLOCK_HEADER_s header; /*!< Data block header */
424  uint8_t packChargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
425  uint8_t packDischargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
426  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
427  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
428  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
429  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
430  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
431  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
432  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
433  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
434  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
435  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
436  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
437  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
439 
440 /** data block struct of the recommended safety limit */
441 typedef struct DATA_BLOCK_RSL_FLAG {
442  /* This struct needs to be at the beginning of every database entry. During
443  * the initialization of a database struct, uniqueId must be set to the
444  * respective database entry representation in enum DATA_BLOCK_ID_e. */
445  DATA_BLOCK_HEADER_s header; /*!< Data block header */
446  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
447  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
448  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
449  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
450  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
451  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
452  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
453  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
454  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
455  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
456  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
457  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
459 
460 /** data block struct of the maximum operating limit */
461 typedef struct DATA_BLOCK_MOL_FLAG {
462  /* This struct needs to be at the beginning of every database entry. During
463  * the initialization of a database struct, uniqueId must be set to the
464  * respective database entry representation in enum DATA_BLOCK_ID_e. */
465  DATA_BLOCK_HEADER_s header; /*!< Data block header */
466  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
467  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
468  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
469  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
470  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
471  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
472  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
473  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
474  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
475  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
476  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
477  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
479 
480 /** data block struct of sox */
481 typedef struct DATA_BLOCK_SOX {
482  /* This struct needs to be at the beginning of every database entry. During
483  * the initialization of a database struct, uniqueId must be set to the
484  * respective database entry representation in enum DATA_BLOCK_ID_e. */
485  DATA_BLOCK_HEADER_s header; /*!< Data block header */
486  float averageSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoc <= 100.0 */
487  float minimumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minSoc <= 100.0 */
488  float maximumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maxSoc <= 100.0 */
489  float averageSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoe <= 100.0 */
490  float minimumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minimumSoe <= 100.0 */
491  float maximumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maximumSoe <= 100.0 */
492  uint32_t maximumSoe_Wh[BS_NR_OF_STRINGS]; /*!< maximum string energy in Wh */
493  uint32_t averageSoe_Wh[BS_NR_OF_STRINGS]; /*!< average string energy in Wh */
494  uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]; /*!< minimum string energy in Wh */
496 
497 /** data block struct of can state request */
498 typedef struct DATA_BLOCK_STATEREQUEST {
499  /* This struct needs to be at the beginning of every database entry. During
500  * the initialization of a database struct, uniqueId must be set to the
501  * respective database entry representation in enum DATA_BLOCK_ID_e. */
502  DATA_BLOCK_HEADER_s header; /*!< Data block header */
503  uint8_t stateRequestViaCan; /*!< state request */
504  uint8_t previousStateRequestViaCan; /*!< previous state request */
505  uint8_t stateRequestViaCanPending; /*!< pending state request */
506  uint8_t state; /*!< state */
508 
509 /** data block struct of the moving average algorithm */
510 typedef struct {
511  /* This struct needs to be at the beginning of every database entry. During
512  * the initialization of a database struct, uniqueId must be set to the
513  * respective database entry representation in enum DATA_BLOCK_ID_e. */
514  DATA_BLOCK_HEADER_s header; /*!< Data block header */
515  float movingAverageCurrent1sInterval_mA; /*!< current moving average over the last 1s */
516  float movingAverageCurrent5sInterval_mA; /*!< current moving average over the last 5s */
517  float movingAverageCurrent10sInterval_mA; /*!< current moving average over the last 10s */
518  float movingAverageCurrent30sInterval_mA; /*!< current moving average over the last 30s */
519  float movingAverageCurrent60sInterval_mA; /*!< current moving average over the last 60s */
520  float movingAverageCurrentConfigurableInterval_mA; /*!< current moving average over the last configured time */
521  float movingAveragePower1sInterval_mA; /*!< power moving average over the last 1s */
522  float movingAveragePower5sInterval_mA; /*!< power moving average over the last 5s */
523  float movingAveragePower10sInterval_mA; /*!< power moving average over the last 10s */
524  float movingAveragePower30sInterval_mA; /*!< power moving average over the last 30s */
525  float movingAveragePower60sInterval_mA; /*!< power moving average over the last 60s */
526  float movingAveragePowerConfigurableInterval_mA; /*!< power moving average over the last configured time */
528 
529 /** data block struct of insulation monitoring device measurement */
531  /* This struct needs to be at the beginning of every database entry. During
532  * the initialization of a database struct, uniqueId must be set to the
533  * respective database entry representation in enum DATA_BLOCK_ID_e. */
534  DATA_BLOCK_HEADER_s header; /*!< Data block header */
535  uint8_t valid; /*!< 0 -> valid, 1 -> resistance unreliable */
536  uint8_t state; /*!< 0 -> ok , 1 -> resistance too low/error */
537  uint32_t insulationResistance_kOhm; /*!< insulation resistance measured in kOhm */
538  uint8_t insulationFault; /*!< 0 = no error, 1 = error */
539  uint8_t insulationWarning; /*!< 0 = no warning, 1 = warning */
540  uint8_t chassisFault; /*!< 0 = no error, 1 = error */
541  uint8_t systemFailure; /*!< 0 = no error, 1 = error */
542  uint8_t calibrationRunning; /*!< 0 = not running, 1 = running */
543  uint8_t selfTestRunning; /*!< 0 = not running, 1 = running */
544  uint8_t insulationMeasurements; /*!< 0 = Active, 1 = Inactive */
545  uint8_t aliveStatusDetection; /*!< 0 = Ok, 1 = Failure */
546  uint8_t outdatedInsulationResistanceValue; /*!< 0 = Valid, 1 = Outdated */
547  uint8_t testImcOverAll; /*!< 0 = NotRunning, 1 = Running */
548  uint8_t testImcParameterConfiguration; /*!< 0 = NotWarning, 1 = Warning */
550 
551 /** data block struct for the I2C humidity/temperature sensor */
552 typedef struct DATA_BLOCK_HTSEN {
553  /* This struct needs to be at the beginning of every database entry. During
554  * the initialization of a database struct, uniqueId must be set to the
555  * respective database entry representation in enum DATA_BLOCK_ID_e. */
556  DATA_BLOCK_HEADER_s header; /*!< Data block header */
558  uint8_t humidity_perc;
560 
561 /** data block struct of internal ADC voltage measurement */
562 typedef struct DATA_BLOCK_ADC_VOLTAGE {
563  /* This struct needs to be at the beginning of every database entry. During
564  * the initialization of a database struct, uniqueId must be set to the
565  * respective database entry representation in enum DATA_BLOCK_ID_e. */
566  DATA_BLOCK_HEADER_s header; /*!< Data block header */
567  float adc1ConvertedVoltages_mV[ADC_ADC1_MAX_NR_CHANNELS]; /*!< voltages measured by the internal ADC ADC1 */
569 
570 /** data block struct for the database built-in self-test */
572  /* This struct needs to be at the beginning of every database entry. During
573  * the initialization of a database struct, uniqueId must be set to the
574  * respective database entry representation in enum DATA_BLOCK_ID_e. */
575  DATA_BLOCK_HEADER_s header; /*!< Data block header */
576  uint8_t member1; /*!< first member of self-test struct */
577  uint8_t member2; /*!< second member of self-test struct */
579 
580 /** array for the database */
582 
583 /*========== Extern Constant and Variable Declarations ======================*/
584 
585 /*========== Extern Function Prototypes =====================================*/
586 
587 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
588 
589 #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_STRINGS
#define BS_NR_OF_CELLS_PER_MODULE
number of battery cells per battery module (parallel cells are counted as one)
#define BS_NR_OF_MODULES
number of modules in battery pack
#define BS_NR_OF_GPIOS_PER_MODULE
Number of GPIOs on the LTC IC.
#define BS_NR_OF_TEMP_SENSORS_PER_STRING
#define BS_NR_OF_BAT_CELLS
struct DATA_BLOCK_ADC_VOLTAGE DATA_BLOCK_ADC_VOLTAGE_s
struct DATA_BLOCK_INSULATION_MONITORING DATA_BLOCK_INSULATION_MONITORING_s
struct DATA_BLOCK_DUMMY_FOR_SELF_TEST DATA_BLOCK_DUMMY_FOR_SELF_TEST_s
struct DATA_BLOCK_STATEREQUEST DATA_BLOCK_STATEREQUEST_s
struct DATA_BLOCK_SOX DATA_BLOCK_SOX_s
struct DATA_BLOCK_INTERLOCK_FEEDBACK DATA_BLOCK_INTERLOCK_FEEDBACK_s
struct DATA_BLOCK_CONTFEEDBACK DATA_BLOCK_CONTACTOR_FEEDBACK_s
struct DATA_BLOCKHEADER DATA_BLOCK_HEADER_s
struct DATA_BLOCK_CURRENT_SENSOR DATA_BLOCK_CURRENT_SENSOR_s
struct DATA_BLOCK_SLAVE_CONTROL DATA_BLOCK_SLAVE_CONTROL_s
struct DATA_BLOCK_BALANCING_FEEDBACK DATA_BLOCK_BALANCING_FEEDBACK_s
struct DATA_BLOCK_USER_MUX DATA_BLOCK_USER_MUX_s
struct DATA_BLOCK_CELL_TEMPERATURE DATA_BLOCK_CELL_TEMPERATURE_s
struct DATA_BLOCK_CELL_VOLTAGE DATA_BLOCK_CELL_VOLTAGE_s
DATA_BASE_s data_database[DATA_BLOCK_ID_MAX]
channel configuration of database (data blocks)
Definition: database_cfg.c:176
struct DATA_BLOCK_RSL_FLAG DATA_BLOCK_RSL_FLAG_s
struct DATA_BLOCK_OPENWIRE DATA_BLOCK_OPEN_WIRE_s
struct DATA_BLOCK_PACK_VALUES DATA_BLOCK_PACK_VALUES_s
enum DATA_BLOCK_ID DATA_BLOCK_ID_e
struct DATA_BLOCK_ALL_GPIO_VOLTAGES DATA_BLOCK_ALL_GPIO_VOLTAGES_s
struct DATA_BLOCK_MSL_FLAG DATA_BLOCK_MSL_FLAG_s
struct DATA_BLOCK_SOF DATA_BLOCK_SOF_s
struct DATA_BLOCK_BALANCING_CONTROL DATA_BLOCK_BALANCING_CONTROL_s
struct DATA_BLOCK_MOL_FLAG DATA_BLOCK_MOL_FLAG_s
struct DATA_BASE DATA_BASE_s
struct DATA_BLOCK_HTSEN DATA_BLOCK_HTSEN_s
DATA_BLOCK_ID
Definition: database_cfg.h:72
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
Definition: database_cfg.h:96
@ DATA_BLOCK_ID_OPEN_WIRE_REDUNDANCY0
Definition: database_cfg.h:100
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
Definition: database_cfg.h:85
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:77
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:75
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_REDUNDANCY0
Definition: database_cfg.h:99
@ DATA_BLOCK_ID_USER_MUX
Definition: database_cfg.h:80
@ DATA_BLOCK_ID_SOX
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:105
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_CELL_VOLTAGE
Definition: database_cfg.h:73
@ DATA_BLOCK_ID_MOVING_AVERAGE
Definition: database_cfg.h:93
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
Definition: database_cfg.h:97
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:95
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:76
@ DATA_BLOCK_ID_MAX
Definition: database_cfg.h:106
@ DATA_BLOCK_ID_SYSTEMSTATE
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_SLAVE_CONTROL
Definition: database_cfg.h:78
@ DATA_BLOCK_ID_CONTACTOR_FEEDBACK
Definition: database_cfg.h:84
@ DATA_BLOCK_ID_SOF
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_ADC_VOLTAGE
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:94
@ DATA_BLOCK_ID_MSL_FLAG
Definition: database_cfg.h:88
@ DATA_BLOCK_ID_ERRORSTATE
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_HTSEN
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:102
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_MOL_FLAG
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_REDUNDANCY0
Definition: database_cfg.h:98
@ DATA_BLOCK_ID_CELL_TEMPERATURE
Definition: database_cfg.h:74
@ DATA_BLOCK_ID_STATEREQUEST
Definition: database_cfg.h:92
struct DATA_BLOCK_ERRORSTATE DATA_BLOCK_ERRORSTATE_s
struct DATA_BLOCK_MIN_MAX DATA_BLOCK_MIN_MAX_s
General macros and definitions for the whole platform.
#define ADC_ADC1_MAX_NR_CHANNELS
maximum number of channels measured by the ADC1
Definition: general.h:79
void * pDatabaseEntry
Definition: database_cfg.h:67
uint32_t datalength
Definition: database_cfg.h:68
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:111
uint32_t timestamp
Definition: database_cfg.h:112
uint32_t previousTimestamp
Definition: database_cfg.h:113
float adc1ConvertedVoltages_mV[ADC_ADC1_MAX_NR_CHANNELS]
Definition: database_cfg.h:567
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:566
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:302
uint16_t gpioVoltages_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *BS_NR_OF_GPIOS_PER_MODULE]
Definition: database_cfg.h:304
uint16_t invalidGpioVoltages[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:306
uint8_t balancingState[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:242
uint16_t nrBalancedCells[BS_NR_OF_STRINGS]
Definition: database_cfg.h:244
uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:243
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:238
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:270
uint16_t value[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:272
int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_TEMP_SENSORS_PER_STRING]
Definition: database_cfg.h:139
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:137
uint16_t invalidCellTemperature[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:141
uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]
Definition: database_cfg.h:142
uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]
Definition: database_cfg.h:127
uint32_t moduleVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:128
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:124
uint64_t invalidCellVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:126
bool validModuleVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:129
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:121
int32_t packVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:123
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:362
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:202
uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:204
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:207
uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:217
uint32_t timestampPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:214
int32_t power_W[BS_NR_OF_STRINGS]
Definition: database_cfg.h:210
uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:209
uint8_t invalidHighVoltageMeasurement[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:224
uint32_t previousTimestampPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:213
int32_t current_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:203
uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:216
uint32_t timestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:230
uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:211
uint32_t previousTimestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:228
int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:208
uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:222
int32_t currentCounter_As[BS_NR_OF_STRINGS]
Definition: database_cfg.h:215
int32_t highVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:225
uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:220
uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:221
int32_t energyCounter_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:219
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:218
uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:206
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:575
uint8_t baseCellVoltageMeasurementTimeout
Definition: database_cfg.h:325
uint8_t currentSensorTimeoutV3[BS_NR_OF_STRINGS]
Definition: database_cfg.h:332
uint8_t plausibilityCheckCelltemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:349
uint8_t powerMeasurementError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:334
uint8_t afeConfigurationError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:322
uint8_t currentMeasurementTimeout[BS_NR_OF_STRINGS]
Definition: database_cfg.h:329
uint8_t deepDischargeDetected[BS_NR_OF_STRINGS]
Definition: database_cfg.h:350
uint8_t crcError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:319
uint8_t canTimingEc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:342
uint8_t prechargeContactor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:317
uint8_t plausibilityCheckPackvoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:345
uint8_t currentMeasurementError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:330
uint8_t muxError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:320
uint8_t plausibilityCheckCellvoltageSpread[BS_NR_OF_STRINGS]
Definition: database_cfg.h:347
uint8_t currentSensorTimeoutV1[BS_NR_OF_STRINGS]
Definition: database_cfg.h:331
uint8_t currentSensorPowerTimeout[BS_NR_OF_STRINGS]
Definition: database_cfg.h:333
uint8_t spiError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:321
uint8_t open_wire[BS_NR_OF_STRINGS]
Definition: database_cfg.h:338
uint8_t redundancy0CellTemperatureMeasurementTimeout
Definition: database_cfg.h:328
uint8_t fuseStateNormal[BS_NR_OF_STRINGS]
Definition: database_cfg.h:336
uint8_t afeCellTemperatureError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:324
uint8_t fuseStateCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:337
uint8_t afeCellvoltageError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:323
uint8_t redundancy0CellVoltageMeasurementTimeout
Definition: database_cfg.h:326
uint8_t plausibilityCheckCelltemperatureSpread[BS_NR_OF_STRINGS]
Definition: database_cfg.h:348
uint8_t plausibilityCheckCellvoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:346
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:314
uint8_t currentSensor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:315
uint8_t currentOnOpenString[BS_NR_OF_STRINGS]
Definition: database_cfg.h:351
uint8_t baseCellTemperatureMeasurementTimeout
Definition: database_cfg.h:327
uint8_t canTimingCc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:341
uint8_t stringContactor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:316
int16_t temperature_ddegC
Definition: database_cfg.h:557
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:556
uint8_t humidity_perc
Definition: database_cfg.h:558
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:371
uint16_t nrCellMinimumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:158
uint16_t validMeasuredCellTemperatures[BS_NR_OF_STRINGS]
Definition: database_cfg.h:169
uint16_t nrSensorMinimumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:165
int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:166
int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:163
float averageTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:162
uint16_t nrModuleMaximumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:159
uint16_t nrCellMaximumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:160
uint16_t nrSensorMaximumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:168
uint16_t validMeasuredCellVoltages[BS_NR_OF_STRINGS]
Definition: database_cfg.h:161
int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:155
int16_t previousMinimumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:154
uint16_t nrModuleMinimumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:157
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:150
uint16_t nrModuleMaximumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:167
int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:152
uint16_t nrModuleMinimumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:164
int16_t previousMaximumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:156
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:153
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:476
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:475
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:469
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:474
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:467
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:465
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:471
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:468
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:473
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:470
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:477
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:472
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:466
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:514
float movingAverageCurrentConfigurableInterval_mA
Definition: database_cfg.h:520
float movingAveragePowerConfigurableInterval_mA
Definition: database_cfg.h:526
uint8_t packDischargeOvercurrent
Definition: database_cfg.h:425
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:432
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:429
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:430
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:435
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:427
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:433
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:423
uint8_t packChargeOvercurrent
Definition: database_cfg.h:424
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:434
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:428
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:436
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:437
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:431
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:426
uint16_t nrOpenWires[BS_NR_OF_STRINGS]
Definition: database_cfg.h:292
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:290
uint8_t openwire[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *(BS_NR_OF_CELLS_PER_MODULE+1u)]
Definition: database_cfg.h:294
int32_t stringCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:191
int32_t stringPower_W[BS_NR_OF_STRINGS]
Definition: database_cfg.h:193
int32_t highVoltageBusVoltage_mV
Definition: database_cfg.h:185
uint8_t invalidStringCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:192
int32_t stringVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:189
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:178
uint8_t invalidStringPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:194
uint8_t invalidStringVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:190
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:449
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:445
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:457
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:454
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:446
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:453
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:448
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:456
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:450
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:455
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:451
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:452
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:447
uint8_t ioValueIn[BS_NR_OF_MODULES]
Definition: database_cfg.h:259
uint8_t eepromValueWrite[BS_NR_OF_MODULES]
Definition: database_cfg.h:260
uint32_t eepromWriteAddressLastUsed
Definition: database_cfg.h:257
uint32_t eepromReadAddressLastUsed
Definition: database_cfg.h:255
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:252
uint8_t ioValueOut[BS_NR_OF_MODULES]
Definition: database_cfg.h:258
uint8_t eepromValueRead[BS_NR_OF_MODULES]
Definition: database_cfg.h:261
uint8_t externalTemperatureSensor[BS_NR_OF_MODULES]
Definition: database_cfg.h:262
float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:405
float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:401
float recommendedContinuousPackDischargeCurrent_mA
Definition: database_cfg.h:386
float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:397
float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:394
float recommendedContinuousChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:390
float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:398
float recommendedPeakPackDischargeCurrent_mA
Definition: database_cfg.h:388
float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:402
float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:399
float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:406
float recommendedContinuousPackChargeCurrent_mA
Definition: database_cfg.h:385
float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:404
float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:400
float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:395
float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:396
float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:403
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:384
float recommendedContinuousDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:392
float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:393
float recommendedPeakPackChargeCurrent_mA
Definition: database_cfg.h:387
float maximumSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:491
uint32_t averageSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:493
uint32_t maximumSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:492
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:485
float minimumSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:490
float minimumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:487
float averageSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:486
float maximumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:488
uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:494
float averageSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:489
uint8_t previousStateRequestViaCan
Definition: database_cfg.h:504
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:502
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:414
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:280
uint16_t value[BS_NR_OF_STRINGS][8u *2u *BS_NR_OF_MODULES]
Definition: database_cfg.h:282