foxBMS  1.2.0
The foxBMS Battery Management System API Documentation
database_cfg.c
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.c
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
51  *
52  * @details Configuration of database module
53  *
54  */
55 
56 /*========== Includes =======================================================*/
57 #include "database_cfg.h"
58 
59 /*========== Macros and Definitions =========================================*/
60 
61 /*========== Static Constant and Variable Definitions =======================*/
62 
63 /*========== Extern Constant and Variable Definitions =======================*/
64 
65 /** data block: cell voltage */
66 /**@{*/
71 /**@}*/
72 
73 /** data block: cell temperature */
74 /**@{*/
80 /**@}*/
81 
82 /** data block: minimum and maximum values */
84 
85 /** data block: current sensor */
87 
88 /** data block: balancing control */
90 
91 /** data block: slave control */
93 
94 /** data block: balancing feedback */
95 /**@{*/
100 /**@}*/
101 
102 /** data block: user mux */
104 
105 /** data block: open wire check */
106 /**@{*/
109 /**@}*/
110 
111 /** data block: LTC GPIO voltage */
112 /**@{*/
117 /**@}*/
118 
119 /** data block: error flags */
121 
122 /** data block: contactor feedback */
125 
126 /** data block: interlock feedback */
129 
130 /** data block: sof */
132 
133 /** data block: system state */
135 
136 /** data block: maximum safety limit violations */
138 
139 /** data block: recommended safety limit violations */
141 
142 /** data block: maximum operating limit violations */
144 
145 /** data block: sox */
147 
148 /** data block: can state request */
150 
151 /** data block: moving average */
153 
154 /** data block: insulation monitoring */
157 
158 /** data block: pack values */
160 
161 /** data block: adc temperature */
163 
164 /** data block: I2C humidity/temperature sensor measurements*/
166 
167 /** data block: used for self-test */
170 
171 /**
172  * @brief channel configuration of database (data blocks)
173  * @details all data block managed by database are listed here (address, size,
174  * consistency type)
175  */
177  {(void *)(&data_blockCellVoltage), sizeof(DATA_BLOCK_CELL_VOLTAGE_s)},
179  {(void *)(&data_blockMinMax), sizeof(DATA_BLOCK_MIN_MAX_s)},
184  {(void *)(&data_blockUserMux), sizeof(DATA_BLOCK_USER_MUX_s)},
185  {(void *)(&data_blockOpenWireBase), sizeof(DATA_BLOCK_OPEN_WIRE_s)},
187  {(void *)(&data_blockErrors), sizeof(DATA_BLOCK_ERRORSTATE_s)},
190  {(void *)(&data_blockSof), sizeof(DATA_BLOCK_SOF_s)},
191  {(void *)(&data_blockSystemstate), sizeof(DATA_BLOCK_SYSTEMSTATE_s)},
192  {(void *)(&data_blockMsl), sizeof(DATA_BLOCK_MSL_FLAG_s)},
193  {(void *)(&data_blockRsl), sizeof(DATA_BLOCK_RSL_FLAG_s)},
194  {(void *)(&data_blockMol), sizeof(DATA_BLOCK_MOL_FLAG_s)},
195  {(void *)(&data_blockSox), sizeof(DATA_BLOCK_SOX_s)},
206  {(void *)(&data_blockPackValues), sizeof(DATA_BLOCK_PACK_VALUES_s)},
207  {(void *)(&data_blockAdcVoltage), sizeof(DATA_BLOCK_ADC_VOLTAGE_s)},
210 };
211 
212 /*========== Static Function Prototypes =====================================*/
213 
214 /*========== Static Function Implementations ================================*/
215 
216 /*========== Extern Function Implementations ================================*/
217 
218 /*========== Externalized Static Function Implementations (Unit Test) =======*/
static DATA_BLOCK_BALANCING_CONTROL_s data_blockControlBalancing
Definition: database_cfg.c:89
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireRedundancy0
Definition: database_cfg.c:108
static DATA_BLOCK_MIN_MAX_s data_blockMinMax
Definition: database_cfg.c:83
static DATA_BLOCK_MOVING_AVERAGE_s data_blockMovingAverage
Definition: database_cfg.c:152
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltage
Definition: database_cfg.c:67
static DATA_BLOCK_MSL_FLAG_s data_blockMsl
Definition: database_cfg.c:137
static DATA_BLOCK_INTERLOCK_FEEDBACK_s data_blockInterlockFeedback
Definition: database_cfg.c:127
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageBase
Definition: database_cfg.c:68
static DATA_BLOCK_DUMMY_FOR_SELF_TEST_s data_blockDummyForSelfTest
Definition: database_cfg.c:168
static DATA_BLOCK_INSULATION_MONITORING_s data_blockInsulationMonitoring
Definition: database_cfg.c:155
static DATA_BLOCK_HTSEN_s data_blockHumidityTemperatureSensor
Definition: database_cfg.c:165
DATA_BASE_s data_database[]
channel configuration of database (data blocks)
Definition: database_cfg.c:176
static DATA_BLOCK_SLAVE_CONTROL_s data_blockSlaveControl
Definition: database_cfg.c:92
static DATA_BLOCK_SYSTEMSTATE_s data_blockSystemstate
Definition: database_cfg.c:134
static DATA_BLOCK_STATEREQUEST_s data_blockStaterequest
Definition: database_cfg.c:149
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageRedundancy0
Definition: database_cfg.c:69
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireBase
Definition: database_cfg.c:107
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesRedundancy0
Definition: database_cfg.c:115
static DATA_BLOCK_ADC_VOLTAGE_s data_blockAdcVoltage
Definition: database_cfg.c:162
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureBase
Definition: database_cfg.c:76
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesBase
Definition: database_cfg.c:113
static DATA_BLOCK_CURRENT_SENSOR_s data_blockCurrentSensor
Definition: database_cfg.c:86
static DATA_BLOCK_PACK_VALUES_s data_blockPackValues
Definition: database_cfg.c:159
static DATA_BLOCK_USER_MUX_s data_blockUserMux
Definition: database_cfg.c:103
static DATA_BLOCK_SOF_s data_blockSof
Definition: database_cfg.c:131
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperature
Definition: database_cfg.c:75
static DATA_BLOCK_SOX_s data_blockSox
Definition: database_cfg.c:146
static DATA_BLOCK_MOL_FLAG_s data_blockMol
Definition: database_cfg.c:143
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureRedundancy0
Definition: database_cfg.c:78
static DATA_BLOCK_RSL_FLAG_s data_blockRsl
Definition: database_cfg.c:140
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingBase
Definition: database_cfg.c:96
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingRedundancy0
Definition: database_cfg.c:98
static DATA_BLOCK_ERRORSTATE_s data_blockErrors
Definition: database_cfg.c:120
static DATA_BLOCK_CONTACTOR_FEEDBACK_s data_blockContactorFeedback
Definition: database_cfg.c:123
Database configuration header.
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_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
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
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_BLOCK_HTSEN DATA_BLOCK_HTSEN_s
@ 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_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
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:111
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:566
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:302
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:238
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:270
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:137
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:121
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:362
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:202
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:575
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:314
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:556
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:371
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:150
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:465
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:514
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:423
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:290
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:178
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:445
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:252
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:384
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:485
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