foxBMS - Unit Tests  1.6.0
The foxBMS Unit Tests API Documentation
can_cbs_tx_debug-response.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file can_cbs_tx_debug-response.c
44  * @author foxBMS Team
45  * @date 2019-12-04 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup DRIVERS
49  * @prefix CANTX
50  *
51  * @brief Implementation for handling the transmit of debug response messages
52  * @details Implementation of the interface for transmitting debug response
53  * messages (#CANTX_DebugResponse).
54  * The interface only serves as a wrapper that calls internally the
55  * respective functions to transmit the debug data.
56  */
57 
58 /*========== Includes =======================================================*/
59 #include "general.h"
60 
62 
63 #include "version_cfg.h"
64 
65 #include "HL_het.h"
66 #include "HL_reg_system.h"
67 
68 #include "can.h"
70 #include "can_helper.h"
71 #include "database.h"
72 #include "foxmath.h"
73 #include "fstd_types.h"
74 #include "rtc.h"
75 
76 #include <stdbool.h>
77 #include <stdint.h>
78 
79 /*========== Macros and Definitions =========================================*/
80 
81 /** @{
82  * multiplexer setup for the debug response message
83  */
84 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_START_BIT (0x7u)
85 #define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_LENGTH (8u)
86 /** @} */
87 
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)
95 
96 /** @{
97  * configuration of the BMS software version information signals for
98  * multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
99  */
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)
114 /** @} */
115 
116 /** @{
117  * configuration of the RTC signals for multiplexer 'RtcTime' in the
118  * 'DebugResponse' message
119  */
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)
136 /** @} */
137 
138 /** maximum distance from release that can be encoded in the boot message */
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")
142 #endif
143 
144 /** @{
145  * configuration of the lot message signals for multiplexer 'McuLotNumber'
146  * in the 'DebugResponse' message
147  */
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)
150 /** @} */
151 
152 /** @{
153  * configuration of the lot message signals for multiplexer 'McuLotNumber'
154  * in the 'DebugResponse' message
155  */
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)
158 /** @} */
159 
160 /** @{
161  * configuration of the wafer information message signals for multiplexer
162  * 'McuWaferInformation' in the 'DebugResponse' message
163  */
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)
170 /** @} */
171 
172 /** @{
173  * configuration of the boot message signals for multiplexer 'BootInformation'
174  * in the 'DebugResponse' message
175  */
176 #define CANTX_MUX_BOOT_SIGNAL_START_BIT (15u)
177 #define CANTX_MUX_BOOT_SIGNAL_LENGTH (56u)
178 /** @} */
179 
180 /** @{
181  * Magic data, i.e., bit muster, in the boot message
182  */
183 #define CANTX_BOOT_MAGIC_DATA_START (0xFEFEFEFEFEFEFEuLL)
184 #define CANTX_BOOT_MAGIC_DATA_END (0x01010101010101uLL)
185 /** @} */
186 
187 /** @{
188  * Register mapping of 'DIEIDL' (see #CANTX_TransmitMcuWaferInformation)
189  * x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF
190  * y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000
191  * wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
192  *
193  * source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
194  * */
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)
200 /** @} */
201 
202 /** @{
203  * configuration of the BMS software version information signals for
204  * multiplexer 'CommitHash' in the 'DebugResponse' message
205  */
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)
221 /** @} */
222 
223 /*========== Static Constant and Variable Definitions =======================*/
224 
225 /*========== Extern Constant and Variable Definitions =======================*/
226 
227 /*========== Static Function Prototypes =====================================*/
228 /**
229  * @brief Transmit the embedded software version information
230  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
231  */
233 
234 /**
235  * @brief Transmit the MCU's unique id
236  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
237  */
239 
240 /**
241  * @brief Transmit the MCU's lot number ID information
242  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
243  */
245 
246 /**
247  * @brief Transmit the MCU's wafer information
248  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
249  */
251 
252 /**
253  * @brief Transmit a boot message
254  * @param messageData message data to be put in the boot message
255  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
256  */
257 static STD_RETURN_TYPE_e CANTX_TransmitBootMagic(uint64_t messageData);
258 /**
259  * @brief Transmit the boot message and its magic start data
260  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
261  */
263 
264 /**
265  * @brief Transmit the boot message and its magic end data
266  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
267  */
269 
270 /**
271  * @brief Transmit the RTC time message
272  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
273  */
275 
276 /**
277  * @brief Transmit the commit hash
278  * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK
279 */
281 
282 /*========== Static Function Implementations ================================*/
283 
285  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
286 
287  /* Set release distance (capped to maximum value) */
288  const uint8_t distanceCapped = (uint8_t)MATH_MinimumOfTwoUint16_t(
290  uint8_t releaseDistanceOverflow = 0;
292  releaseDistanceOverflow = 1;
293  }
294  uint64_t isDirty = 0;
296  isDirty = 1;
297  }
298  uint64_t underVersionControl = 0;
300  underVersionControl = 1;
301  }
302 
303  uint64_t message = 0u;
305  &message,
311  &message,
317  &message,
323  &message,
329  &message,
332  distanceCapped,
335  &message,
338  releaseDistanceOverflow,
341  &message,
344  isDirty,
347  &message,
350  underVersionControl,
353  STD_RETURN_TYPE_e successfullyQueued =
355 
356  return successfullyQueued;
357 }
358 
360  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
361 
362  /* Read out device register with unique ID */
363  const uint32_t deviceRegister = systemREG1->DEVID;
364 
365  uint64_t message = 0u;
367  &message,
373  &message,
376  deviceRegister,
379 
380  STD_RETURN_TYPE_e successfullyQueued =
382  return successfullyQueued;
383 }
384 
386  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
387 
388  /* Read out device register with die ID high */
389  const uint32_t dieIdHigh = systemREG1->DIEIDH; /* equals the lot number */
390 
391  uint64_t message = 0u;
393  &message,
399  &message,
402  dieIdHigh,
405 
406  STD_RETURN_TYPE_e successfullyQueued =
408  return successfullyQueued;
409 }
410 
412  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
413 
414  /* Read out device register with die ID low */
415  /* SPNU563A-March 2018: 2.5.1.28 Die Identification Register Lower Word (DIEIDL) */
416  const uint64_t dieIdLow = (uint64_t)systemREG1->DIEIDL;
417 
418  /* see doxygen comment of the macros */
419  uint64_t xWaferCoordinate = dieIdLow & CANTX_WAFER_X_COORDINATE_BITMASK;
420  uint64_t yWaferCoordinate = (dieIdLow & CANTX_WAFER_Y_COORDINATE_BITMASK) >> CANTX_WAFER_Y_COORDINATE_SHIFT_12_BITS;
421  uint64_t waferNumber = (dieIdLow & CANTX_WAFER_NUMBER_BITMASK) >> CANTX_WAFER_NUMBER_SHIFT_24_BITS;
422 
423  uint64_t message = 0u;
425  &message,
431  &message,
434  waferNumber,
437  &message,
440  xWaferCoordinate,
443  &message,
446  yWaferCoordinate,
449  STD_RETURN_TYPE_e successfullyQueued =
451 
452  return successfullyQueued;
453 }
454 
455 static STD_RETURN_TYPE_e CANTX_TransmitBootMagic(uint64_t messageData) {
456  FAS_ASSERT((messageData == CANTX_BOOT_MAGIC_DATA_START) || (messageData == CANTX_BOOT_MAGIC_DATA_END));
457  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
458 
459  uint64_t message = 0u;
461  &message,
469  STD_RETURN_TYPE_e successfullyQueued =
471  return successfullyQueued;
472 }
473 
476 }
477 
480 }
481 
483  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
484 
485  RTC_TIME_DATA_s currentRtcTime = RTC_GetSystemTimeRtcFormat();
486 
487  uint64_t message = 0u;
489  &message,
495  &message,
498  currentRtcTime.hundredthOfSeconds,
501  &message,
504  currentRtcTime.seconds,
507  &message,
510  currentRtcTime.minutes,
513  &message,
516  currentRtcTime.hours,
519  &message,
522  currentRtcTime.weekday,
525  &message,
528  currentRtcTime.day,
531  &message,
534  currentRtcTime.month,
537  &message,
540  currentRtcTime.year,
542 
544  STD_RETURN_TYPE_e successfullyQueued =
546  return successfullyQueued;
547 }
548 
550  uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))};
551  uint64_t message = 0u;
552 
553  /* set message data with mux value and first seven chars of commit hash*/
555  &message,
562  &message,
565  signalData,
569  &message,
572  signalData,
576  &message,
579  signalData,
583  &message,
586  signalData,
590  &message,
593  signalData,
597  &message,
600  signalData,
604  &message,
607  signalData,
609 
611  STD_RETURN_TYPE_e successfullyQueued =
613 
614  return successfullyQueued;
615 }
616 
617 /*========== Extern Function Implementations ================================*/
619  STD_RETURN_TYPE_e successfullyQueued = STD_NOT_OK;
620  switch (action) {
622  successfullyQueued = CANTX_TransmitBmsVersionInfo();
623  break;
625  successfullyQueued = CANTX_TransmitMcuUniqueDieId();
626  break;
628  successfullyQueued = CANTX_TransmitMcuLotNumber();
629  break;
631  successfullyQueued = CANTX_TransmitMcuWaferInformation();
632  break;
634  successfullyQueued = CANTX_TransmitBootMagicStart();
635  break;
637  successfullyQueued = CANTX_TransmitBootMagicEnd();
638  break;
640  successfullyQueued = CANTX_TransmitRtcTime();
641  break;
643  successfullyQueued = CANTX_TransmitCommitHash();
644  break;
645  default:
647  break; /* LCOV_EXCL_LINE */
648  }
649  return successfullyQueued;
650 }
651 
652 /*========== Getter for static Variables (Unit Test) ========================*/
653 
654 /*========== Externalized Static Function Implementations (Unit Test) =======*/
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...
Definition: can.c:923
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
@ CAN_BIG_ENDIAN
Definition: can_cfg.h:158
#define CAN_NODE_DEBUG_MESSAGE
Definition: can_cfg.h:83
#define CAN_MAX_DLC
Definition: can_cfg.h:101
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....
Definition: can_helper.c:173
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...
Definition: can_helper.c:212
Headers for the helper functions for the CAN module.
Database module header.
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
Definition: fassert.h:251
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
Definition: fassert.h:129
uint16_t MATH_MinimumOfTwoUint16_t(const uint16_t value1, const uint16_t value2)
Returns the minimum of the passed uint16_t values.
Definition: foxmath.c:144
math library for often used math functions
Definition of foxBMS standard types.
STD_RETURN_TYPE_e
Definition: fstd_types.h:82
@ STD_NOT_OK
Definition: fstd_types.h:84
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).
Definition: general.h:250
#define GEN_STRIP(x)
Definition: general.h:261
RTC_TIME_DATA_s RTC_GetSystemTimeRtcFormat(void)
get the RTC system timer.
Definition: rtc.c:607
Header file of the RTC driver.
uint8_t hours
Definition: rtc.h:77
uint8_t minutes
Definition: rtc.h:76
uint8_t seconds
Definition: rtc.h:75
uint8_t month
Definition: rtc.h:80
uint8_t weekday
Definition: rtc.h:78
uint8_t hundredthOfSeconds
Definition: rtc.h:74
uint8_t year
Definition: rtc.h:81
uint8_t day
Definition: rtc.h:79
const bool isDirty
Definition: version_cfg.h:82
const char commitHash[VER_VERSION_STRUCT_MAXIMUM_COMMIT_HASH_LENGTH]
Definition: version_cfg.h:87
const uint8_t major
Definition: version_cfg.h:83
const bool underVersionControl
Definition: version_cfg.h:81
const uint8_t minor
Definition: version_cfg.h:84
const uint8_t patch
Definition: version_cfg.h:85
const uint16_t distanceFromLastRelease
Definition: version_cfg.h:86
Header file for the version information that is generated by the toolchain.
const VER_VERSION_s ver_foxbmsVersionInformation