foxBMS  1.1.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-06-09 (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 {
105  DATA_BLOCK_ID_MAX, /**< DO NOT CHANGE, MUST BE THE LAST ENTRY */
107 
108 /** data block header */
109 typedef struct DATA_BLOCKHEADER {
110  DATA_BLOCK_ID_e uniqueId; /*!< uniqueId of database entry */
111  uint32_t timestamp; /*!< timestamp of last database update */
112  uint32_t previousTimestamp; /*!< timestamp of previous database update */
114 
115 /** data block struct of cell voltage */
116 typedef struct DATA_BLOCK_CELL_VOLTAGE {
117  /* This struct needs to be at the beginning of every database entry. During
118  * the initialization of a database struct, uniqueId must be set to the
119  * respective database entry representation in enum DATA_BLOCK_ID_e. */
120  DATA_BLOCK_HEADER_s header; /*!< Data block header */
121  uint8_t state; /*!< for future use */
122  int32_t packVoltage_mV[BS_NR_OF_STRINGS]; /*!< uint: mV */
125  [BS_NR_OF_MODULES]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
126  uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid voltages */
128  bool validModuleVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]; /*!< 0 -> if PEC okay; 1 -> PEC error */
130 
131 /** data block struct of cell temperatures */
133  /* This struct needs to be at the beginning of every database entry. During
134  * the initialization of a database struct, uniqueId must be set to the
135  * respective database entry representation in enum DATA_BLOCK_ID_e. */
136  DATA_BLOCK_HEADER_s header; /*!< Data block header */
137  uint8_t state; /*!< for future use */
140  [BS_NR_OF_MODULES]; /*!< bitmask if temperatures are valid. 0->valid, 1->invalid */
141  uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid temperatures in each string */
143 
144 /** data block struct of cell temperatures */
146  /* This struct needs to be at the beginning of every database entry. During
147  * the initialization of a database struct, uniqueId must be set to the
148  * respective database entry representation in enum DATA_BLOCK_ID_e. */
149  DATA_BLOCK_HEADER_s header; /*!< Data block header */
150  int16_t temperatureAdc0_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC0]; /*!< unit: deci degree celsius */
151  int16_t temperatureAdc1_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC1]; /*!< unit: deci degree Celsius */
153  [BS_NR_OF_TEMP_SENSORS_ON_ADC0]; /*!< bitmask if temperatures are valid. 0->valid, 1->invalid */
155  [BS_NR_OF_TEMP_SENSORS_ON_ADC1]; /*!< bitmask if temperatures are valid. 0->valid, 1->invalid */
157 
158 /** data block struct of minimum and maximum values */
159 typedef struct DATA_BLOCK_MIN_MAX {
160  /* This struct needs to be at the beginning of every database entry. During
161  * the initialization of a database struct, uniqueId must be set to the
162  * respective database entry representation in enum DATA_BLOCK_ID_e. */
163  DATA_BLOCK_HEADER_s header; /*!< Data block header */
164 
165  int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< average cell voltages, unit: mV */
166  int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< minimum cell voltages, unit: mV */
167  int16_t previousMinimumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous minimum cell voltages, unit: mV */
168  int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< maximum cell voltages, unit: mV */
169  int16_t previousMaximumCellVoltage_mV[BS_NR_OF_STRINGS]; /*!< previous maximum cell voltages, unit: mV */
170  uint16_t nrModuleMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with minimum cell voltage */
171  uint16_t nrCellMinimumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with minimum cell voltage */
172  uint16_t nrModuleMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the module with maximum cell voltage */
173  uint16_t nrCellMaximumCellVoltage[BS_NR_OF_STRINGS]; /*!< number of the cell with maximum cell voltage */
174  uint16_t validMeasuredCellVoltages[BS_NR_OF_STRINGS]; /*!< number of valid measured cell voltages */
175  float averageTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
176  int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
177  uint16_t nrModuleMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with minimum temperature */
178  uint16_t nrSensorMinimumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with minimum temperature */
179  int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: deci &deg;C */
180  uint16_t nrModuleMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the module with maximum temperature */
181  uint16_t nrSensorMaximumTemperature[BS_NR_OF_STRINGS]; /*!< number of the sensor with maximum temperature */
182  uint16_t validMeasuredCellTemperatures[BS_NR_OF_STRINGS]; /*!< number of valid measured cell temperatures */
183  uint8_t state; /*!< state of the min max module */
185 
186 /** data block struct of pack measurement values */
187 typedef struct DATA_BLOCK_PACK_VALUES {
188  /* This struct needs to be at the beginning of every database entry. During
189  * the initialization of a database struct, uniqueId must be set to the
190  * respective database entry representation in enum DATA_BLOCK_ID_e. */
191  DATA_BLOCK_HEADER_s header; /*!< Data block header */
192 
193  int32_t packCurrent_mA; /*!< current in the whole battery pack, unit: mA */
194  uint8_t invalidPackCurrent; /*!< bitmask if current is valid. 0->valid, 1->invalid */
195  int32_t batteryVoltage_mV; /*!< voltage between negative and positive battery pole, unit: mV */
196  uint8_t invalidBatteryVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
197  int32_t
198  highVoltageBusVoltage_mV; /*!< voltage between negative battery pole and after positive main contactor, unit: mV */
199  uint8_t invalidHvBusVoltage; /*!< bitmask if voltage is valid. 0->valid, 1->invalid */
200  int32_t packPower_W; /*!< power provided by respectively supplied to the battery pack, unit: W */
201  uint8_t invalidPackPower; /*!< bitmask if power is valid. 0->valid, 1->invalid */
202  int32_t stringVoltage_mV[BS_NR_OF_STRINGS]; /*!< voltage of each string, unit: mV */
203  uint8_t invalidStringVoltage[BS_NR_OF_STRINGS]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
204  int32_t stringCurrent_mA[BS_NR_OF_STRINGS]; /*!< current in each string, unit: mA */
205  uint8_t invalidStringCurrent[BS_NR_OF_STRINGS]; /*!< bitmask if currents are valid. 0->valid, 1->invalid */
206  int32_t stringPower_W[BS_NR_OF_STRINGS]; /*!< power of each string, unit: W */
207  uint8_t invalidStringPower[BS_NR_OF_STRINGS]; /*!< bitmask if power values are valid. 0->valid, 1->invalid */
209 
210 /** data block struct of current measurement */
212  /* This struct needs to be at the beginning of every database entry. During
213  * the initialization of a database struct, uniqueId must be set to the
214  * respective database entry representation in enum DATA_BLOCK_ID_e. */
215  DATA_BLOCK_HEADER_s header; /*!< Data block header */
216  int32_t current_mA[BS_NR_OF_STRINGS]; /*!< unit: mA */
217  uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
218  uint8_t newCurrent; /*!< 0: measurement valid, 1: measurement invalid */
219  uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
220  uint32_t timestampCurrent[BS_NR_OF_STRINGS]; /*!< timestamp of current measurement */
221  int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]; /*!< unit: 0.1&deg;C */
222  uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
223  int32_t power_W[BS_NR_OF_STRINGS]; /*!< unit: W */
224  uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
225  uint8_t newPower; /*!< counter that indicates a new power measurement */
226  uint32_t previousTimestampPower[BS_NR_OF_STRINGS]; /*!< previous timestamp of power measurement */
227  uint32_t timestampPower[BS_NR_OF_STRINGS]; /*!< timestamp of power measurement */
228  int32_t currentCounter_As[BS_NR_OF_STRINGS]; /*!< unit: A.s */
229  uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
230  uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of CC measurement */
231  uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]; /*!< timestamp of CC measurement */
232  int32_t energyCounter_Wh[BS_NR_OF_STRINGS]; /*!< unit: Wh */
233  uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]; /*!< 0: measurement valid, 1: measurement invalid */
234  uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< previous timestamp of EC measurement */
235  uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]; /*!< timestamp of EC measurement */
237  [BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< 0: measurement valid, 1: measurement invalid */
241  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< previous timestamp of high voltage measurement */
243  [BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]; /*!< timestamp of high voltage measurement */
245 
246 /** data structure declaration of DATA_BLOCK_BALANCING_CONTROL */
248  /* This struct needs to be at the beginning of every database entry. During
249  * the initialization of a database struct, uniqueId must be set to the
250  * respective database entry representation in enum DATA_BLOCK_ID_e. */
251  DATA_BLOCK_HEADER_s header; /*!< Data block header */
252  uint8_t enableBalancing; /*!< Switch for enabling/disabling balancing */
253  uint8_t threshold_mV; /*!< balancing threshold in mV */
254  uint8_t request; /*!< balancing request per CAN */
255  uint8_t balancingState[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]; /*!< 0: no balancing, 1: balancing active */
256  uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]; /*!< Difference in Depth-of-Discharge in mAs */
259 
260 /** data structure declaration of DATA_BLOCK_USER_IO_CONTROL */
261 typedef struct DATA_BLOCK_SLAVE_CONTROL {
262  /* This struct needs to be at the beginning of every database entry. During
263  * the initialization of a database struct, uniqueId must be set to the
264  * respective database entry representation in enum DATA_BLOCK_ID_e. */
265  DATA_BLOCK_HEADER_s header; /*!< Data block header */
266  uint8_t state; /*!< for future use */
267  uint32_t eepromReadAddressToUse; /*!< address to read from for slave EEPROM */
268  uint32_t eepromReadAddressLastUsed; /*!< last address used to read fromfor slave EEPROM */
269  uint32_t eepromWriteAddressToUse; /*!< address to write to for slave EEPROM */
270  uint32_t eepromWriteAddressLastUsed; /*!< last address used to write to for slave EEPROM */
271  uint8_t ioValueOut[BS_NR_OF_MODULES]; /*!< data to be written to the port expander */
272  uint8_t ioValueIn[BS_NR_OF_MODULES]; /*!< data read from to the port expander */
273  uint8_t eepromValueWrite[BS_NR_OF_MODULES]; /*!< data to be written to the slave EEPROM */
274  uint8_t eepromValueRead[BS_NR_OF_MODULES]; /*!< data read from to the slave EEPROM */
275  uint8_t externalTemperatureSensor[BS_NR_OF_MODULES]; /*!< temperature from the external sensor on slave */
277 
278 /** data block struct of cell balancing feedback */
280  /* This struct needs to be at the beginning of every database entry. During
281  * the initialization of a database struct, uniqueId must be set to the
282  * respective database entry representation in enum DATA_BLOCK_ID_e. */
283  DATA_BLOCK_HEADER_s header; /*!< Data block header */
284  uint8_t state; /*!< for future use */
285  uint16_t value[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]; /*!< unit: mV (optocoupler output) */
287 
288 /** data block struct of user multiplexer values */
289 typedef struct DATA_BLOCK_USER_MUX {
290  /* This struct needs to be at the beginning of every database entry. During
291  * the initialization of a database struct, uniqueId must be set to the
292  * respective database entry representation in enum DATA_BLOCK_ID_e. */
293  DATA_BLOCK_HEADER_s header; /*!< Data block header */
294  uint8_t state; /*!< for future use */
295  uint16_t value[BS_NR_OF_STRINGS][8 * 2 * BS_NR_OF_MODULES]; /*!< unit: mV (mux voltage input) */
297 
298 /** data block struct of cell open wire */
299 typedef struct DATA_BLOCK_OPENWIRE {
300  /* This struct needs to be at the beginning of every database entry. During
301  * the initialization of a database struct, uniqueId must be set to the
302  * respective database entry representation in enum DATA_BLOCK_ID_e. */
303  DATA_BLOCK_HEADER_s header; /*!< Data block header */
304  uint8_t state; /*!< for future use */
305  uint16_t nrOpenWires[BS_NR_OF_STRINGS]; /*!< number of open wires */
307  [BS_NR_OF_MODULES * (BS_NR_OF_CELLS_PER_MODULE + 1)]; /*!< 1 -> open wire, 0 -> everything ok */
309 
310 /** data block struct of GPIO voltage */
312  /* This struct needs to be at the beginning of every database entry. During
313  * the initialization of a database struct, uniqueId must be set to the
314  * respective database entry representation in enum DATA_BLOCK_ID_e. */
315  DATA_BLOCK_HEADER_s header; /*!< Data block header */
316  uint8_t state; /*!< for future use */
319  [BS_NR_OF_MODULES]; /*!< bitmask if voltages are valid. 0->valid, 1->invalid */
321 
322 /** data block struct of error flags */
323 typedef struct DATA_BLOCK_ERRORSTATE {
324  /* This struct needs to be at the beginning of every database entry. During
325  * the initialization of a database struct, uniqueId must be set to the
326  * respective database entry representation in enum DATA_BLOCK_ID_e. */
327  DATA_BLOCK_HEADER_s header; /*!< Data block header */
328  uint8_t currentSensor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
329  uint8_t stringContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
330  uint8_t prechargeContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */
331  uint8_t interlock; /*!< 0 -> no error, 1 -> error */
332  uint8_t crcError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
333  uint8_t muxError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
334  uint8_t spiError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
335  uint8_t micConfigurationError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
336  uint8_t micCellvoltageError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
337  uint8_t micCellTemperatureError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
338  uint8_t baseCellVoltageMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
339  uint8_t redundancy0CellVoltageMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
340  uint8_t baseCellTemperatureMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
341  uint8_t redundancy0CellTemperatureMeasurementTimeout; /*!< 0 -> no error, 1 -> error */
342  uint8_t currentMeasurementTimeout[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
343  uint8_t currentMeasurementError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
344  uint8_t currentSensorTimeoutV1[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
345  uint8_t currentSensorTimeoutV3[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
346  uint8_t currentSensorPowerTimeout[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
347  uint8_t powerMeasurementError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
348  uint8_t insulationError; /*!< 0 -> no error, 1 -> error */
349  uint8_t fuseStateNormal[BS_NR_OF_STRINGS]; /*!< 0 -> fuse ok, 1 -> fuse tripped */
350  uint8_t fuseStateCharge[BS_NR_OF_STRINGS]; /*!< 0 -> fuse ok, 1 -> fuse tripped */
351  uint8_t open_wire[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
352  uint8_t canTiming; /*!< 0 -> no error, 1 -> error */
353  uint8_t canRxQueueFull; /*!< 0 -> no error, 1 -> error */
354  uint8_t canTimingCc[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
355  uint8_t canTimingEc[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
356  uint8_t mcuDieTemperature; /*!< 0 -> no error, 1 -> error */
357  uint8_t coinCellVoltage; /*!< 0 -> no error, 1 -> error */
358  uint8_t plausibilityCheckPackvoltage[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
359  uint8_t plausibilityCheckCellvoltage[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
360  uint8_t plausibilityCheckCellvoltageSpread[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
361  uint8_t plausibilityCheckCelltemperatureSpread[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
362  uint8_t plausibilityCheckCelltemperature[BS_NR_OF_STRINGS]; /*!< 0 -> no error, else: error */
363  uint8_t deepDischargeDetected[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
364  uint8_t currentOnOpenString[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */
365  uint8_t sbcFinState; /*!< 0 -> okay, 1 -> error: short-circuit to RSTB */
366  uint8_t sbcRstbState; /*!< 0 -> okay, 1 -> error: RSTB not working */
368 
369 /** data block struct of contactor feedback */
370 typedef struct DATA_BLOCK_CONTFEEDBACK {
371  /* This struct needs to be at the beginning of every database entry. During
372  * the initialization of a database struct, uniqueId must be set to the
373  * respective database entry representation in enum DATA_BLOCK_ID_e. */
374  DATA_BLOCK_HEADER_s header; /*!< Data block header */
375  uint32_t contactorFeedback; /*!< feedback of all contactors, without interlock */
377 
378 /** data block struct of interlock feedback */
380  /* This struct needs to be at the beginning of every database entry. During
381  * the initialization of a database struct, uniqueId must be set to the
382  * respective database entry representation in enum DATA_BLOCK_ID_e. */
383  DATA_BLOCK_HEADER_s header; /*!< Data block header */
384  uint8_t interlockFeedback; /*!< feedback of interlock, without contactors */
386 
387 /** data block struct of sof limits */
388 typedef struct DATA_BLOCK_SOF {
389  /* This struct needs to be at the beginning of every database entry. During
390  * the initialization of a database struct, uniqueId must be set to the
391  * respective database entry representation in enum DATA_BLOCK_ID_e. */
392  DATA_BLOCK_HEADER_s header; /*!< Data block header */
393  float recommendedContinuousPackChargeCurrent_mA; /*!< recommended continuous operating pack charge current */
394  float recommendedContinuousPackDischargeCurrent_mA; /*!< recommended continuous operating pack discharge current */
395  float recommendedPeakPackChargeCurrent_mA; /*!< recommended peak operating pack charge current */
396  float recommendedPeakPackDischargeCurrent_mA; /*!< recommended peak operating pack discharge current */
398  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating charge current */
400  [BS_NR_OF_STRINGS]; /*!< recommended continuous operating discharge current */
401  float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating charge current */
402  float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating discharge current */
403  float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */
404  float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */
405  float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */
406  float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */
407  float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */
408  float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */
409  float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */
410  float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */
411  float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */
412  float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */
413  float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */
414  float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */
416 
417 /** data block struct of system state */
418 typedef struct {
419  /* This struct needs to be at the beginning of every database entry. During
420  * the initialization of a database struct, uniqueId must be set to the
421  * respective database entry representation in enum DATA_BLOCK_ID_e. */
422  DATA_BLOCK_HEADER_s header; /*!< Data block header */
423  int32_t bmsCanState; /*!< system state for CAN messages (e.g., standby, normal) */
425 
426 /** data block struct of the maximum safe limits */
427 typedef struct DATA_BLOCK_MSL_FLAG {
428  /* This struct needs to be at the beginning of every database entry. During
429  * the initialization of a database struct, uniqueId must be set to the
430  * respective database entry representation in enum DATA_BLOCK_ID_e. */
431  DATA_BLOCK_HEADER_s header; /*!< Data block header */
432  uint8_t packChargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
433  uint8_t packDischargeOvercurrent; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
434  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
435  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
436  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
437  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
438  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
439  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
440  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
441  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
442  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
443  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
444  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
445  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MSL NOT violated, 1 -> MSL violated */
447 
448 /** data block struct of the recommended safety limit */
449 typedef struct DATA_BLOCK_RSL_FLAG {
450  /* This struct needs to be at the beginning of every database entry. During
451  * the initialization of a database struct, uniqueId must be set to the
452  * respective database entry representation in enum DATA_BLOCK_ID_e. */
453  DATA_BLOCK_HEADER_s header; /*!< Data block header */
454  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
455  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
456  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
457  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
458  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
459  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
460  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
461  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
462  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
463  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
464  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
465  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> RSL NOT violated, 1 -> RSL violated */
467 
468 /** data block struct of the maximum operating limit */
469 typedef struct DATA_BLOCK_MOL_FLAG {
470  /* This struct needs to be at the beginning of every database entry. During
471  * the initialization of a database struct, uniqueId must be set to the
472  * respective database entry representation in enum DATA_BLOCK_ID_e. */
473  DATA_BLOCK_HEADER_s header; /*!< Data block header */
474  uint8_t overVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
475  uint8_t underVoltage[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
476  uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
477  uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
478  uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
479  uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
480  uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
481  uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
482  uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
483  uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
484  uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
485  uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]; /*!< 0 -> MOL NOT violated, 1 -> MOL violated */
487 
488 /** data block struct of sox */
489 typedef struct DATA_BLOCK_SOX {
490  /* This struct needs to be at the beginning of every database entry. During
491  * the initialization of a database struct, uniqueId must be set to the
492  * respective database entry representation in enum DATA_BLOCK_ID_e. */
493  DATA_BLOCK_HEADER_s header; /*!< Data block header */
494  float averageSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoc <= 100.0 */
495  float minimumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minSoc <= 100.0 */
496  float maximumSoc_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maxSoc <= 100.0 */
497  float averageSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= averageSoe <= 100.0 */
498  float minimumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= minimumSoe <= 100.0 */
499  float maximumSoe_perc[BS_NR_OF_STRINGS]; /*!< 0.0 <= maximumSoe <= 100.0 */
500  uint32_t maximumSoe_Wh[BS_NR_OF_STRINGS]; /*!< maximum string energy in Wh */
501  uint32_t averageSoe_Wh[BS_NR_OF_STRINGS]; /*!< average string energy in Wh */
502  uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]; /*!< minimum string energy in Wh */
504 
505 /** data block struct of can state request */
506 typedef struct DATA_BLOCK_STATEREQUEST {
507  /* This struct needs to be at the beginning of every database entry. During
508  * the initialization of a database struct, uniqueId must be set to the
509  * respective database entry representation in enum DATA_BLOCK_ID_e. */
510  DATA_BLOCK_HEADER_s header; /*!< Data block header */
511  uint8_t stateRequestViaCan; /*!< state request */
512  uint8_t previousStateRequestViaCan; /*!< previous state request */
513  uint8_t stateRequestViaCanPending; /*!< pending state request */
514  uint8_t state; /*!< state */
516 
517 /** data block struct of the moving average algorithm */
518 typedef struct {
519  /* This struct needs to be at the beginning of every database entry. During
520  * the initialization of a database struct, uniqueId must be set to the
521  * respective database entry representation in enum DATA_BLOCK_ID_e. */
522  DATA_BLOCK_HEADER_s header; /*!< Data block header */
523  float movingAverageCurrent1sInterval_mA; /*!< current moving average over the last 1s */
524  float movingAverageCurrent5sInterval_mA; /*!< current moving average over the last 5s */
525  float movingAverageCurrent10sInterval_mA; /*!< current moving average over the last 10s */
526  float movingAverageCurrent30sInterval_mA; /*!< current moving average over the last 30s */
527  float movingAverageCurrent60sInterval_mA; /*!< current moving average over the last 60s */
528  float movingAverageCurrentConfigurableInterval_mA; /*!< current moving average over the last configured time */
529  float movingAveragePower1sInterval_mA; /*!< power moving average over the last 1s */
530  float movingAveragePower5sInterval_mA; /*!< power moving average over the last 5s */
531  float movingAveragePower10sInterval_mA; /*!< power moving average over the last 10s */
532  float movingAveragePower30sInterval_mA; /*!< power moving average over the last 30s */
533  float movingAveragePower60sInterval_mA; /*!< power moving average over the last 60s */
534  float movingAveragePowerConfigurableInterval_mA; /*!< power moving average over the last configured time */
536 
537 /** data block struct of insulation monitoring device measurement */
539  /* This struct needs to be at the beginning of every database entry. During
540  * the initialization of a database struct, uniqueId must be set to the
541  * respective database entry representation in enum DATA_BLOCK_ID_e. */
542  DATA_BLOCK_HEADER_s header; /*!< Data block header */
543  uint8_t valid; /*!< 0 -> valid, 1 -> resistance unreliable */
544  uint8_t state; /*!< 0 -> ok , 1 -> resistance too low/error */
545  uint32_t insulationResistance_kOhm; /*!< insulation resistance measured in kOhm */
546  uint8_t insulationFault; /*!< 0 = no error, 1 = error */
547  uint8_t insulationWarning; /*!< 0 = no warning, 1 = warning */
548  uint8_t chassisFault; /*!< 0 = no error, 1 = error */
549  uint8_t systemFailure; /*!< 0 = no error, 1 = error */
550  uint8_t calibrationRunning; /*!< 0 = not running, 1 = running */
551  uint8_t selfTestRunning; /*!< 0 = not running, 1 = running */
552  uint8_t insulationMeasurements; /*!< 0 = Active, 1 = Inactive */
553  uint8_t aliveStatusDetection; /*!< 0 = Ok, 1 = Failure */
554  uint8_t outdatedInsulationResistanceValue; /*!< 0 = Valid, 1 = Outdated */
555  uint8_t testImcOverAll; /*!< 0 = NotRunning, 1 = Running */
556  uint8_t testImcParameterConfiguration; /*!< 0 = NotWarning, 1 = Warning */
558 
559 /** data block struct for the database built-in self-test */
561  /* This struct needs to be at the beginning of every database entry. During
562  * the initialization of a database struct, uniqueId must be set to the
563  * respective database entry representation in enum DATA_BLOCK_ID_e. */
564  DATA_BLOCK_HEADER_s header; /*!< Data block header */
565  uint8_t member1; /*!< first member of self-test struct */
566  uint8_t member2; /*!< second member of self-test struct */
568 
569 /** array for the database */
571 
572 /*========== Extern Constant and Variable Declarations ======================*/
573 
574 /*========== Extern Function Prototypes =====================================*/
575 
576 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
577 
578 #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_TEMP_SENSORS_ON_ADC0
#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
#define BS_NR_OF_TEMP_SENSORS_ON_ADC1
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:173
struct DATA_BLOCK_RSL_FLAG DATA_BLOCK_RSL_FLAG_s
struct DATA_BLOCK_OPENWIRE DATA_BLOCK_OPEN_WIRE_s
struct DATA_BLOCK_ADC_TEMPERATURE DATA_BLOCK_ADC_TEMPERATURE_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
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_ADC_TEMPERATURE
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_SOX
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:102
@ 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:105
@ 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_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_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:103
@ 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.
void * pDatabaseEntry
Definition: database_cfg.h:67
uint32_t datalength
Definition: database_cfg.h:68
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:110
uint32_t timestamp
Definition: database_cfg.h:111
uint32_t previousTimestamp
Definition: database_cfg.h:112
int16_t temperatureAdc1_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC1]
Definition: database_cfg.h:151
uint16_t valid_temperature_ADC0[BS_NR_OF_TEMP_SENSORS_ON_ADC0]
Definition: database_cfg.h:153
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:149
uint16_t valid_temperature_ADC1[BS_NR_OF_TEMP_SENSORS_ON_ADC1]
Definition: database_cfg.h:155
int16_t temperatureAdc0_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC0]
Definition: database_cfg.h:150
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:315
uint16_t gpioVoltages_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *BS_NR_OF_GPIOS_PER_MODULE]
Definition: database_cfg.h:317
uint16_t invalidGpioVoltages[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:319
uint8_t balancingState[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:255
uint16_t nrBalancedCells[BS_NR_OF_STRINGS]
Definition: database_cfg.h:257
uint32_t deltaCharge_mAs[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:256
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:251
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:283
uint16_t value[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:285
int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_TEMP_SENSORS_PER_STRING]
Definition: database_cfg.h:138
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:136
uint16_t invalidCellTemperature[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:140
uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]
Definition: database_cfg.h:141
uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]
Definition: database_cfg.h:126
uint32_t moduleVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:127
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
Definition: database_cfg.h:123
uint64_t invalidCellVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:125
bool validModuleVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
Definition: database_cfg.h:128
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:120
int32_t packVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:122
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:374
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:215
uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:217
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:220
uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:230
uint32_t timestampPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:227
int32_t power_W[BS_NR_OF_STRINGS]
Definition: database_cfg.h:223
uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:222
uint8_t invalidHighVoltageMeasurement[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:237
uint32_t previousTimestampPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:226
int32_t current_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:216
uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:229
uint32_t timestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:243
uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:224
uint32_t previousTimestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:241
int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:221
uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:235
int32_t currentCounter_As[BS_NR_OF_STRINGS]
Definition: database_cfg.h:228
int32_t highVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
Definition: database_cfg.h:238
uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]
Definition: database_cfg.h:233
uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:234
int32_t energyCounter_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:232
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:231
uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:219
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:564
uint8_t baseCellVoltageMeasurementTimeout
Definition: database_cfg.h:338
uint8_t currentSensorTimeoutV3[BS_NR_OF_STRINGS]
Definition: database_cfg.h:345
uint8_t plausibilityCheckCelltemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:362
uint8_t powerMeasurementError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:347
uint8_t currentMeasurementTimeout[BS_NR_OF_STRINGS]
Definition: database_cfg.h:342
uint8_t deepDischargeDetected[BS_NR_OF_STRINGS]
Definition: database_cfg.h:363
uint8_t crcError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:332
uint8_t micConfigurationError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:335
uint8_t canTimingEc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:355
uint8_t prechargeContactor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:330
uint8_t plausibilityCheckPackvoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:358
uint8_t currentMeasurementError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:343
uint8_t muxError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:333
uint8_t plausibilityCheckCellvoltageSpread[BS_NR_OF_STRINGS]
Definition: database_cfg.h:360
uint8_t currentSensorTimeoutV1[BS_NR_OF_STRINGS]
Definition: database_cfg.h:344
uint8_t currentSensorPowerTimeout[BS_NR_OF_STRINGS]
Definition: database_cfg.h:346
uint8_t spiError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:334
uint8_t open_wire[BS_NR_OF_STRINGS]
Definition: database_cfg.h:351
uint8_t redundancy0CellTemperatureMeasurementTimeout
Definition: database_cfg.h:341
uint8_t fuseStateNormal[BS_NR_OF_STRINGS]
Definition: database_cfg.h:349
uint8_t fuseStateCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:350
uint8_t redundancy0CellVoltageMeasurementTimeout
Definition: database_cfg.h:339
uint8_t plausibilityCheckCelltemperatureSpread[BS_NR_OF_STRINGS]
Definition: database_cfg.h:361
uint8_t plausibilityCheckCellvoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:359
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:327
uint8_t micCellTemperatureError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:337
uint8_t micCellvoltageError[BS_NR_OF_STRINGS]
Definition: database_cfg.h:336
uint8_t currentSensor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:328
uint8_t currentOnOpenString[BS_NR_OF_STRINGS]
Definition: database_cfg.h:364
uint8_t baseCellTemperatureMeasurementTimeout
Definition: database_cfg.h:340
uint8_t canTimingCc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:354
uint8_t stringContactor[BS_NR_OF_STRINGS]
Definition: database_cfg.h:329
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:383
uint16_t nrCellMinimumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:171
uint16_t validMeasuredCellTemperatures[BS_NR_OF_STRINGS]
Definition: database_cfg.h:182
uint16_t nrSensorMinimumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:178
int16_t maximumTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:179
int16_t minimumTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:176
float averageTemperature_ddegC[BS_NR_OF_STRINGS]
Definition: database_cfg.h:175
uint16_t nrModuleMaximumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:172
uint16_t nrCellMaximumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:173
uint16_t nrSensorMaximumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:181
uint16_t validMeasuredCellVoltages[BS_NR_OF_STRINGS]
Definition: database_cfg.h:174
int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:168
int16_t previousMinimumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:167
uint16_t nrModuleMinimumCellVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:170
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:163
uint16_t nrModuleMaximumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:180
int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:165
uint16_t nrModuleMinimumTemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:177
int16_t previousMaximumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:169
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:166
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:484
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:483
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:477
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:482
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:475
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:473
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:479
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:476
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:481
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:478
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:485
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:480
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:474
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:522
float movingAverageCurrentConfigurableInterval_mA
Definition: database_cfg.h:528
float movingAveragePowerConfigurableInterval_mA
Definition: database_cfg.h:534
uint8_t packDischargeOvercurrent
Definition: database_cfg.h:433
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:440
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:437
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:438
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:443
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:435
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:441
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:431
uint8_t packChargeOvercurrent
Definition: database_cfg.h:432
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:442
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:436
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:444
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:445
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:439
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:434
uint16_t nrOpenWires[BS_NR_OF_STRINGS]
Definition: database_cfg.h:305
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:303
uint8_t openwire[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *(BS_NR_OF_CELLS_PER_MODULE+1)]
Definition: database_cfg.h:307
int32_t stringCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:204
int32_t stringPower_W[BS_NR_OF_STRINGS]
Definition: database_cfg.h:206
int32_t highVoltageBusVoltage_mV
Definition: database_cfg.h:198
uint8_t invalidStringCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:205
int32_t stringVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:202
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:191
uint8_t invalidStringPower[BS_NR_OF_STRINGS]
Definition: database_cfg.h:207
uint8_t invalidStringVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:203
uint8_t overtemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:457
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:453
uint8_t pcbUndertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:465
uint8_t cellDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:462
uint8_t overVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:454
uint8_t stringChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:461
uint8_t overtemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:456
uint8_t pcbOvertemperature[BS_NR_OF_STRINGS]
Definition: database_cfg.h:464
uint8_t undertemperatureCharge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:458
uint8_t stringDischargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:463
uint8_t undertemperatureDischarge[BS_NR_OF_STRINGS]
Definition: database_cfg.h:459
uint8_t cellChargeOvercurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:460
uint8_t underVoltage[BS_NR_OF_STRINGS]
Definition: database_cfg.h:455
uint8_t ioValueIn[BS_NR_OF_MODULES]
Definition: database_cfg.h:272
uint8_t eepromValueWrite[BS_NR_OF_MODULES]
Definition: database_cfg.h:273
uint32_t eepromWriteAddressLastUsed
Definition: database_cfg.h:270
uint32_t eepromReadAddressLastUsed
Definition: database_cfg.h:268
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:265
uint8_t ioValueOut[BS_NR_OF_MODULES]
Definition: database_cfg.h:271
uint8_t eepromValueRead[BS_NR_OF_MODULES]
Definition: database_cfg.h:274
uint8_t externalTemperatureSensor[BS_NR_OF_MODULES]
Definition: database_cfg.h:275
float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:413
float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:409
float recommendedContinuousPackDischargeCurrent_mA
Definition: database_cfg.h:394
float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:405
float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:402
float recommendedContinuousChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:398
float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:406
float recommendedPeakPackDischargeCurrent_mA
Definition: database_cfg.h:396
float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:410
float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:407
float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:414
float recommendedContinuousPackChargeCurrent_mA
Definition: database_cfg.h:393
float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:412
float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:408
float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:403
float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:404
float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:411
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:392
float recommendedContinuousDischargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:400
float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:401
float recommendedPeakPackChargeCurrent_mA
Definition: database_cfg.h:395
float maximumSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:499
uint32_t averageSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:501
uint32_t maximumSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:500
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:493
float minimumSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:498
float minimumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:495
float averageSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:494
float maximumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:496
uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]
Definition: database_cfg.h:502
float averageSoe_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:497
uint8_t previousStateRequestViaCan
Definition: database_cfg.h:512
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:510
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:422
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:293
uint16_t value[BS_NR_OF_STRINGS][8 *2 *BS_NR_OF_MODULES]
Definition: database_cfg.h:295