75 #define CAN_CAN_REQUEST_UPDATE_TIME_ms (3000u)
114 if (signalData == 1u) {
134 switch (signalData) {
167 if (signalData == 0u) {
177 int32_t cappedSignalData = (int32_t)signalData;
178 if (signalData > (uint64_t)UINT16_MAX) {
179 cappedSignalData = (uint64_t)UINT16_MAX;
189 const uint8_t *
const kpkCanData,
198 uint64_t message = 0;
201 uint64_t signalData = 0;
230 #ifdef UNITY_UNIT_TEST
Header for the driver for balancing.
STD_RETURN_TYPE_e BAL_GetInitializationState(void)
gets the initialization state.
@ BAL_STATE_GLOBAL_ENABLE_REQUEST
@ BAL_STATE_GLOBAL_DISABLE_REQUEST
BAL_RETURN_TYPE_e BAL_SetStateRequest(BAL_STATE_REQUEST_e stateRequest)
sets the current state request of the state variable bal_state.
void BAL_SetBalancingThreshold(int32_t threshold_mV)
set balancing threshold
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
bms driver configuration header
#define BMS_REQ_ID_STANDBY
#define BMS_REQ_ID_CHARGE
#define BMS_REQ_ID_NORMAL
uint32_t CAN_RxRequest(uint32_t id, uint8_t dlc, CAN_ENDIANNESS_e endianness, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim)
can rx callback function for state requests
static void CAN_ClearAllPersistentFlags(uint64_t signalData)
clears the persistent flags
static void CAN_SetBalancingThreshold(uint64_t signalData)
sets the balancing threshold
static void CAN_HandleBalancingRequest(uint64_t signalData)
handles the balancing request
static void CAN_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const kpkCanShim)
handles the mode request
#define CAN_CAN_REQUEST_UPDATE_TIME_ms
CAN state request update time.
void CAN_RxGetMessageDataFromCanData(uint64_t *pMessage, const uint8_t *const kpkCanData, CAN_ENDIANNESS_e endianness)
Copy CAN data from 8 bytes to a 64-bit variable.
void CAN_RxGetSignalDataFromMessageData(uint64_t message, uint64_t bitStart, uint8_t bitLength, uint64_t *pCanSignal, CAN_ENDIANNESS_e endianness)
Gets CAN signal data from a 64-bit variable. This function is used to get signal data from a 64-bit C...
Headers for the helper functions for the CAN module.
#define DATA_READ_DATA(...)
#define DATA_WRITE_DATA(...)
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diag_id, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
@ DIAG_ID_DEEP_DISCHARGE_DETECTED
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define NULL_PTR
Null pointer.
bool OS_CheckTimeHasPassed(uint32_t oldTimeStamp_ms, uint32_t timeToPass_ms)
This function checks if timeToPass has passed since the last timestamp to now.
Declaration of the OS wrapper interface.
DATA_BLOCK_STATEREQUEST_s * pTableStateRequest
uint8_t stateRequestViaCan
uint8_t previousStateRequestViaCan
DATA_BLOCK_HEADER_s header
uint8_t stateRequestViaCanPending
void SYSM_ClearAllTimingViolations(void)
Clears all timing violations (both current and recorded)