foxBMS - Unit Tests  1.5.0
The foxBMS Unit Tests 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-02-03 (date of last update)
47  * @version v1.5.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: sox */
150 
151 /** data block: can state request */
153 
154 /** data block: moving average */
156 
157 /** data block: insulation monitoring */
160 
161 /** data block: pack values */
163 
164 /** data block: adc temperature */
166 
167 /** data block: I2C humidity/temperature sensor measurements */
169 
170 /** data block: used for self-test */
173 
174 /**
175  * @brief channel configuration of database (data blocks)
176  * @details all data block managed by database are listed here (address, size,
177  * consistency type)
178  */
180  {(void *)(&data_blockCellVoltage), sizeof(DATA_BLOCK_CELL_VOLTAGE_s)},
182  {(void *)(&data_blockMinMax), sizeof(DATA_BLOCK_MIN_MAX_s)},
187  {(void *)(&data_blockUserMux), sizeof(DATA_BLOCK_USER_MUX_s)},
188  {(void *)(&data_blockOpenWireBase), sizeof(DATA_BLOCK_OPEN_WIRE_s)},
190  {(void *)(&data_blockErrors), sizeof(DATA_BLOCK_ERROR_STATE_s)},
193  {(void *)(&data_blockSof), sizeof(DATA_BLOCK_SOF_s)},
194  {(void *)(&data_blockSystemstate), sizeof(DATA_BLOCK_SYSTEM_STATE_s)},
195  {(void *)(&data_blockMsl), sizeof(DATA_BLOCK_MSL_FLAG_s)},
196  {(void *)(&data_blockRsl), sizeof(DATA_BLOCK_RSL_FLAG_s)},
197  {(void *)(&data_blockMol), sizeof(DATA_BLOCK_MOL_FLAG_s)},
198  {(void *)(&data_blockSox), sizeof(DATA_BLOCK_SOX_s)},
209  {(void *)(&data_blockPackValues), sizeof(DATA_BLOCK_PACK_VALUES_s)},
210  {(void *)(&data_blockAdcVoltage), sizeof(DATA_BLOCK_ADC_VOLTAGE_s)},
213 };
214 
215 /*========== Static Function Prototypes =====================================*/
216 
217 /*========== Static Function Implementations ================================*/
218 
219 /*========== Extern Function Implementations ================================*/
220 
221 /*========== Externalized Static Function Implementations (Unit Test) =======*/
222 #ifdef UNITY_UNIT_TEST
223 #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:155
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_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:171
static DATA_BLOCK_INSULATION_MONITORING_s data_blockInsulationMonitoring
Definition: database_cfg.c:158
static DATA_BLOCK_HTSEN_s data_blockHumidityTemperatureSensor
Definition: database_cfg.c:168
DATA_BASE_s data_database[]
channel configuration of database (data blocks)
Definition: database_cfg.c:179
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_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:165
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:162
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_CELL_TEMPERATURE_s data_blockCellTemperature
Definition: database_cfg.c:78
static DATA_BLOCK_SOX_s data_blockSox
Definition: database_cfg.c:149
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:152
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
Database configuration header.
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
Definition: database_cfg.h:102
@ DATA_BLOCK_ID_OPEN_WIRE_REDUNDANCY0
Definition: database_cfg.h:106
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_REDUNDANCY0
Definition: database_cfg.h:105
@ DATA_BLOCK_ID_USER_MUX
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_SOX
Definition: database_cfg.h:97
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:111
@ DATA_BLOCK_ID_ERROR_STATE
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:95
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:107
@ DATA_BLOCK_ID_SYSTEM_STATE
Definition: database_cfg.h:93
@ DATA_BLOCK_ID_STATE_REQUEST
Definition: database_cfg.h:98
@ DATA_BLOCK_ID_CELL_VOLTAGE
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_MOVING_AVERAGE
Definition: database_cfg.h:99
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_SLAVE_CONTROL
Definition: database_cfg.h:84
@ DATA_BLOCK_ID_CONTACTOR_FEEDBACK
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_SOF
Definition: database_cfg.h:92
@ DATA_BLOCK_ID_ADC_VOLTAGE
Definition: database_cfg.h:110
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:100
@ DATA_BLOCK_ID_MSL_FLAG
Definition: database_cfg.h:94
@ DATA_BLOCK_ID_HTSEN
Definition: database_cfg.h:109
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:88
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:108
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
Definition: database_cfg.h:85
@ DATA_BLOCK_ID_MOL_FLAG
Definition: database_cfg.h:96
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_REDUNDANCY0
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_CELL_TEMPERATURE
Definition: database_cfg.h:80
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:593
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:318
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:250
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:285
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:149
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:132
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:398
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:214
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:332
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:122
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:583
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:407
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:162
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:490
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:542
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:448
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:305
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:190
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:470
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:266
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:420
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:510
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:530
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:439
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:295