57 #ifndef FOXBMS__DIAG_CFG_H_
58 #define FOXBMS__DIAG_CFG_H_
69 #define DIAG_ERROR_SENSITIVITY_FIRST_EVENT (0)
70 #define DIAG_ERROR_SENSITIVITY_THIRD_EVENT (2)
71 #define DIAG_ERROR_SENSITIVITY_FIFTH_EVENT (4)
72 #define DIAG_ERROR_SENSITIVITY_TENTH_EVENT (9)
74 #define DIAG_ERROR_SENSITIVITY_HIGH (0)
75 #define DIAG_ERROR_SENSITIVITY_MID (5)
76 #define DIAG_ERROR_SENSITIVITY_LOW (10)
78 #define DIAG_ERROR_INTERLOCK_SENSITIVITY (10)
80 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_MSL (500)
81 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_RSL (500)
82 #define DIAG_ERROR_VOLTAGE_SENSITIVITY_MOL (500)
85 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MSL (500)
87 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_RSL (500)
89 #define DIAG_ERROR_TEMPERATURE_SENSITIVITY_MOL (500)
92 #define DIAG_ERROR_CURRENT_SENSITIVITY_MSL (500)
94 #define DIAG_ERROR_CURRENT_SENSITIVITY_RSL (500)
96 #define DIAG_ERROR_CURRENT_SENSITIVITY_MOL (500)
98 #define DIAG_ERROR_LTC_PEC_SENSITIVITY (5)
99 #define DIAG_ERROR_LTC_MUX_SENSITIVITY (5)
100 #define DIAG_ERROR_LTC_SPI_SENSITIVITY (5)
102 #define DIAG_ERROR_CAN_TIMING_SENSITIVITY (100)
103 #define DIAG_ERROR_CAN_TIMING_CC_SENSITIVITY (100)
104 #define DIAG_ERROR_CAN_SENSOR_SENSITIVITY (100)
114 #define DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY (20)
127 #define DIAG_DELAY_DISCARDED (UINT32_MAX)
129 #define DIAG_NO_DELAY (0u)
131 #define DIAG_DELAY_INTERLOCK_ms (100u)
133 #define DIAG_DELAY_OVERVOLTAGE_ms (200u)
135 #define DIAG_DELAY_UNDERVOLTAGE_ms (200u)
137 #define DIAG_DELAY_TEMPERATURE_ms (1000u)
139 #define DIAG_DELAY_OVERCURRENT_ms (100u)
141 #define DIAG_DELAY_AFE_ms (100u)
143 #define DIAG_DELAY_CAN_TIMING_ms (200u)
145 #define DIAG_DELAY_EC_CC_TIMING_ms (2000u)
147 #define DIAG_DELAY_CURRENT_SENSOR_ms (200u)
149 #define DIAG_DELAY_SBC_ms (100u)
151 #define DIAG_DELAY_PL_PACK_VOLTAGE_ms (100u)
153 #define DIAG_DELAY_CONTACTOR_FEEDBACK_ms (100u)
155 #define DIAG_DELAY_DEEP_DISCHARGE_ms (100u)
157 #define DIAG_DELAY_REDUNDANCY_MEAS_TIMEOUT_ms (100u)
159 #define DIAG_DELAY_REDUNDANCY_MEAS_ERROR_ms (100u)
162 #define DIAG_MAX_ENTRIES_OF_ERROR (5)
289 #if BS_CHECK_CAN_TIMING == true
290 #define DIAG_CAN_TIMING (DIAG_EVALUATION_ENABLED)
292 #define DIAG_CAN_TIMING (DIAG_EVALUATION_DISABLED)
300 #if BS_CURRENT_SENSOR_PRESENT == true
301 #define DIAG_CAN_SENSOR_PRESENT (DIAG_EVALUATION_ENABLED)
303 #define DIAG_CAN_SENSOR_PRESENT (DIAG_EVALUATION_DISABLED)
373 #ifdef UNITY_UNIT_TEST
Configuration of the battery system (e.g., number of battery modules, battery cells,...
Database configuration header.
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
@ DIAG_EVALUATION_ENABLED
@ DIAG_EVALUATION_DISABLED
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MSL
@ DIAG_ID_POWER_MEASUREMENT_ERROR
@ DIAG_ID_CELL_VOLTAGE_UNDERVOLTAGE_MSL
@ DIAG_ID_PACK_OVERCURRENT_CHARGE_MSL
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_RSL
@ DIAG_ID_CURRENT_SENSOR_V2_MEASUREMENT_TIMEOUT
@ DIAG_ID_AFE_CELL_VOLTAGE_MEAS_ERROR
@ DIAG_ID_CAN_CC_RESPONDING
@ DIAG_ID_CURRENT_MEASUREMENT_TIMEOUT
@ DIAG_ID_AFE_CELL_TEMPERATURE_MEAS_ERROR
@ DIAG_ID_RTC_CLOCK_INTEGRITY_ERROR
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MSL
@ DIAG_ID_PLAUSIBILITY_CELL_TEMPERATURE_SPREAD
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_RSL
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MOL
@ DIAG_ID_INSULATION_MEASUREMENT_VALID
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_RSL
@ DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE_SPREAD
@ DIAG_ID_BASE_CELL_TEMPERATURE_MEASUREMENT_TIMEOUT
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_RSL
@ DIAG_ID_CELL_VOLTAGE_UNDERVOLTAGE_RSL
@ DIAG_ID_PLAUSIBILITY_PACK_VOLTAGE
@ DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_MSL
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_RSL
@ DIAG_ID_STRING_PLUS_CONTACTOR_FEEDBACK
@ DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE
@ DIAG_ID_PLAUSIBILITY_CELL_TEMP
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MSL
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_RSL
@ DIAG_ID_TEMP_OVERTEMPERATURE_DISCHARGE_MOL
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_MSL
@ DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK
@ DIAG_ID_STRING_OVERCURRENT_CHARGE_MOL
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MSL
@ DIAG_ID_AFE_COM_INTEGRITY
@ DIAG_ID_CURRENT_SENSOR_POWER_MEASUREMENT_TIMEOUT
@ DIAG_ID_BASE_CELL_VOLTAGE_MEASUREMENT_TIMEOUT
@ DIAG_ID_SYSTEM_MONITORING
@ DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_RSL
@ DIAG_ID_INSULATION_GROUND_ERROR
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_MOL
@ DIAG_ID_TEMP_UNDERTEMPERATURE_CHARGE_MOL
@ DIAG_ID_FRAM_READ_CRC_ERROR
@ DIAG_ID_PRECHARGE_ABORT_REASON_CURRENT
@ DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK
@ DIAG_ID_RTC_BATTERY_LOW_ERROR
@ DIAG_ID_PACK_OVERCURRENT_DISCHARGE_MSL
@ DIAG_ID_CURRENT_SENSOR_V1_MEASUREMENT_TIMEOUT
@ DIAG_ID_DEEP_DISCHARGE_DETECTED
@ DIAG_ID_CURRENT_SENSOR_V3_MEASUREMENT_TIMEOUT
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MOL
@ DIAG_ID_PRECHARGE_ABORT_REASON_VOLTAGE
@ DIAG_ID_CELL_VOLTAGE_UNDERVOLTAGE_MOL
@ DIAG_ID_LOW_INSULATION_RESISTANCE_ERROR
@ DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_MOL
@ DIAG_ID_CURRENT_ON_OPEN_STRING
@ DIAG_ID_STRING_OVERCURRENT_DISCHARGE_MSL
@ DIAG_ID_REDUNDANCY0_CELL_VOLTAGE_MEASUREMENT_TIMEOUT
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_MSL
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_MOL
@ DIAG_ID_CURRENT_SENSOR_RESPONDING
@ DIAG_ID_CURRENT_MEASUREMENT_ERROR
@ DIAG_ID_CAN_RX_QUEUE_FULL
@ DIAG_ID_OVERCURRENT_CHARGE_CELL_MOL
@ DIAG_ID_CAN_EC_RESPONDING
@ DIAG_ID_CAN_TX_QUEUE_FULL
@ DIAG_ID_TEMP_OVERTEMPERATURE_CHARGE_RSL
@ DIAG_ID_INTERLOCK_FEEDBACK
@ DIAG_ID_OVERCURRENT_DISCHARGE_CELL_RSL
@ DIAG_ID_TEMP_UNDERTEMPERATURE_DISCHARGE_MSL
@ DIAG_ID_REDUNDANCY0_CELL_TEMPERATURE_MEASUREMENT_TIMEOUT
@ DIAG_ID_LOW_INSULATION_RESISTANCE_WARNING
void DIAG_UpdateFlags(void)
update function for diagnosis flags
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
DIAG_ID_CFG_s diag_diagnosisIdConfiguration[DIAG_ID_MAX]
@ DIAG_RECORDING_DISABLED
DATA_BLOCK_MOL_FLAG_s * pTableMol
DATA_BLOCK_RSL_FLAG_s * pTableRsl
DATA_BLOCK_MSL_FLAG_s * pTableMsl
DATA_BLOCK_ERROR_STATE_s * pTableError
uint8_t nrOfConfiguredDiagnosisEntries
DIAG_ID_CFG_s * pConfigurationOfDiagnosisEntries
uint16_t numberOfFatalErrors
DIAG_RECORDING_e enable_recording
DIAG_SEVERITY_LEVEL_e severity
DIAG_CALLBACK_FUNCTION_f * fpCallback
DIAG_EVALUATE_e enable_evaluate