foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
database_cfg.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file database_cfg.c
44  * @author foxBMS Team
45  * @date 2015-08-18 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup ENGINE_CONFIGURATION
49  * @prefix DATA
50  *
51  * @brief Database configuration
52  *
53  * @details Configuration of database module
54  *
55  */
56 
57 /*========== Includes =======================================================*/
58 #include "database_cfg.h"
59 
60 #include <stdint.h>
61 
62 /*========== Macros and Definitions =========================================*/
63 
64 /*========== Static Constant and Variable Definitions =======================*/
65 
66 /*========== Extern Constant and Variable Definitions =======================*/
67 
68 /** data block: cell voltage */
69 /**@{*/
74 /**@}*/
75 
76 /** data block: cell temperature */
77 /**@{*/
83 /**@}*/
84 
85 /** data block: minimum and maximum values */
87 
88 /** data block: current sensor */
90 
91 /** data block: balancing control */
93 
94 /** data block: slave control */
96 
97 /** data block: balancing feedback */
98 /**@{*/
103 /**@}*/
104 
105 /** data block: user mux */
107 
108 /** data block: open wire check */
109 /**@{*/
112 /**@}*/
113 
114 /** data block: LTC GPIO voltage */
115 /**@{*/
120 /**@}*/
121 
122 /** data block: error flags */
124 
125 /** data block: contactor feedback */
128 
129 /** data block: interlock feedback */
132 
133 /** data block: sof */
135 
136 /** data block: system state */
138 
139 /** data block: maximum safety limit violations */
141 
142 /** data block: recommended safety limit violations */
144 
145 /** data block: maximum operating limit violations */
147 
148 /** data block: soc */
150 
151 /** data block: soh */
153 
154 /** data block: soe */
156 
157 /** data block: can state request */
159 
160 /** data block: moving average */
162 
163 /** data block: insulation monitoring */
166 
167 /** data block: pack values */
169 
170 /** data block: adc temperature */
172 
173 /** data block: I2C humidity/temperature sensor measurements */
175 
176 /** data block: used for self-test */
179 
180 /** data block: aerosol sensor */
182 
183 /**
184  * @brief channel configuration of database (data blocks)
185  * @details all data block managed by database are listed here (address, size,
186  * consistency type)
187  */
189  {(void *)(&data_blockCellVoltage), sizeof(DATA_BLOCK_CELL_VOLTAGE_s)},
191  {(void *)(&data_blockMinMax), sizeof(DATA_BLOCK_MIN_MAX_s)},
196  {(void *)(&data_blockUserMux), sizeof(DATA_BLOCK_USER_MUX_s)},
197  {(void *)(&data_blockOpenWireBase), sizeof(DATA_BLOCK_OPEN_WIRE_s)},
199  {(void *)(&data_blockErrors), sizeof(DATA_BLOCK_ERROR_STATE_s)},
202  {(void *)(&data_blockSof), sizeof(DATA_BLOCK_SOF_s)},
203  {(void *)(&data_blockSystemstate), sizeof(DATA_BLOCK_SYSTEM_STATE_s)},
204  {(void *)(&data_blockMsl), sizeof(DATA_BLOCK_MSL_FLAG_s)},
205  {(void *)(&data_blockRsl), sizeof(DATA_BLOCK_RSL_FLAG_s)},
206  {(void *)(&data_blockMol), sizeof(DATA_BLOCK_MOL_FLAG_s)},
207  {(void *)(&data_blockSoc), sizeof(DATA_BLOCK_SOC_s)},
208  {(void *)(&data_blockSoh), sizeof(DATA_BLOCK_SOH_s)},
209  {(void *)(&data_blockSoe), sizeof(DATA_BLOCK_SOE_s)},
220  {(void *)(&data_blockPackValues), sizeof(DATA_BLOCK_PACK_VALUES_s)},
221  {(void *)(&data_blockAdcVoltage), sizeof(DATA_BLOCK_ADC_VOLTAGE_s)},
225 };
226 
227 /*========== Static Function Prototypes =====================================*/
228 
229 /*========== Static Function Implementations ================================*/
230 
231 /*========== Extern Function Implementations ================================*/
232 
233 /*========== Externalized Static Function Implementations (Unit Test) =======*/
234 #ifdef UNITY_UNIT_TEST
235 #endif
static DATA_BLOCK_BALANCING_CONTROL_s data_blockControlBalancing
Definition: database_cfg.c:92
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireRedundancy0
Definition: database_cfg.c:111
static DATA_BLOCK_MIN_MAX_s data_blockMinMax
Definition: database_cfg.c:86
static DATA_BLOCK_MOVING_AVERAGE_s data_blockMovingAverage
Definition: database_cfg.c:161
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltage
Definition: database_cfg.c:70
static DATA_BLOCK_MSL_FLAG_s data_blockMsl
Definition: database_cfg.c:140
static DATA_BLOCK_SOE_s data_blockSoe
Definition: database_cfg.c:155
static DATA_BLOCK_INTERLOCK_FEEDBACK_s data_blockInterlockFeedback
Definition: database_cfg.c:130
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageBase
Definition: database_cfg.c:71
static DATA_BLOCK_DUMMY_FOR_SELF_TEST_s data_blockDummyForSelfTest
Definition: database_cfg.c:177
static DATA_BLOCK_INSULATION_MONITORING_s data_blockInsulationMonitoring
Definition: database_cfg.c:164
static DATA_BLOCK_HTSEN_s data_blockHumidityTemperatureSensor
Definition: database_cfg.c:174
DATA_BASE_s data_database[]
channel configuration of database (data blocks)
Definition: database_cfg.c:188
static DATA_BLOCK_SLAVE_CONTROL_s data_blockSlaveControl
Definition: database_cfg.c:95
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageRedundancy0
Definition: database_cfg.c:72
static DATA_BLOCK_AEROSOL_SENSOR_s data_blockAerosolSensor
Definition: database_cfg.c:181
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireBase
Definition: database_cfg.c:110
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesRedundancy0
Definition: database_cfg.c:118
static DATA_BLOCK_ADC_VOLTAGE_s data_blockAdcVoltage
Definition: database_cfg.c:171
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureBase
Definition: database_cfg.c:79
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesBase
Definition: database_cfg.c:116
static DATA_BLOCK_CURRENT_SENSOR_s data_blockCurrentSensor
Definition: database_cfg.c:89
static DATA_BLOCK_PACK_VALUES_s data_blockPackValues
Definition: database_cfg.c:168
static DATA_BLOCK_USER_MUX_s data_blockUserMux
Definition: database_cfg.c:106
static DATA_BLOCK_SOF_s data_blockSof
Definition: database_cfg.c:134
static DATA_BLOCK_SOC_s data_blockSoc
Definition: database_cfg.c:149
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperature
Definition: database_cfg.c:78
static DATA_BLOCK_MOL_FLAG_s data_blockMol
Definition: database_cfg.c:146
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureRedundancy0
Definition: database_cfg.c:81
static DATA_BLOCK_RSL_FLAG_s data_blockRsl
Definition: database_cfg.c:143
static DATA_BLOCK_STATE_REQUEST_s data_blockStaterequest
Definition: database_cfg.c:158
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingBase
Definition: database_cfg.c:99
static DATA_BLOCK_ERROR_STATE_s data_blockErrors
Definition: database_cfg.c:123
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingRedundancy0
Definition: database_cfg.c:101
static DATA_BLOCK_CONTACTOR_FEEDBACK_s data_blockContactorFeedback
Definition: database_cfg.c:126
static DATA_BLOCK_SYSTEM_STATE_s data_blockSystemstate
Definition: database_cfg.c:137
static DATA_BLOCK_SOH_s data_blockSoh
Definition: database_cfg.c:152
Database configuration header.
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_OPEN_WIRE_REDUNDANCY0
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
Definition: database_cfg.h:98
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:99
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_REDUNDANCY0
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_USER_MUX
Definition: database_cfg.h:114
@ DATA_BLOCK_ID_SOE
Definition: database_cfg.h:109
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:94
@ DATA_BLOCK_ID_ERROR_STATE
Definition: database_cfg.h:95
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:106
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:97
@ DATA_BLOCK_ID_SYSTEM_STATE
Definition: database_cfg.h:113
@ DATA_BLOCK_ID_STATE_REQUEST
Definition: database_cfg.h:112
@ DATA_BLOCK_ID_CELL_VOLTAGE
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_MOVING_AVERAGE
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
Definition: database_cfg.h:88
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:93
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_SLAVE_CONTROL
Definition: database_cfg.h:107
@ DATA_BLOCK_ID_CONTACTOR_FEEDBACK
Definition: database_cfg.h:92
@ DATA_BLOCK_ID_SOF
Definition: database_cfg.h:110
@ DATA_BLOCK_ID_ADC_VOLTAGE
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_MSL_FLAG
Definition: database_cfg.h:102
@ DATA_BLOCK_ID_HTSEN
Definition: database_cfg.h:96
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:105
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
Definition: database_cfg.h:84
@ DATA_BLOCK_ID_SOH
Definition: database_cfg.h:111
@ DATA_BLOCK_ID_MOL_FLAG
Definition: database_cfg.h:100
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_REDUNDANCY0
Definition: database_cfg.h:85
@ DATA_BLOCK_ID_CELL_TEMPERATURE
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_SOC
Definition: database_cfg.h:108
@ DATA_BLOCK_ID_AEROSOL_SENSOR
Definition: database_cfg.h:80
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:616
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:635
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:323
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:255
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:290
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:153
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:135
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:405
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:219
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:337
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:125
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:606
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:414
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:167
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:497
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:565
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:455
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:310
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:195
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:477
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:271
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:517
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:539
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:427
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:528
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:553
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:446
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:300