71 #define CANRX_BIT (1u)
76 #define CANRX_DEBUG_MESSAGE_MUX_START_BIT (0x7u)
77 #define CANRX_DEBUG_MESSAGE_MUX_LENGTH (8u)
83 #define CANRX_DEBUG_MESSAGE_MUX_VALUE_VERSION_INFORMATION (0x00u)
84 #define CANRX_DEBUG_MESSAGE_MUX_VALUE_RTC (0x01u)
85 #define CANRX_DEBUG_MESSAGE_MUX_VALUE_SOFTWARE_RESET (0x02u)
86 #define CANRX_DEBUG_MESSAGE_MUX_VALUE_FRAM_INITIALIZATION (0x03u)
87 #define CANRX_DEBUG_MESSAGE_MUX_VALUE_TIME_INFO (0x04u)
94 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_BMS_SOFTWARE_VERSION_START_BIT (8u)
95 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_BMS_SOFTWARE_VERSION_LENGTH (CANRX_BIT)
96 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_UNIQUE_DIE_ID_START_BIT (9u)
97 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_UNIQUE_DIE_ID_LENGTH (CANRX_BIT)
98 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_LOT_NUMBER_START_BIT (10u)
99 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_LOT_NUMBER_LENGTH (CANRX_BIT)
100 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_WAFER_INFORMATION_START_BIT (11u)
101 #define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_WAFER_INFORMATION_LENGTH (CANRX_BIT)
108 #define CANRX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_START_BIT (15u)
109 #define CANRX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_LENGTH (7u)
110 #define CANRX_MUX_RTC_SIGNAL_SECONDS_START_BIT (8u)
111 #define CANRX_MUX_RTC_SIGNAL_SECONDS_LENGTH (6u)
112 #define CANRX_MUX_RTC_SIGNAL_MINUTES_START_BIT (18u)
113 #define CANRX_MUX_RTC_SIGNAL_MINUTES_LENGTH (6u)
114 #define CANRX_MUX_RTC_SIGNAL_HOURS_START_BIT (28u)
115 #define CANRX_MUX_RTC_SIGNAL_HOURS_LENGTH (5u)
116 #define CANRX_MUX_RTC_SIGNAL_WEEKDAY_START_BIT (39u)
117 #define CANRX_MUX_RTC_SIGNAL_WEEKDAY_LENGTH (3u)
118 #define CANRX_MUX_RTC_SIGNAL_DAY_START_BIT (36u)
119 #define CANRX_MUX_RTC_SIGNAL_DAY_LENGTH (5u)
120 #define CANRX_MUX_RTC_SIGNAL_MONTH_START_BIT (47u)
121 #define CANRX_MUX_RTC_SIGNAL_MONTH_LENGTH (4u)
122 #define CANRX_MUX_RTC_SIGNAL_YEAR_START_BIT (43u)
123 #define CANRX_MUX_RTC_SIGNAL_YEAR_LENGTH (7u)
130 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_SOFTWARE_RESET_START_BIT (39u)
131 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_SOFTWARE_RESET_LENGTH (CANRX_BIT)
138 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_FRAM_INITIALIZATION_START_BIT (27u)
139 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_FRAM_INITIALIZATION_LENGTH (CANRX_BIT)
146 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_REQUEST_RTC_TIME_START_BIT (8u)
147 #define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_REQUEST_RTC_TIME_LENGTH (CANRX_BIT)
344 uint64_t signalData = 0u;
353 return (uint8_t)signalData;
360 uint64_t signalData = 0u;
370 return (uint8_t)signalData;
377 uint64_t signalData = 0u;
387 return (uint8_t)signalData;
394 uint64_t signalData = 0u;
400 return (uint8_t)signalData;
407 uint64_t signalData = 0u;
417 return (uint8_t)signalData;
424 uint64_t signalData = 0u;
430 return (uint8_t)signalData;
438 uint64_t signalData = 0u;
443 return (uint8_t)signalData;
451 uint64_t signalData = 0u;
456 return (uint8_t)signalData;
482 bool isRequested =
false;
483 uint64_t signalData = 0u;
492 if (signalData == 1u) {
509 bool isRequested =
false;
510 uint64_t signalData = 0u;
519 if (signalData == 1u) {
536 bool isRequested =
false;
537 uint64_t signalData = 0u;
546 if (signalData == 1u) {
563 bool isRequested =
false;
564 uint64_t signalData = 0u;
573 if (signalData == 1u) {
609 bool isRequested =
false;
610 uint64_t signalData = 0u;
619 if (signalData == 1u) {
629 bool isRequested =
false;
630 uint64_t signalData = 0u;
639 if (signalData == 1u) {
679 bool isRequested =
false;
680 uint64_t signalData = 0u;
689 if (signalData == 1u) {
705 const uint8_t *
const kpkCanData,
713 uint64_t messageData = 0u;
714 uint64_t muxValue = 0u;
748 #ifdef UNITY_UNIT_TEST
751 extern uint8_t TEST_CANRX_GetHundredthOfSeconds(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
754 extern uint8_t TEST_CANRX_GetSeconds(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
757 extern uint8_t TEST_CANRX_GetMinutes(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
760 extern uint8_t TEST_CANRX_GetHours(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
763 extern uint8_t TEST_CANRX_GetWeekday(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
766 extern uint8_t TEST_CANRX_GetDay(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
769 extern uint8_t TEST_CANRX_GetMonth(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
772 extern uint8_t TEST_CANRX_GetYear(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
777 extern void TEST_CANRX_TriggerBmsSoftwareVersionMessage(
void) {
780 extern void TEST_CANRX_TriggerMcuUniqueDieIdMessage(
void) {
783 extern void TEST_CANRX_TriggerMcuLotNumberMessage(
void) {
786 extern void TEST_CANRX_TriggerMcuWaferInformationMessage(
void) {
789 extern void TEST_CANRX_TriggerTimeInfoMessage(
void) {
794 extern bool TEST_CANRX_CheckIfBmsSoftwareVersionIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
797 extern bool TEST_CANRX_CheckIfMcuUniqueDieIdIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
800 extern bool TEST_CANRX_CheckIfMcuLotNumberIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
803 extern bool TEST_CANRX_CheckIfMcuWaferInformationIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
806 extern bool TEST_CANRX_CheckIfSoftwareResetIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
809 extern bool TEST_CANRX_CheckIfFramInitializationIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
812 extern bool TEST_CANRX_CheckIfTimeInfoIsRequested(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
817 extern void TEST_CANRX_ProcessVersionInformationMux(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
820 extern void TEST_CANRX_ProcessRtcMux(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
823 extern void TEST_CANRX_ProcessSoftwareResetMux(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
826 extern void TEST_CANRX_ProcessFramInitializationMux(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
829 extern void TEST_CANRX_ProcessTimeInfoMux(uint64_t messageData,
CAN_ENDIANNESS_e endianness) {
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_REQUEST_RTC_TIME_LENGTH
#define CANRX_DEBUG_MESSAGE_MUX_VALUE_RTC
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_BMS_SOFTWARE_VERSION_LENGTH
#define CANRX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_LENGTH
static bool CANRX_CheckIfMcuLotNumberIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if the MCU lot number information is requested.
#define CANRX_DEBUG_MESSAGE_MUX_VALUE_VERSION_INFORMATION
static bool CANRX_CheckIfTimeInfoIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if the RTC time information is requested.
static bool CANRX_CheckIfMcuWaferInformationIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if the MCU wafer information is requested.
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_LOT_NUMBER_LENGTH
#define CANRX_MUX_RTC_SIGNAL_HOURS_LENGTH
#define CANRX_DEBUG_MESSAGE_MUX_LENGTH
static void CANRX_TriggerBmsSoftwareVersionMessage(void)
Triggers sending of the BMS software version information message.
static void CANRX_ProcessTimeInfoMux(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses CAN message to handle time information requests.
static bool CANRX_CheckIfFramInitializationIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if a FRAM initialization is requested.
#define CANRX_DEBUG_MESSAGE_MUX_VALUE_FRAM_INITIALIZATION
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_FRAM_INITIALIZATION_LENGTH
#define CANRX_MUX_RTC_SIGNAL_DAY_START_BIT
#define CANRX_MUX_RTC_SIGNAL_MINUTES_LENGTH
#define CANRX_MUX_RTC_SIGNAL_YEAR_START_BIT
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_LOT_NUMBER_START_BIT
static bool CANRX_CheckIfSoftwareResetIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if a software reset is requested.
#define CANRX_DEBUG_MESSAGE_MUX_VALUE_SOFTWARE_RESET
static void CANRX_TriggerMcuUniqueDieIdMessage(void)
Triggers sending of the MCU die ID information message.
#define CANRX_MUX_RTC_SIGNAL_WEEKDAY_LENGTH
#define CANRX_DEBUG_MESSAGE_MUX_VALUE_TIME_INFO
static uint8_t CANRX_GetMinutes(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the minutes information.
static void CANRX_ProcessFramInitializationMux(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses CAN message related to FRAM initialization.
static uint8_t CANRX_GetHundredthOfSeconds(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the hundredth of seconds information.
static void CANRX_ProcessSoftwareResetMux(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses CAN message to handle software related requests, e.g., a software reset of the BMS.
static void CANRX_ProcessVersionInformationMux(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses CAN message to handle version related messages.
static uint8_t CANRX_GetMonth(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the month information.
static uint8_t CANRX_GetSeconds(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the seconds information.
#define CANRX_MUX_RTC_SIGNAL_MINUTES_START_BIT
static uint8_t CANRX_GetHours(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the hours information.
#define CANRX_MUX_RTC_SIGNAL_YEAR_LENGTH
uint32_t CANRX_Debug(CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim)
can rx callback function for debug messages
#define CANRX_MUX_RTC_SIGNAL_DAY_LENGTH
static uint8_t CANRX_GetDay(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the day information.
#define CANRX_MUX_RTC_SIGNAL_WEEKDAY_START_BIT
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_UNIQUE_DIE_ID_LENGTH
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_WAFER_INFORMATION_LENGTH
#define CANRX_MUX_RTC_SIGNAL_MONTH_START_BIT
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_SOFTWARE_RESET_LENGTH
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_REQUEST_RTC_TIME_START_BIT
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_SOFTWARE_RESET_START_BIT
#define CANRX_MUX_RTC_SIGNAL_MONTH_LENGTH
static void CANRX_ProcessRtcMux(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses CAN message to set the RTC clock.
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_WAFER_INFORMATION_START_BIT
#define CANRX_MUX_SOFTWARE_SIGNAL_TRIGGER_FRAM_INITIALIZATION_START_BIT
#define CANRX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_START_BIT
#define CANRX_MUX_RTC_SIGNAL_HOURS_START_BIT
static uint8_t CANRX_GetYear(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the year information.
static bool CANRX_CheckIfBmsSoftwareVersionIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if the BMS software version information is requested.
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_MCU_UNIQUE_DIE_ID_START_BIT
static bool CANRX_CheckIfMcuUniqueDieIdIsRequested(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Check if the MCU die ID information is requested.
static void CANRX_TriggerMcuLotNumberMessage(void)
Triggers sending of the MCU lot number information message.
#define CANRX_MUX_RTC_SIGNAL_SECONDS_START_BIT
#define CANRX_DEBUG_MESSAGE_MUX_START_BIT
#define CANRX_MUX_RTC_SIGNAL_SECONDS_LENGTH
static void CANRX_TriggerMcuWaferInformationMessage(void)
Triggers sending of the MCU wafer information message.
#define CANRX_MUX_VERSION_INFO_SIGNAL_GET_BMS_SOFTWARE_VERSION_START_BIT
static uint8_t CANRX_GetWeekday(uint64_t messageData, CAN_ENDIANNESS_e endianness)
Parses the CAN message to retrieve the weekday information.
static void CANRX_TriggerTimeInfoMessage(void)
Triggers sending of the RTC time information message.
STD_RETURN_TYPE_e CANTX_DebugResponse(CANTX_DEBUG_RESPONSE_ACTIONS_e action)
Handles Debug response message.
Declarations for handling the transmit of debug response messages.
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_LOT_NUMBER
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_UNIQUE_DIE_ID
@ CANTX_DEBUG_RESPONSE_TRANSMIT_RTC_TIME
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_WAFER_INFORMATION
@ CANTX_DEBUG_RESPONSE_TRANSMIT_BMS_VERSION_INFO
void CANTX_UnsupportedMultiplexerValue(uint32_t messageId, uint32_t multiplexerValue)
Function to generically handle multiplexer values that are not supported in a message.
#define CAN_FOXBMS_MESSAGES_DEFAULT_DLC
Header for the driver for the CAN module.
#define CANRX_DEBUG_ID_TYPE
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 FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
STD_RETURN_TYPE_e FRAM_ReinitializeAllEntries(void)
Reinitialize all entries in the FRAM.
Header for the driver for the FRAM module.
#define NULL_PTR
Null pointer.
Header of task driver implementation.
OS_QUEUE ftsk_rtcSetTimeQueue
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait)
Post an item to the back the provided queue.
void SYS_TriggerSoftwareReset(void)
Trigger a software reset of the BMS.
Software reset driver header.
Header file of the RTC driver.
CAN_IDENTIFIER_TYPE_e idType
CAN_ENDIANNESS_e endianness
uint8_t hundredthOfSeconds