66 #include "HL_reg_system.h"
84 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_START_BIT (0x7u)
85 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_LENGTH (8u)
88 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BMS_SOFTWARE_VERSION_INFO (0x00u)
89 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_UNIQUE_DIE_ID (0x01u)
90 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_LOT_NUMBER (0x02u)
91 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_WAFER_INFORMATION (0x03u)
92 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_RTC_TIME (0x04u)
93 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_COMMIT_HASH (0x05u)
94 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BOOT_INFORMATION (0x0Fu)
100 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_START_BIT (15u)
101 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_LENGTH (8u)
102 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_START_BIT (23u)
103 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_LENGTH (8u)
104 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_START_BIT (31u)
105 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_LENGTH (8u)
106 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_START_BIT (39u)
107 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_LENGTH (5u)
108 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_START_BIT (34u)
109 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_LENGTH (1u)
110 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_START_BIT (33u)
111 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_LENGTH (1u)
112 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_START_BIT (32u)
113 #define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_LENGTH (1u)
120 #define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_START_BIT (15u)
121 #define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_LENGTH (7u)
122 #define CANTX_MUX_RTC_SIGNAL_SECONDS_START_BIT (8u)
123 #define CANTX_MUX_RTC_SIGNAL_SECONDS_LENGTH (6u)
124 #define CANTX_MUX_RTC_SIGNAL_MINUTES_START_BIT (18u)
125 #define CANTX_MUX_RTC_SIGNAL_MINUTES_LENGTH (6u)
126 #define CANTX_MUX_RTC_SIGNAL_HOURS_START_BIT (28u)
127 #define CANTX_MUX_RTC_SIGNAL_HOURS_LENGTH (5u)
128 #define CANTX_MUX_RTC_SIGNAL_WEEKDAY_START_BIT (39u)
129 #define CANTX_MUX_RTC_SIGNAL_WEEKDAY_LENGTH (3u)
130 #define CANTX_MUX_RTC_SIGNAL_DAY_START_BIT (36u)
131 #define CANTX_MUX_RTC_SIGNAL_DAY_LENGTH (5u)
132 #define CANTX_MUX_RTC_SIGNAL_MONTH_START_BIT (47u)
133 #define CANTX_MUX_RTC_SIGNAL_MONTH_LENGTH (4u)
134 #define CANTX_MUX_RTC_SIGNAL_YEAR_START_BIT (43u)
135 #define CANTX_MUX_RTC_SIGNAL_YEAR_LENGTH (7u)
139 #define CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE (31u)
140 #if CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE > UINT8_MAX
141 #error "This code assumes that the define is smaller or equal to UINT8_MAX")
148 #define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_START_BIT (15u)
149 #define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_LENGTH (32u)
156 #define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_START_BIT (15u)
157 #define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_LENGTH (32u)
164 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_START_BIT (15u)
165 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_LENGTH (8u)
166 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_START_BIT (27u)
167 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_LENGTH (12u)
168 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_START_BIT (23u)
169 #define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_LENGTH (12u)
176 #define CANTX_MUX_BOOT_SIGNAL_START_BIT (15u)
177 #define CANTX_MUX_BOOT_SIGNAL_LENGTH (56u)
183 #define CANTX_BOOT_MAGIC_DATA_START (0xFEFEFEFEFEFEFEuLL)
184 #define CANTX_BOOT_MAGIC_DATA_END (0x01010101010101uLL)
195 #define CANTX_WAFER_X_COORDINATE_BITMASK (0x00000FFFuLL)
196 #define CANTX_WAFER_Y_COORDINATE_BITMASK (0x00FFF000uLL)
197 #define CANTX_WAFER_Y_COORDINATE_SHIFT_12_BITS (12uLL)
198 #define CANTX_WAFER_NUMBER_BITMASK (0xFF000000uLL)
199 #define CANTX_WAFER_NUMBER_SHIFT_24_BITS (24uLL)
206 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_0_START_BIT (15u)
207 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_1_START_BIT (23u)
208 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_2_START_BIT (31u)
209 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_3_START_BIT (39u)
210 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_4_START_BIT (47u)
211 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_5_START_BIT (55u)
212 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_6_START_BIT (63u)
213 #define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_LENGTH (8u)
214 #define CANTX_MUX_COMMIT_HASH_CHAR_0 (0u)
215 #define CANTX_MUX_COMMIT_HASH_CHAR_1 (1u)
216 #define CANTX_MUX_COMMIT_HASH_CHAR_2 (2u)
217 #define CANTX_MUX_COMMIT_HASH_CHAR_3 (3u)
218 #define CANTX_MUX_COMMIT_HASH_CHAR_4 (4u)
219 #define CANTX_MUX_COMMIT_HASH_CHAR_5 (5u)
220 #define CANTX_MUX_COMMIT_HASH_CHAR_6 (6u)
290 uint8_t releaseDistanceOverflow = 0;
292 releaseDistanceOverflow = 1;
294 uint64_t isDirty = 0;
298 uint64_t underVersionControl = 0;
300 underVersionControl = 1;
303 uint64_t message = 0u;
338 releaseDistanceOverflow,
356 return successfullyQueued;
363 const uint32_t deviceRegister = systemREG1->DEVID;
365 uint64_t message = 0u;
382 return successfullyQueued;
389 const uint32_t dieIdHigh = systemREG1->DIEIDH;
391 uint64_t message = 0u;
408 return successfullyQueued;
416 const uint64_t dieIdLow = (uint64_t)systemREG1->DIEIDL;
423 uint64_t message = 0u;
452 return successfullyQueued;
459 uint64_t message = 0u;
471 return successfullyQueued;
487 uint64_t message = 0u;
516 currentRtcTime.
hours,
534 currentRtcTime.
month,
546 return successfullyQueued;
551 uint64_t message = 0u;
614 return successfullyQueued;
649 return successfullyQueued;
STD_RETURN_TYPE_e CAN_DataSend(CAN_NODE_s *pNode, uint32_t id, CAN_IDENTIFIER_TYPE_e idType, uint8 *pData)
Sends over CAN the data passed in parameters. This function goes over the message boxes and marks the...
Header for the driver for the CAN module.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_LENGTH
#define CANTX_MUX_RTC_SIGNAL_SECONDS_START_BIT
#define CANTX_MUX_RTC_SIGNAL_WEEKDAY_LENGTH
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_START_BIT
#define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_LENGTH
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_START_BIT
#define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_START_BIT
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BOOT_INFORMATION
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_LENGTH
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_LENGTH
static STD_RETURN_TYPE_e CANTX_TransmitMcuUniqueDieId(void)
Transmit the MCU's unique id.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_START_BIT
#define CANTX_MUX_BOOT_SIGNAL_START_BIT
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_1_START_BIT
#define CANTX_MUX_RTC_SIGNAL_HOURS_START_BIT
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_3_START_BIT
STD_RETURN_TYPE_e CANTX_DebugResponse(CANTX_DEBUG_RESPONSE_ACTIONS_e action)
Handles Debug response message.
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_0_START_BIT
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_WAFER_INFORMATION
static STD_RETURN_TYPE_e CANTX_TransmitRtcTime(void)
Transmit the RTC time message.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_START_BIT
#define CANTX_MUX_COMMIT_HASH_CHAR_0
#define CANTX_MUX_RTC_SIGNAL_MONTH_START_BIT
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_5_START_BIT
#define CANTX_MUX_COMMIT_HASH_CHAR_5
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_RTC_TIME
#define CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_LENGTH
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_LENGTH
#define CANTX_WAFER_NUMBER_BITMASK
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_UNIQUE_DIE_ID
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_LENGTH
static STD_RETURN_TYPE_e CANTX_TransmitBootMagic(uint64_t messageData)
Transmit a boot message.
#define CANTX_MUX_RTC_SIGNAL_YEAR_LENGTH
#define CANTX_MUX_RTC_SIGNAL_DAY_LENGTH
#define CANTX_MUX_COMMIT_HASH_CHAR_1
#define CANTX_MUX_RTC_SIGNAL_MONTH_LENGTH
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_COMMIT_HASH
#define CANTX_MUX_RTC_SIGNAL_DAY_START_BIT
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_LENGTH
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_START_BIT
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_LENGTH
#define CANTX_WAFER_X_COORDINATE_BITMASK
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BMS_SOFTWARE_VERSION_INFO
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_START_BIT
static STD_RETURN_TYPE_e CANTX_TransmitBootMagicEnd(void)
Transmit the boot message and its magic end data.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_START_BIT
#define CANTX_MUX_BOOT_SIGNAL_LENGTH
#define CANTX_MUX_COMMIT_HASH_CHAR_6
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_4_START_BIT
#define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_LENGTH
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_2_START_BIT
#define CANTX_MUX_COMMIT_HASH_SIGNAL_CHAR_6_START_BIT
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_START_BIT
#define CANTX_MUX_COMMIT_HASH_CHAR_2
#define CANTX_MUX_COMMIT_HASH_CHAR_4
static STD_RETURN_TYPE_e CANTX_TransmitMcuWaferInformation(void)
Transmit the MCU's wafer information.
#define CANTX_WAFER_NUMBER_SHIFT_24_BITS
#define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_START_BIT
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_LOT_NUMBER
#define CANTX_BOOT_MAGIC_DATA_START
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_LENGTH
#define CANTX_MUX_RTC_SIGNAL_SECONDS_LENGTH
#define CANTX_MUX_RTC_SIGNAL_MINUTES_START_BIT
#define CANTX_WAFER_Y_COORDINATE_BITMASK
#define CANTX_WAFER_Y_COORDINATE_SHIFT_12_BITS
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_LENGTH
#define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_LENGTH
static STD_RETURN_TYPE_e CANTX_TransmitBootMagicStart(void)
Transmit the boot message and its magic start data.
#define CANTX_MUX_RTC_SIGNAL_YEAR_START_BIT
static STD_RETURN_TYPE_e CANTX_TransmitCommitHash(void)
Transmit the commit hash.
#define CANTX_MUX_COMMIT_HASH_CHAR_3
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_START_BIT
static STD_RETURN_TYPE_e CANTX_TransmitBmsVersionInfo(void)
Transmit the embedded software version information.
static STD_RETURN_TYPE_e CANTX_TransmitMcuLotNumber(void)
Transmit the MCU's lot number ID information.
#define CANTX_MUX_RTC_SIGNAL_HOURS_LENGTH
#define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_START_BIT
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_START_BIT
#define CANTX_BOOT_MAGIC_DATA_END
#define CANTX_MUX_RTC_SIGNAL_MINUTES_LENGTH
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_LENGTH
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_START_BIT
#define CANTX_MUX_RTC_SIGNAL_WEEKDAY_START_BIT
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_LENGTH
Declarations for handling the transmit of debug response messages.
CANTX_DEBUG_RESPONSE_ACTIONS_e
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_LOT_NUMBER
@ CANTX_DEBUG_RESPONSE_TRANSMIT_BOOT_MAGIC_START
@ CANTX_DEBUG_RESPONSE_TRANSMIT_BOOT_MAGIC_END
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_UNIQUE_DIE_ID
@ CANTX_DEBUG_RESPONSE_TRANSMIT_RTC_TIME
@ CANTX_DEBUG_RESPONSE_TRANSMIT_COMMIT_HASH
@ CANTX_DEBUG_RESPONSE_TRANSMIT_MCU_WAFER_INFORMATION
@ CANTX_DEBUG_RESPONSE_TRANSMIT_BMS_VERSION_INFO
#define CAN_NODE_DEBUG_MESSAGE
Header for the driver for the CAN module.
#define CANTX_DEBUG_RESPONSE_ID
#define CANTX_DEBUG_IDENTIFIER
void CAN_TxSetMessageDataWithSignalData(uint64_t *pMessage, uint64_t bitStart, uint8_t bitLength, uint64_t canSignal, CAN_ENDIANNESS_e endianness)
Puts CAN signal data in a 64-bit variable. This function is used to compose a 64-bit CAN message....
void CAN_TxSetCanDataWithMessageData(uint64_t message, uint8_t *pCanData, CAN_ENDIANNESS_e endianness)
Copy CAN data from a 64-bit variable to 8 bytes. This function is used to copy a 64-bit CAN message t...
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.
uint16_t MATH_MinimumOfTwoUint16_t(const uint16_t value1, const uint16_t value2)
Returns the minimum of the passed uint16_t values.
math library for often used math functions
Definition of foxBMS standard types.
General macros and definitions for the whole platform.
#define GEN_REPEAT_U(x, n)
Macro that helps to generate a series of literals (for array initializers).
RTC_TIME_DATA_s RTC_GetSystemTimeRtcFormat(void)
get the RTC system timer.
Header file of the RTC driver.
uint8_t hundredthOfSeconds
const char commitHash[VER_VERSION_STRUCT_MAXIMUM_COMMIT_HASH_LENGTH]
const bool underVersionControl
const uint16_t distanceFromLastRelease
Header file for the version information that is generated by the toolchain.
const VER_VERSION_s ver_foxbmsVersionInformation