foxBMS - Unit Tests  1.3.0
The foxBMS Unit Tests API Documentation
database_cfg.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2022, 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 2022-05-30 (date of last update)
47  * @version v1.3.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 /*========== Macros and Definitions =========================================*/
61 
62 /*========== Static Constant and Variable Definitions =======================*/
63 
64 /*========== Extern Constant and Variable Definitions =======================*/
65 
66 /** data block: cell voltage */
67 /**@{*/
72 /**@}*/
73 
74 /** data block: cell temperature */
75 /**@{*/
81 /**@}*/
82 
83 /** data block: minimum and maximum values */
85 
86 /** data block: current sensor */
88 
89 /** data block: balancing control */
91 
92 /** data block: slave control */
94 
95 /** data block: balancing feedback */
96 /**@{*/
101 /**@}*/
102 
103 /** data block: user mux */
105 
106 /** data block: open wire check */
107 /**@{*/
110 /**@}*/
111 
112 /** data block: LTC GPIO voltage */
113 /**@{*/
118 /**@}*/
119 
120 /** data block: error flags */
122 
123 /** data block: contactor feedback */
126 
127 /** data block: interlock feedback */
130 
131 /** data block: sof */
133 
134 /** data block: system state */
136 
137 /** data block: maximum safety limit violations */
139 
140 /** data block: recommended safety limit violations */
142 
143 /** data block: maximum operating limit violations */
145 
146 /** data block: sox */
148 
149 /** data block: can state request */
151 
152 /** data block: moving average */
154 
155 /** data block: insulation monitoring */
158 
159 /** data block: pack values */
161 
162 /** data block: adc temperature */
164 
165 /** data block: I2C humidity/temperature sensor measurements*/
167 
168 /** data block: used for self-test */
171 
172 /**
173  * @brief channel configuration of database (data blocks)
174  * @details all data block managed by database are listed here (address, size,
175  * consistency type)
176  */
178  {(void *)(&data_blockCellVoltage), sizeof(DATA_BLOCK_CELL_VOLTAGE_s)},
180  {(void *)(&data_blockMinMax), sizeof(DATA_BLOCK_MIN_MAX_s)},
185  {(void *)(&data_blockUserMux), sizeof(DATA_BLOCK_USER_MUX_s)},
186  {(void *)(&data_blockOpenWireBase), sizeof(DATA_BLOCK_OPEN_WIRE_s)},
188  {(void *)(&data_blockErrors), sizeof(DATA_BLOCK_ERRORSTATE_s)},
191  {(void *)(&data_blockSof), sizeof(DATA_BLOCK_SOF_s)},
192  {(void *)(&data_blockSystemstate), sizeof(DATA_BLOCK_SYSTEMSTATE_s)},
193  {(void *)(&data_blockMsl), sizeof(DATA_BLOCK_MSL_FLAG_s)},
194  {(void *)(&data_blockRsl), sizeof(DATA_BLOCK_RSL_FLAG_s)},
195  {(void *)(&data_blockMol), sizeof(DATA_BLOCK_MOL_FLAG_s)},
196  {(void *)(&data_blockSox), sizeof(DATA_BLOCK_SOX_s)},
207  {(void *)(&data_blockPackValues), sizeof(DATA_BLOCK_PACK_VALUES_s)},
208  {(void *)(&data_blockAdcVoltage), sizeof(DATA_BLOCK_ADC_VOLTAGE_s)},
211 };
212 
213 /*========== Static Function Prototypes =====================================*/
214 
215 /*========== Static Function Implementations ================================*/
216 
217 /*========== Extern Function Implementations ================================*/
218 
219 /*========== Externalized Static Function Implementations (Unit Test) =======*/
static DATA_BLOCK_BALANCING_CONTROL_s data_blockControlBalancing
Definition: database_cfg.c:90
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireRedundancy0
Definition: database_cfg.c:109
static DATA_BLOCK_MIN_MAX_s data_blockMinMax
Definition: database_cfg.c:84
static DATA_BLOCK_MOVING_AVERAGE_s data_blockMovingAverage
Definition: database_cfg.c:153
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltage
Definition: database_cfg.c:68
static DATA_BLOCK_MSL_FLAG_s data_blockMsl
Definition: database_cfg.c:138
static DATA_BLOCK_INTERLOCK_FEEDBACK_s data_blockInterlockFeedback
Definition: database_cfg.c:128
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageBase
Definition: database_cfg.c:69
static DATA_BLOCK_DUMMY_FOR_SELF_TEST_s data_blockDummyForSelfTest
Definition: database_cfg.c:169
static DATA_BLOCK_INSULATION_MONITORING_s data_blockInsulationMonitoring
Definition: database_cfg.c:156
static DATA_BLOCK_HTSEN_s data_blockHumidityTemperatureSensor
Definition: database_cfg.c:166
DATA_BASE_s data_database[]
channel configuration of database (data blocks)
Definition: database_cfg.c:177
static DATA_BLOCK_SLAVE_CONTROL_s data_blockSlaveControl
Definition: database_cfg.c:93
static DATA_BLOCK_SYSTEMSTATE_s data_blockSystemstate
Definition: database_cfg.c:135
static DATA_BLOCK_STATEREQUEST_s data_blockStaterequest
Definition: database_cfg.c:150
static DATA_BLOCK_CELL_VOLTAGE_s data_blockCellVoltageRedundancy0
Definition: database_cfg.c:70
static DATA_BLOCK_OPEN_WIRE_s data_blockOpenWireBase
Definition: database_cfg.c:108
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesRedundancy0
Definition: database_cfg.c:116
static DATA_BLOCK_ADC_VOLTAGE_s data_blockAdcVoltage
Definition: database_cfg.c:163
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureBase
Definition: database_cfg.c:77
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s data_blockLtcAllGpioVoltagesBase
Definition: database_cfg.c:114
static DATA_BLOCK_CURRENT_SENSOR_s data_blockCurrentSensor
Definition: database_cfg.c:87
static DATA_BLOCK_PACK_VALUES_s data_blockPackValues
Definition: database_cfg.c:160
static DATA_BLOCK_USER_MUX_s data_blockUserMux
Definition: database_cfg.c:104
static DATA_BLOCK_SOF_s data_blockSof
Definition: database_cfg.c:132
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperature
Definition: database_cfg.c:76
static DATA_BLOCK_SOX_s data_blockSox
Definition: database_cfg.c:147
static DATA_BLOCK_MOL_FLAG_s data_blockMol
Definition: database_cfg.c:144
static DATA_BLOCK_CELL_TEMPERATURE_s data_blockCellTemperatureRedundancy0
Definition: database_cfg.c:79
static DATA_BLOCK_RSL_FLAG_s data_blockRsl
Definition: database_cfg.c:141
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingBase
Definition: database_cfg.c:97
static DATA_BLOCK_BALANCING_FEEDBACK_s data_blockFeedbackBalancingRedundancy0
Definition: database_cfg.c:99
static DATA_BLOCK_ERRORSTATE_s data_blockErrors
Definition: database_cfg.c:121
static DATA_BLOCK_CONTACTOR_FEEDBACK_s data_blockContactorFeedback
Definition: database_cfg.c:124
Database configuration header.
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
Definition: database_cfg.h:99
@ DATA_BLOCK_ID_OPEN_WIRE_REDUNDANCY0
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_INTERLOCK_FEEDBACK
Definition: database_cfg.h:88
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:80
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:78
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_REDUNDANCY0
Definition: database_cfg.h:102
@ DATA_BLOCK_ID_USER_MUX
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_SOX
Definition: database_cfg.h:94
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:108
@ DATA_BLOCK_ID_RSL_FLAG
Definition: database_cfg.h:92
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:104
@ DATA_BLOCK_ID_CELL_VOLTAGE
Definition: database_cfg.h:76
@ DATA_BLOCK_ID_MOVING_AVERAGE
Definition: database_cfg.h:96
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
Definition: database_cfg.h:100
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:98
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_SYSTEMSTATE
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:84
@ DATA_BLOCK_ID_SLAVE_CONTROL
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_CONTACTOR_FEEDBACK
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_SOF
Definition: database_cfg.h:89
@ DATA_BLOCK_ID_ADC_VOLTAGE
Definition: database_cfg.h:107
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:97
@ DATA_BLOCK_ID_MSL_FLAG
Definition: database_cfg.h:91
@ DATA_BLOCK_ID_ERRORSTATE
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_HTSEN
Definition: database_cfg.h:106
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:85
@ DATA_BLOCK_ID_PACK_VALUES
Definition: database_cfg.h:105
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
Definition: database_cfg.h:82
@ DATA_BLOCK_ID_MOL_FLAG
Definition: database_cfg.h:93
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_REDUNDANCY0
Definition: database_cfg.h:101
@ DATA_BLOCK_ID_CELL_TEMPERATURE
Definition: database_cfg.h:77
@ DATA_BLOCK_ID_STATEREQUEST
Definition: database_cfg.h:95
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:595
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:315
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:247
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:282
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:146
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:129
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:389
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:211
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:329
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:119
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:585
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:398
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:159
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:492
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:544
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:450
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:302
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:187
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:472
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:263
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:411
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:512
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:532
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:441
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:292