foxBMS - Unit Tests
1.5.0
The foxBMS Unit Tests API Documentation
|
Diagnostic module configuration header. More...
Go to the source code of this file.
Data Structures | |
struct | DIAG_DATABASE_SHIM_s |
struct | DIAG_ID_CFG_s |
struct | DIAG_DEV_s |
Typedefs | |
typedef void | DIAG_CALLBACK_FUNCTION_f(DIAG_ID_e diagId, DIAG_EVENT_e event, const DIAG_DATABASE_SHIM_s *const kpkDiagShim, uint32_t data) |
function type for diag callbacks More... | |
Functions | |
void | DIAG_UpdateFlags (void) |
update function for diagnosis flags More... | |
Variables | |
const DIAG_DATABASE_SHIM_s | diag_kDatabaseShim |
DIAG_DEV_s | diag_device |
DIAG_ID_CFG_s | diag_diagnosisIdConfiguration [DIAG_ID_MAX] |
Diagnostic module configuration header.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
In this header filer are the different diagnosis channel defines assigned to different diagnosis IDs. Furthermore are the diagnosis error log settings be configured here.
Definition in file diag_cfg.h.
#define DIAG_CAN_SENSOR_PRESENT (DIAG_EVALUATION_ENABLED) |
Value that is written into the field that describes whether current sensor diag entries should be generated if it is not present.
Definition at line 299 of file diag_cfg.h.
#define DIAG_CAN_TIMING (DIAG_EVALUATION_ENABLED) |
Value that is written into the field that describes whether CAN timing diag entries should be generated.
Definition at line 288 of file diag_cfg.h.
#define DIAG_DELAY_AFE_ms (100u) |
delay for AFE related errors
Definition at line 141 of file diag_cfg.h.
#define DIAG_DELAY_CAN_TIMING_ms (200u) |
delay for can timing error
Definition at line 143 of file diag_cfg.h.
#define DIAG_DELAY_CONTACTOR_FEEDBACK_ms (100u) |
delay for contactor feedback errors
Definition at line 153 of file diag_cfg.h.
#define DIAG_DELAY_CURRENT_SENSOR_ms (200u) |
delay for current sensor response error
Definition at line 147 of file diag_cfg.h.
#define DIAG_DELAY_DEEP_DISCHARGE_ms (100u) |
delay for deep-discharge error
Definition at line 155 of file diag_cfg.h.
#define DIAG_DELAY_DISCARDED (UINT32_MAX) |
-------------— DEFINES FOR ERROR STATE TRANSITION DELAY-------------— These defines configure the delay before the transition to the error state occurs if a fault is detected. During this time the BMS can alert a superordinate control unit that the contactors will be opened soon. The superior control unit can take action and e.g., reduce the current until the transition to error state takes place.
The delay is not taken into account if severity level DIAG_FATAL_ERROR of type DIAG_SEVERITY_LEVEL_e is configured in config array diag_diagnosisIdConfiguration. For any other severity, DIAG_DELAY_DISCARDED can be used as a dummy value.
Definition at line 127 of file diag_cfg.h.
#define DIAG_DELAY_EC_CC_TIMING_ms (2000u) |
delay for energy counting/coulomb counting timing error
Definition at line 145 of file diag_cfg.h.
#define DIAG_DELAY_INTERLOCK_ms (100u) |
delay for interlock error
Definition at line 131 of file diag_cfg.h.
#define DIAG_DELAY_OVERCURRENT_ms (100u) |
delay for overcurrent errors
Definition at line 139 of file diag_cfg.h.
#define DIAG_DELAY_OVERVOLTAGE_ms (200u) |
delay for overvoltage errors
Definition at line 133 of file diag_cfg.h.
#define DIAG_DELAY_PL_PACK_VOLTAGE_ms (100u) |
delay for pack voltage plausibility error
Definition at line 151 of file diag_cfg.h.
#define DIAG_DELAY_REDUNDANCY_MEAS_ERROR_ms (100u) |
delay redundancy measurement errors
Definition at line 159 of file diag_cfg.h.
#define DIAG_DELAY_REDUNDANCY_MEAS_TIMEOUT_ms (100u) |
delay redundancy measurement timeout errors
Definition at line 157 of file diag_cfg.h.
#define DIAG_DELAY_SBC_ms (100u) |
delay for SBC related errors
Definition at line 149 of file diag_cfg.h.
#define DIAG_DELAY_TEMPERATURE_ms (1000u) |
delay for temperature errors
Definition at line 137 of file diag_cfg.h.
#define DIAG_DELAY_UNDERVOLTAGE_ms (200u) |
delay for undervoltage errors
Definition at line 135 of file diag_cfg.h.
#define DIAG_ERROR_CAN_SENSOR_SENSITIVITY (100) |
logging level of CAN errors on the current sensor
Definition at line 104 of file diag_cfg.h.
#define DIAG_ERROR_CAN_TIMING_CC_SENSITIVITY (100) |
logging level of CAN timing errors on the current sensor
Definition at line 103 of file diag_cfg.h.
#define DIAG_ERROR_CAN_TIMING_SENSITIVITY (100) |
logging level of CAN timing errors
Definition at line 102 of file diag_cfg.h.
#define DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY (20) |
Logging after 20th event for errors connected related to the contactor feedback. This value is chosen to be so large because of the time delay between the request for a state and the actual physical response. It is caused by the SPI transaction to the SPS module, the rise time of the control signal and the actual opening/closing of the contactor. Only then can the feedback be read correctly, which also take some additional delay depending on the feedback source.
Definition at line 114 of file diag_cfg.h.
#define DIAG_ERROR_CURRENT_SENSITIVITY_MOL (500) |
MOL level for event occurrence if over/under current event
Definition at line 96 of file diag_cfg.h.
#define DIAG_ERROR_CURRENT_SENSITIVITY_MSL (500) |
MSL level for event occurrence if over/under current event
Definition at line 92 of file diag_cfg.h.
#define DIAG_ERROR_CURRENT_SENSITIVITY_RSL (500) |
RSL level for event occurrence if over/under current event
Definition at line 94 of file diag_cfg.h.
#define DIAG_ERROR_INTERLOCK_SENSITIVITY (10) |
logging level of interlock
Definition at line 78 of file diag_cfg.h.
#define DIAG_ERROR_LTC_MUX_SENSITIVITY (5) |
logging level of LTC MUX errors
Definition at line 99 of file diag_cfg.h.
#define DIAG_ERROR_LTC_PEC_SENSITIVITY (5) |
logging level of LTC PEC errors
Definition at line 98 of file diag_cfg.h.
#define DIAG_ERROR_LTC_SPI_SENSITIVITY (5) |
logging level of LTC SPI errors
Definition at line 100 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_FIFTH_EVENT (4) |
logging at fifth event
Definition at line 71 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_FIRST_EVENT (0) |
logging at first event
Definition at line 69 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_HIGH (0) |
logging at first event
Definition at line 74 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_LOW (10) |
logging at tenth event
Definition at line 76 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_MID (5) |
logging at fifth event
Definition at line 75 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_TENTH_EVENT (9) |
logging at tenth event
Definition at line 72 of file diag_cfg.h.
#define DIAG_ERROR_SENSITIVITY_THIRD_EVENT (2) |
logging at third event
Definition at line 70 of file diag_cfg.h.
#define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MOL (500) |
MOL level for event occurrence if over/under temperature event
Definition at line 89 of file diag_cfg.h.
#define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MSL (500) |
MSL level for event occurrence if over/under temperature event
Definition at line 85 of file diag_cfg.h.
#define DIAG_ERROR_TEMPERATURE_SENSITIVITY_RSL (500) |
RSL level for event occurrence if over/under temperature event
Definition at line 87 of file diag_cfg.h.
#define DIAG_ERROR_VOLTAGE_SENSITIVITY_MOL (500) |
MOL level for event occurrence if over/under voltage event
Definition at line 82 of file diag_cfg.h.
#define DIAG_ERROR_VOLTAGE_SENSITIVITY_MSL (500) |
MSL level for event occurrence if over/under voltage event
Definition at line 80 of file diag_cfg.h.
#define DIAG_ERROR_VOLTAGE_SENSITIVITY_RSL (500) |
RSL level for event occurrence if over/under voltage event
Definition at line 81 of file diag_cfg.h.
#define DIAG_MAX_ENTRIES_OF_ERROR (5) |
Maximum number of the same errors that are logged
Definition at line 162 of file diag_cfg.h.
#define DIAG_NO_DELAY (0u) |
no delay after error is detected, open contactors instantaneous
Definition at line 129 of file diag_cfg.h.
typedef void DIAG_CALLBACK_FUNCTION_f(DIAG_ID_e diagId, DIAG_EVENT_e event, const DIAG_DATABASE_SHIM_s *const kpkDiagShim, uint32_t data) |
function type for diag callbacks
[in] | diagId | ID of diag entry |
[in] | event | DIAG_EVENT_e |
[in] | kpkDiagShim | shim to the database entries |
[in] | data | data |
Definition at line 324 of file diag_cfg.h.
enum DIAG_EVALUATE_e |
enable or disable the diagnosis handling for an event
Enumerator | |
---|---|
DIAG_EVALUATION_ENABLED | enables evaluation of diagnosis handling |
DIAG_EVALUATION_DISABLED | disables evaluation of diagnosis handling |
Definition at line 271 of file diag_cfg.h.
enum DIAG_EVENT_e |
diagnosis check result (event)
Enumerator | |
---|---|
DIAG_EVENT_OK | diag channel event OK |
DIAG_EVENT_NOT_OK | diag channel event NOK |
DIAG_EVENT_RESET | reset diag channel event counter to 0 |
Definition at line 264 of file diag_cfg.h.
enum DIAG_ID_e |
list of diag IDs
Definition at line 176 of file diag_cfg.h.
enum DIAG_IMPACT_LEVEL_e |
impact level of diagnosis event, e.g., influences the event the whole system or only a string
Enumerator | |
---|---|
DIAG_SYSTEM | diag event impact is system related e.g., can timing |
DIAG_STRING | diag event impact is string related e.g., overvoltage in string x |
Definition at line 277 of file diag_cfg.h.
enum DIAG_RECORDING_e |
diagnosis recording activation
Enumerator | |
---|---|
DIAG_RECORDING_ENABLED | enable diagnosis event recording |
DIAG_RECORDING_DISABLED | disable diagnosis event recording |
Definition at line 312 of file diag_cfg.h.
diagnosis severity level
Enumerator | |
---|---|
DIAG_FATAL_ERROR | severity level fatal error |
DIAG_WARNING | severity level warning |
DIAG_INFO | severity level info |
Definition at line 305 of file diag_cfg.h.
void DIAG_UpdateFlags | ( | void | ) |
|
extern |
diag device configuration struct
Definition at line 237 of file diag_cfg.c.
|
extern |
variable tracking the state of the diag channels
Definition at line 124 of file diag_cfg.c.
|
extern |
variable for storing and passing on the local database table handles
Definition at line 113 of file diag_cfg.c.