foxBMS - Unit Tests  1.3.0
The foxBMS Unit Tests API Documentation
diag_cfg.h
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 diag_cfg.h
44  * @author foxBMS Team
45  * @date 2019-11-28 (date of creation)
46  * @updated 2022-05-30 (date of last update)
47  * @version v1.3.0
48  * @ingroup ENGINE_CONFIGURATION
49  * @prefix DIAG
50  *
51  * @brief Diagnostic module configuration header
52  * @details In this header filer are the different diagnosis channel defines
53  * assigned to different diagnosis IDs. Furthermore are the diagnosis
54  * error log settings be configured here.
55  */
56 
57 #ifndef FOXBMS__DIAG_CFG_H_
58 #define FOXBMS__DIAG_CFG_H_
59 
60 /*========== Includes =======================================================*/
61 #include "general.h"
62 
63 #include "battery_system_cfg.h"
64 #include "database_cfg.h"
65 
66 /*========== Macros and Definitions =========================================*/
67 #define DIAG_ERROR_SENSITIVITY_FIRST_EVENT (0) /*!< logging at first event */
68 #define DIAG_ERROR_SENSITIVITY_THIRD_EVENT (2) /*!< logging at third event */
69 #define DIAG_ERROR_SENSITIVITY_FIFTH_EVENT (4) /*!< logging at fifth event */
70 #define DIAG_ERROR_SENSITIVITY_TENTH_EVENT (9) /*!< logging at tenth event */
71 
72 #define DIAG_ERROR_SENSITIVITY_HIGH (0) /*!< logging at first event */
73 #define DIAG_ERROR_SENSITIVITY_MID (5) /*!< logging at fifth event */
74 #define DIAG_ERROR_SENSITIVITY_LOW (10) /*!< logging at tenth event */
75 
76 #define DIAG_ERROR_INTERLOCK_SENSITIVITY (10) /*!< logging level of interlock */
77 
78 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_MSL (500) /*!< MSL level for event occurrence if over/under voltage event */
79 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_RSL (500) /*!< RSL level for event occurrence if over/under voltage event */
80 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_MOL (500) /*!< MOL level for event occurrence if over/under voltage event */
81 
82 /** MSL level for event occurrence if over/under temperature event */
83 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MSL (500)
84 /** RSL level for event occurrence if over/under temperature event */
85 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_RSL (500)
86 /** MOL level for event occurrence if over/under temperature event */
87 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MOL (500)
88 
89 /** MSL level for event occurrence if over/under current event */
90 #define DIAG_ERROR_CURRENT_SENSITIVITY_MSL (500)
91 /** RSL level for event occurrence if over/under current event */
92 #define DIAG_ERROR_CURRENT_SENSITIVITY_RSL (500)
93 /** MOL level for event occurrence if over/under current event */
94 #define DIAG_ERROR_CURRENT_SENSITIVITY_MOL (500)
95 
96 #define DIAG_ERROR_LTC_PEC_SENSITIVITY (5) /*!< logging level of LTC PEC errors */
97 #define DIAG_ERROR_LTC_MUX_SENSITIVITY (5) /*!< logging level of LTC MUX errors */
98 #define DIAG_ERROR_LTC_SPI_SENSITIVITY (5) /*!< logging level of LTC SPI errors */
99 
100 #define DIAG_ERROR_CAN_TIMING_SENSITIVITY (100) /*!< logging level of CAN timing errors */
101 #define DIAG_ERROR_CAN_TIMING_CC_SENSITIVITY (100) /*!< logging level of CAN timing errors on the current sensor */
102 #define DIAG_ERROR_CAN_SENSOR_SENSITIVITY (100) /*!< logging level of CAN errors on the current sensor */
103 
104 /** logging level of errors connected with the contactor feedback */
105 #define DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY (20)
106 
107 /** define if delay in #DIAG_ID_CFG_s is discarded because of severity level */
108 #define DIAG_DELAY_DISCARDED (UINT32_MAX)
109 /** no delay after error is detected, open contactors instantaneous */
110 #define DIAG_NO_DELAY (0u)
111 /** delay for interlock error */
112 #define DIAG_DELAY_INTERLOCK_ms (100u)
113 /** delay for overvoltage errors */
114 #define DIAG_DELAY_OVERVOLTAGE_ms (200u)
115 /** delay for undervoltage errors */
116 #define DIAG_DELAY_UNDERVOLTAGE_ms (200u)
117 /** delay for temperature errors */
118 #define DIAG_DELAY_TEMPERATURE_ms (1000u)
119 /** delay for overcurrent errors */
120 #define DIAG_DELAY_OVERCURRENT_ms (100u)
121 /** delay for AFE related errors */
122 #define DIAG_DELAY_AFE_ms (100u)
123 /** delay for can timing error */
124 #define DIAG_DELAY_CAN_TIMING_ms (200u)
125 /** delay for energy counting/coulomb counting timing error */
126 #define DIAG_DELAY_EC_CC_TIMING_ms (2000u)
127 /** delay for current sensor response error */
128 #define DIAG_DELAY_CURRENT_SENSOR_ms (200u)
129 /** delay for SBC related errors */
130 #define DIAG_DELAY_SBC_ms (100u)
131 /** delay for pack voltage plausibility error */
132 #define DIAG_DELAY_PL_PACK_VOLTAGE_ms (100u)
133 /** delay for contactor feedback errors */
134 #define DIAG_DELAY_CONTACTOR_FEEDBACK_ms (100u)
135 /** delay for deep-discharge error */
136 #define DIAG_DELAY_DEEP_DISCHARGE_ms (100u)
137 /** delay redundancy measurement timeout errors */
138 #define DIAG_DELAY_REDUNDANCY_MEAS_TIMEOUT_ms (100u)
139 /** delay redundancy measurement errors */
140 #define DIAG_DELAY_REDUNDANCY_MEAS_ERROR_ms (100u)
141 
142 /** Maximum number of the same errors that are logged */
143 #define DIAG_MAX_ENTRIES_OF_ERROR (5)
144 
145 /** composite type for storing and passing on the local database table handles */
146 typedef struct {
147  DATA_BLOCK_ERRORSTATE_s *pTableError; /*!< database table with errorstates */
148  DATA_BLOCK_MOL_FLAG_s *pTableMol; /*!< database table with MOL flags */
149  DATA_BLOCK_RSL_FLAG_s *pTableRsl; /*!< database table with RSL flags */
150  DATA_BLOCK_MSL_FLAG_s *pTableMsl; /*!< database table with MSL flags */
152 
153 /** variable for storing and passing on the local database table handles */
155 
156 /** list of diag IDs */
157 typedef enum {
158  DIAG_ID_FLASHCHECKSUM, /*!< the checksum of the flashed software could not be validated */
159  DIAG_ID_SYSTEMMONITORING, /*!< the system monitoring module has detected a deviation from task timing limits */
160  DIAG_ID_CONFIGASSERT, /*!< TODO */
161  DIAG_ID_AFE_SPI, /*!< issues with the SPI communication of the AFE */
162  DIAG_ID_AFE_COM_INTEGRITY, /*!< error on the communication integrity of the AFE, e.g. PEC error for LTC */
163  DIAG_ID_AFE_MUX, /*!< the multiplexer that is connected to the AFE does not react in an expected way */
164  DIAG_ID_AFE_CONFIG, /*!< the AFE driver has recognized a configuration error */
165  DIAG_ID_CAN_TIMING, /*!< the BMS does not receive CAN messages or they are not inside the excpected timing constraints */
166  DIAG_ID_CAN_RX_QUEUE_FULL, /*!< the reception queue of the driver is full; no new messages can be received */
167  DIAG_ID_CAN_CC_RESPONDING, /*!< current counter measurements on the CAN bus are missing or not inside expected timing constraints */
168  DIAG_ID_CAN_EC_RESPONDING, /*!< energy counter measurements on the CAN bus are missing or not inside expected timing constraints */
169  DIAG_ID_CURRENT_SENSOR_RESPONDING, /*!< current sensor measurements on the CAN bus are missing or not inside expected timing constraints */
170  DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE, /*!< redundant measurement of the cell voltages has returned implausible values */
171  DIAG_ID_AFE_CELL_VOLTAGE_MEAS_ERROR, /*!< the AFE driver has determined a cell voltage measurement to be implausible */
172  DIAG_ID_AFE_CELL_TEMPERATURE_MEAS_ERROR, /*!< the AFE driver has determined a cell temperature measurement to be implausible */
173  DIAG_ID_PLAUSIBILITY_CELL_TEMP, /*!< redundant measurement of the cell temperatures has returned implausible values */
174  DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE_SPREAD, /*!< the spread (difference between min and max values) of the cell voltages is implausibly high */
175  DIAG_ID_PLAUSIBILITY_CELL_TEMPERATURE_SPREAD, /*!< the spread (difference between min and max values) of the cell temperatures is implausibly high */
176  DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_MSL, /*!< Cell voltage limits violated */
177  DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_RSL, /*!< Cell voltage limits violated */
178  DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_MOL, /*!< Cell voltage limits violated */
179  DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_MSL, /*!< Cell voltage limits violated */
180  DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_RSL, /*!< Cell voltage limits violated */
181  DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_MOL, /*!< Cell voltage limits violated */
182  DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MSL, /*!< Temperature limits violated */
183  DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_RSL, /*!< Temperature limits violated */
184  DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MOL, /*!< Temperature limits violated */
185  DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MSL, /*!< Temperature limits violated */
186  DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_RSL, /*!< Temperature limits violated */
187  DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MOL, /*!< Temperature limits violated */
188  DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MSL, /*!< Temperature limits violated */
189  DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_RSL, /*!< Temperature limits violated */
190  DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MOL, /*!< Temperature limits violated */
191  DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MSL, /*!< Temperature limits violated */
192  DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_RSL, /*!< Temperature limits violated */
193  DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MOL, /*!< Temperature limits violated */
194  DIAG_ID_OVERCURRENT_CHARGE_CELL_MSL, /*!< Overcurrent on cell-level */
195  DIAG_ID_OVERCURRENT_CHARGE_CELL_RSL, /*!< Overcurrent on cell-level */
196  DIAG_ID_OVERCURRENT_CHARGE_CELL_MOL, /*!< Overcurrent on cell-level */
197  DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MSL, /*!< Overcurrent on cell-level */
198  DIAG_ID_OVERCURRENT_DISCHARGE_CELL_RSL, /*!< Overcurrent on cell-level */
199  DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MOL, /*!< Overcurrent on cell-level */
200  DIAG_ID_STRING_OVERCURRENT_CHARGE_MSL, /*!< Overcurrent on string-level */
201  DIAG_ID_STRING_OVERCURRENT_CHARGE_RSL, /*!< Overcurrent on string-level */
202  DIAG_ID_STRING_OVERCURRENT_CHARGE_MOL, /*!< Overcurrent on string-level */
203  DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MSL, /*!< Overcurrent on string-level */
204  DIAG_ID_STRING_OVERCURRENT_DISCHARGE_RSL, /*!< Overcurrent on string-level */
205  DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MOL, /*!< Overcurrent on string-level */
206  DIAG_ID_PACK_OVERCURRENT_CHARGE_MSL, /*!< Overcurrent on string-level */
207  DIAG_ID_PACK_OVERCURRENT_DISCHARGE_MSL, /*!< Overcurrent on pack-level */
208  DIAG_ID_CURRENT_ON_OPEN_STRING, /*!< Current flowing on open string */
209  DIAG_ID_DEEP_DISCHARGE_DETECTED, /*!< the deep discharge flag has been set in persistent memory */
210  DIAG_ID_AFE_OPEN_WIRE, /*!< an open (broken) sense wire has been detected on the battery cell measurement */
211  DIAG_ID_PLAUSIBILITY_PACK_VOLTAGE, /*!< the plausibility module has decided that the pack voltage is implausible */
212  DIAG_ID_INTERLOCK_FEEDBACK, /*!< the interlock feedback indicates it to be open (but it is expected to be closed) */
213  DIAG_ID_STRING_CONTACTOR_FEEDBACK, /*!< the feedback on a string contactor does not match the expected value */
214  DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK, /*!< the feedback on a precharge contactor does not match the expected value */
215  DIAG_ID_SBC_FIN_STATE, /*!< the state of the FIN signal in the SBC is not ok */
216  DIAG_ID_SBC_RSTB_STATE, /*!< an activation of the RSTB pin of the SBC has been detected */
217  DIAG_ID_BASE_CELL_VOLTAGE_MESUREMENT_TIMEOUT, /*!< the redundancy module has detected that the base cell voltage measurements are missing */
218  DIAG_ID_REDUNDANCY0_CELL_VOLTAGE_MESUREMENT_TIMEOUT, /*!< the redundancy module has detected that the redundancy0 cell voltage measurements are missing */
219  DIAG_ID_BASE_CELL_TEMPERATURE_MESUREMENT_TIMEOUT, /*!< the redundancy module has detected that the base cell temperature measurements are missing */
220  DIAG_ID_REDUNDANCY0_CELL_TEMPERATURE_MESUREMENT_TIMEOUT, /*!< the redundancy module has detected that the redundancy0 temperature measurements are missing */
221  DIAG_ID_CURRENT_MEASUREMENT_TIMEOUT, /*!< the redundancy module has detected that the current measurement on a string is not updated */
222  DIAG_ID_CURRENT_MEASUREMENT_ERROR, /*!< the redundancy module has detected a current measurement to be invalid */
223  DIAG_ID_CURRENT_SENSOR_V1_MEASUREMENT_TIMEOUT, /*!< the redundancy module has detected that the voltage 1 measurement of a current sensor is not updated */
224  DIAG_ID_CURRENT_SENSOR_V3_MEASUREMENT_TIMEOUT, /*!< the redundancy module has detected that the voltage 3 measurement of a current sensor is not updated */
225  DIAG_ID_CURRENT_SENSOR_POWER_MEASUREMENT_TIMEOUT, /*!< the redundancy module has detected that the power measurement of a current sensor is not updated */
226  DIAG_ID_POWER_MEASUREMENT_ERROR, /*!< the redundancy module has detected a power measurement to be invalid */
227  DIAG_ID_INSULATION_MEASUREMENT_VALID, /*!< the insulation measurement is valid or invalid */
228  DIAG_ID_LOW_INSULATION_RESISTANCE_ERROR, /*!< a critical low insulation resistance has been measured */
229  DIAG_ID_LOW_INSULATION_RESISTANCE_WARNING, /*!< a warnable low insulation resistance has been measured */
230  DIAG_ID_INSULATION_GROUND_ERROR, /*!< insulation monitoring has detected a ground error */
231  DIAG_ID_I2C_PEX_ERROR, /*!< general error with the port expanders */
232  DIAG_ID_FRAM_READ_CRC_ERROR, /*!< CRC does not match when reading from the FRAM */
233  DIAG_ID_MAX, /*!< MAX indicator - do not change */
234 } DIAG_ID_e;
235 
236 /** diagnosis check result (event) */
237 typedef enum {
238  DIAG_EVENT_OK, /**< diag channel event OK */
239  DIAG_EVENT_NOT_OK, /**< diag channel event NOK */
240  DIAG_EVENT_RESET, /**< reset diag channel eventcounter to 0 */
241 } DIAG_EVENT_e;
242 
243 /** enable or disable the diagnosis handling for an event */
244 typedef enum {
245  DIAG_EVALUATION_ENABLED, /**< enables evaluation of diagnosis handling */
246  DIAG_EVALUATION_DISABLED, /**< disables evaluation of diagnosis handling */
248 
249 /** impact level of diagnosis event, e.g., influences the event the whole system or only a string */
250 typedef enum {
251  DIAG_SYSTEM, /**< diag event impact is system related e.g., can timing */
252  DIAG_STRING, /**< diag event impact is string related e.g., overvoltage in string x */
254 
255 /**
256  * @def DIAG_CAN_TIMING
257  * @brief Value that is written into the field that describes whether CAN
258  * timing diag entries should be generated
259  */
260 #if CHECK_CAN_TIMING == true
261 #define DIAG_CAN_TIMING (DIAG_EVALUATION_ENABLED)
262 #else
263 #define DIAG_CAN_TIMING (DIAG_EVALUATION_DISABLED)
264 #endif
265 
266 /**
267  * @def DIAG_CAN_SENSOR_PRESENT
268  * @brief Value that is written into the field that describes whether current
269  * sensor diag entries should be generated if it is not present
270  */
271 #if CURRENT_SENSOR_PRESENT == true
272 #define DIAG_CAN_SENSOR_PRESENT (DIAG_EVALUATION_ENABLED)
273 #else /* CURRENT_SENSOR_PRESENT == true */
274 #define DIAG_CAN_SENSOR_PRESENT (DIAG_EVALUATION_DISABLED)
275 #endif /* CURRENT_SENSOR_PRESENT */
276 
277 /** diagnosis severity level */
278 typedef enum {
279  DIAG_FATAL_ERROR, /*!< severity level fatal error */
280  DIAG_WARNING, /*!< severity level warning */
281  DIAG_INFO, /*!< severity level info */
283 
284 /** diagnosis recording activation */
285 typedef enum {
286  DIAG_RECORDING_ENABLED, /**< enable diagnosis event recording */
287  DIAG_RECORDING_DISABLED, /**< disable diagnosis event recording */
289 
290 /**
291  * @brief function type for diag callbacks
292  * @param[in] ch_id ID of diag entry
293  * @param[in] event #DIAG_EVENT_e
294  * @param[in] kpkDiagShim shim to the database entries
295  * @param[in] data data
296  */
298  DIAG_ID_e ch_id,
299  DIAG_EVENT_e event,
300  const DIAG_DATABASE_SHIM_s *const kpkDiagShim,
301  uint32_t data);
302 
303 /** Channel configuration of one diag channel */
304 typedef struct {
305  DIAG_ID_e id; /**< diagnosis event id diag_id */
306  uint16_t threshold; /**< threshold for number of events which will be
307  * tolerated before generating a notification in both directions:
308  * threshold = 0: reports the value at first occurrence,
309  * threshold = 1: reports the value at second occurrence */
311  severity; /**< severity of diag entry, #DIAG_FATAL_ERROR will lead to an opening of the contactors */
312  uint32_t
313  delay_ms; /**< delay in ms after error detection if severity is #DIAG_FATAL_ERROR until an opening the contactors */
314  DIAG_RECORDING_e enable_recording; /**< if enabled recording in diag_memory * will be activated */
315  DIAG_EVALUATE_e enable_evaluate; /**< if enabled diagnosis event will be evaluated */
316  DIAG_CALLBACK_FUNCTION_f *fpCallback; /**< will be called if
317  * number of events exceeds threshold in both
318  * directions with parameter DIAG_EVENT_e
319  * string id or system related data */
320 } DIAG_ID_CFG_s;
321 
322 /** struct for device Configuration of diag module */
323 typedef struct {
324  uint8_t nrOfConfiguredDiagnosisEntries; /*!< number of entries in DIAG_ID_CFG_s */
325  DIAG_ID_CFG_s *pConfigurationOfDiagnosisEntries; /*!< pointer to configuration array for all diagnosis entries */
326  uint16_t numberOfFatalErrors; /*!< number of configured diagnosis entries with severity #DIAG_FATAL_ERROR */
327  DIAG_ID_CFG_s *pFatalErrorLinkTable
328  [DIAG_ID_MAX]; /*!< list with pointers to all diagnosis entries with severity #DIAG_FATAL_ERROR */
329 } DIAG_DEV_s;
330 
331 /*========== Extern Constant and Variable Declarations ======================*/
332 /** diag device configuration struct */
333 extern DIAG_DEV_s diag_device;
335 
336 /*========== Extern Function Prototypes =====================================*/
337 /**
338  * @brief update function for diagnosis flags
339  * @details TODO
340  */
341 extern void DIAG_UpdateFlags(void);
342 
343 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
344 
345 #endif /* FOXBMS__DIAG_CFG_H_ */
Configuration of the battery system (e.g., number of battery modules, battery cells,...
Database configuration header.
DIAG_EVENT_e
Definition: diag_cfg.h:237
@ DIAG_EVENT_RESET
Definition: diag_cfg.h:240
@ DIAG_EVENT_NOT_OK
Definition: diag_cfg.h:239
@ DIAG_EVENT_OK
Definition: diag_cfg.h:238
void DIAG_CALLBACK_FUNCTION_f(DIAG_ID_e ch_id, DIAG_EVENT_e event, const DIAG_DATABASE_SHIM_s *const kpkDiagShim, uint32_t data)
function type for diag callbacks
Definition: diag_cfg.h:297
DIAG_IMPACT_LEVEL_e
Definition: diag_cfg.h:250
@ DIAG_SYSTEM
Definition: diag_cfg.h:251
@ DIAG_STRING
Definition: diag_cfg.h:252
DIAG_EVALUATE_e
Definition: diag_cfg.h:244
@ DIAG_EVALUATION_ENABLED
Definition: diag_cfg.h:245
@ DIAG_EVALUATION_DISABLED
Definition: diag_cfg.h:246
DIAG_SEVERITY_LEVEL_e
Definition: diag_cfg.h:278
@ DIAG_WARNING
Definition: diag_cfg.h:280
@ DIAG_INFO
Definition: diag_cfg.h:281
@ DIAG_FATAL_ERROR
Definition: diag_cfg.h:279
DIAG_ID_e
Definition: diag_cfg.h:157
@ DIAG_ID_AFE_MUX
Definition: diag_cfg.h:163
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MSL
Definition: diag_cfg.h:185
@ DIAG_ID_POWER_MEASUREMENT_ERROR
Definition: diag_cfg.h:226
@ DIAG_ID_PACK_OVERCURRENT_CHARGE_MSL
Definition: diag_cfg.h:206
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_RSL
Definition: diag_cfg.h:195
@ DIAG_ID_AFE_CELL_VOLTAGE_MEAS_ERROR
Definition: diag_cfg.h:171
@ DIAG_ID_CAN_CC_RESPONDING
Definition: diag_cfg.h:167
@ DIAG_ID_CURRENT_MEASUREMENT_TIMEOUT
Definition: diag_cfg.h:221
@ DIAG_ID_AFE_CELL_TEMPERATURE_MEAS_ERROR
Definition: diag_cfg.h:172
@ DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_RSL
Definition: diag_cfg.h:180
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MSL
Definition: diag_cfg.h:188
@ DIAG_ID_PLAUSIBILITY_CELL_TEMPERATURE_SPREAD
Definition: diag_cfg.h:175
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_RSL
Definition: diag_cfg.h:186
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MOL
Definition: diag_cfg.h:205
@ DIAG_ID_INSULATION_MEASUREMENT_VALID
Definition: diag_cfg.h:227
@ DIAG_ID_BASE_CELL_TEMPERATURE_MESUREMENT_TIMEOUT
Definition: diag_cfg.h:219
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_RSL
Definition: diag_cfg.h:204
@ DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE_SPREAD
Definition: diag_cfg.h:174
@ DIAG_ID_AFE_OPEN_WIRE
Definition: diag_cfg.h:210
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_RSL
Definition: diag_cfg.h:192
@ DIAG_ID_PLAUSIBILITY_PACK_VOLTAGE
Definition: diag_cfg.h:211
@ DIAG_ID_REDUNDANCY0_CELL_TEMPERATURE_MESUREMENT_TIMEOUT
Definition: diag_cfg.h:220
@ DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_MOL
Definition: diag_cfg.h:178
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_RSL
Definition: diag_cfg.h:201
@ DIAG_ID_I2C_PEX_ERROR
Definition: diag_cfg.h:231
@ DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE
Definition: diag_cfg.h:170
@ DIAG_ID_FLASHCHECKSUM
Definition: diag_cfg.h:158
@ DIAG_ID_PLAUSIBILITY_CELL_TEMP
Definition: diag_cfg.h:173
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MSL
Definition: diag_cfg.h:197
@ DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_RSL
Definition: diag_cfg.h:177
@ DIAG_ID_CONFIGASSERT
Definition: diag_cfg.h:160
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_RSL
Definition: diag_cfg.h:189
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MOL
Definition: diag_cfg.h:187
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_MSL
Definition: diag_cfg.h:200
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_MOL
Definition: diag_cfg.h:202
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MSL
Definition: diag_cfg.h:182
@ DIAG_ID_AFE_COM_INTEGRITY
Definition: diag_cfg.h:162
@ DIAG_ID_CURRENT_SENSOR_POWER_MEASUREMENT_TIMEOUT
Definition: diag_cfg.h:225
@ DIAG_ID_INSULATION_GROUND_ERROR
Definition: diag_cfg.h:230
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MOL
Definition: diag_cfg.h:184
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MOL
Definition: diag_cfg.h:190
@ DIAG_ID_FRAM_READ_CRC_ERROR
Definition: diag_cfg.h:232
@ DIAG_ID_STRING_CONTACTOR_FEEDBACK
Definition: diag_cfg.h:213
@ DIAG_ID_MAX
Definition: diag_cfg.h:233
@ DIAG_ID_SBC_RSTB_STATE
Definition: diag_cfg.h:216
@ DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK
Definition: diag_cfg.h:214
@ DIAG_ID_CAN_TIMING
Definition: diag_cfg.h:165
@ DIAG_ID_PACK_OVERCURRENT_DISCHARGE_MSL
Definition: diag_cfg.h:207
@ DIAG_ID_REDUNDANCY0_CELL_VOLTAGE_MESUREMENT_TIMEOUT
Definition: diag_cfg.h:218
@ DIAG_ID_CURRENT_SENSOR_V1_MEASUREMENT_TIMEOUT
Definition: diag_cfg.h:223
@ DIAG_ID_DEEP_DISCHARGE_DETECTED
Definition: diag_cfg.h:209
@ DIAG_ID_CURRENT_SENSOR_V3_MEASUREMENT_TIMEOUT
Definition: diag_cfg.h:224
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MOL
Definition: diag_cfg.h:193
@ DIAG_ID_BASE_CELL_VOLTAGE_MESUREMENT_TIMEOUT
Definition: diag_cfg.h:217
@ DIAG_ID_SBC_FIN_STATE
Definition: diag_cfg.h:215
@ DIAG_ID_LOW_INSULATION_RESISTANCE_ERROR
Definition: diag_cfg.h:228
@ DIAG_ID_CURRENT_ON_OPEN_STRING
Definition: diag_cfg.h:208
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MSL
Definition: diag_cfg.h:203
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_MSL
Definition: diag_cfg.h:194
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MOL
Definition: diag_cfg.h:199
@ DIAG_ID_CURRENT_SENSOR_RESPONDING
Definition: diag_cfg.h:169
@ DIAG_ID_CURRENT_MEASUREMENT_ERROR
Definition: diag_cfg.h:222
@ DIAG_ID_CAN_RX_QUEUE_FULL
Definition: diag_cfg.h:166
@ DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_MOL
Definition: diag_cfg.h:181
@ DIAG_ID_AFE_SPI
Definition: diag_cfg.h:161
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_MOL
Definition: diag_cfg.h:196
@ DIAG_ID_CAN_EC_RESPONDING
Definition: diag_cfg.h:168
@ DIAG_ID_CELLVOLTAGE_OVERVOLTAGE_MSL
Definition: diag_cfg.h:176
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_RSL
Definition: diag_cfg.h:183
@ DIAG_ID_INTERLOCK_FEEDBACK
Definition: diag_cfg.h:212
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_RSL
Definition: diag_cfg.h:198
@ DIAG_ID_AFE_CONFIG
Definition: diag_cfg.h:164
@ DIAG_ID_CELLVOLTAGE_UNDERVOLTAGE_MSL
Definition: diag_cfg.h:179
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MSL
Definition: diag_cfg.h:191
@ DIAG_ID_SYSTEMMONITORING
Definition: diag_cfg.h:159
@ DIAG_ID_LOW_INSULATION_RESISTANCE_WARNING
Definition: diag_cfg.h:229
DIAG_ID_CFG_s DIAG_ID_cfg[DIAG_ID_MAX]
Definition: diag_cfg.c:115
void DIAG_UpdateFlags(void)
update function for diagnosis flags
Definition: diag_cfg.c:227
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
Definition: diag_cfg.c:104
DIAG_DEV_s diag_device
Definition: diag_cfg.c:217
DIAG_RECORDING_e
Definition: diag_cfg.h:285
@ DIAG_RECORDING_ENABLED
Definition: diag_cfg.h:286
@ DIAG_RECORDING_DISABLED
Definition: diag_cfg.h:287
General macros and definitions for the whole platform.
DATA_BLOCK_MOL_FLAG_s * pTableMol
Definition: diag_cfg.h:148
DATA_BLOCK_RSL_FLAG_s * pTableRsl
Definition: diag_cfg.h:149
DATA_BLOCK_ERRORSTATE_s * pTableError
Definition: diag_cfg.h:147
DATA_BLOCK_MSL_FLAG_s * pTableMsl
Definition: diag_cfg.h:150
uint8_t nrOfConfiguredDiagnosisEntries
Definition: diag_cfg.h:324
DIAG_ID_CFG_s * pConfigurationOfDiagnosisEntries
Definition: diag_cfg.h:325
uint16_t numberOfFatalErrors
Definition: diag_cfg.h:326
DIAG_RECORDING_e enable_recording
Definition: diag_cfg.h:314
DIAG_SEVERITY_LEVEL_e severity
Definition: diag_cfg.h:311
uint32_t delay_ms
Definition: diag_cfg.h:313
DIAG_CALLBACK_FUNCTION_f * fpCallback
Definition: diag_cfg.h:316
uint16_t threshold
Definition: diag_cfg.h:306
DIAG_EVALUATE_e enable_evaluate
Definition: diag_cfg.h:315
DIAG_ID_e id
Definition: diag_cfg.h:305