foxBMS - Unit Tests
1.5.0
The foxBMS Unit Tests API Documentation
|
Implementation for handling the transmit of debug response messages. More...
#include "general.h"
#include "can_cbs_tx_debug-response.h"
#include "version_cfg.h"
#include "HL_het.h"
#include "HL_reg_system.h"
#include "can.h"
#include "can_cfg_tx-message-definitions.h"
#include "can_helper.h"
#include "database.h"
#include "foxmath.h"
#include "fstd_types.h"
#include "rtc.h"
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
static STD_RETURN_TYPE_e | CANTX_TransmitBmsVersionInfo (void) |
Transmit the embedded software version information. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitMcuUniqueDieId (void) |
Transmit the MCU's unique id. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitMcuLotNumber (void) |
Transmit the MCU's lot number ID information. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitMcuWaferInformation (void) |
Transmit the MCU's wafer information. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitBootMagic (uint64_t messageData) |
Transmit a boot message. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitBootMagicStart (void) |
Transmit the boot message and its magic start data. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitBootMagicEnd (void) |
Transmit the boot message and its magic end data. More... | |
static STD_RETURN_TYPE_e | CANTX_TransmitRtcTime (void) |
Transmit the RTC time message. More... | |
STD_RETURN_TYPE_e | CANTX_DebugResponse (CANTX_DEBUG_RESPONSE_ACTIONS_e action) |
Handles Debug response message. More... | |
Implementation for handling the transmit of debug response messages.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Implementation of the interface for transmitting debug response messages (CANTX_DebugResponse). The interface only serves as a wrapper that calls internally the respective functions to transmit the debug data.
Definition in file can_cbs_tx_debug-response.c.
#define CANTX_BOOT_MAGIC_DATA_END (0b00000001000000010000000100000001000000010000000100000001uLL) |
Magic data, i.e., bit muster, in the boot message
Definition at line 183 of file can_cbs_tx_debug-response.c.
#define CANTX_BOOT_MAGIC_DATA_START (0b11111110111111101111111011111110111111101111111011111110uLL) |
Magic data, i.e., bit muster, in the boot message
Definition at line 182 of file can_cbs_tx_debug-response.c.
#define CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE (31u) |
maximum distance from release that can be encoded in the boot message
Definition at line 138 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_LENGTH (8u) |
multiplexer setup for the debug message
Definition at line 85 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_START_BIT (0x7u) |
multiplexer setup for the debug message
Definition at line 84 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BMS_SOFTWARE_VERSION_INFO (0x00u) |
Definition at line 88 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_BOOT_INFORMATION (0x0Fu) |
Definition at line 93 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_LOT_NUMBER (0x02u) |
Definition at line 90 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_UNIQUE_DIE_ID (0x01u) |
Definition at line 89 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_MCU_WAFER_INFORMATION (0x03u) |
Definition at line 91 of file can_cbs_tx_debug-response.c.
#define CANTX_DEBUG_RESPONSE_MESSAGE_MUX_VALUE_RTC_TIME (0x04u) |
Definition at line 92 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_LENGTH (1u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 110 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_DIRTY_FLAG_START_BIT (33u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 109 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_LENGTH (8u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 100 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MAJOR_VERSION_START_BIT (15u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 99 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_LENGTH (8u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 102 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_MINOR_VERSION_START_BIT (23u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 101 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_LENGTH (8u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 104 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_PATCH_VERSION_START_BIT (31u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 103 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_LENGTH (5u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 106 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_LENGTH (1u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 108 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_OVERFLOW_START_BIT (34u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 107 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_RELEASE_DISTANCE_START_BIT (39u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 105 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_LENGTH (1u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 112 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BMS_SOFTWARE_VERSION_INFO_SIGNAL_UNDER_VERSION_CONTROL_START_BIT (32u) |
configuration of the BMS software version information signals for multiplexer 'BmsSoftwareVersionInfo' in the 'DebugResponse' message
Definition at line 111 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BOOT_SIGNAL_LENGTH (56u) |
configuration of the boot message signals for multiplexer 'BootInformation' in the 'DebugResponse' message
Definition at line 176 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_BOOT_SIGNAL_START_BIT (15u) |
configuration of the boot message signals for multiplexer 'BootInformation' in the 'DebugResponse' message
Definition at line 175 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_LENGTH (32u) |
configuration of the lot message signals for multiplexer 'McuLotNumber' in the 'DebugResponse' message
Definition at line 156 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_LOT_NUMBER_SIGNAL_LOT_NUMBER_START_BIT (15u) |
configuration of the lot message signals for multiplexer 'McuLotNumber' in the 'DebugResponse' message
Definition at line 155 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_LENGTH (32u) |
configuration of the lot message signals for multiplexer 'McuLotNumber' in the 'DebugResponse' message
Definition at line 148 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_UNIQUE_DIE_ID_SIGNAL_UNIQUE_DIE_ID_START_BIT (15u) |
configuration of the lot message signals for multiplexer 'McuLotNumber' in the 'DebugResponse' message
Definition at line 147 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_LENGTH (8u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 164 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_WAFER_NUMBER_START_BIT (15u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 163 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_LENGTH (12u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 166 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_X_WAFER_COORDINATE_START_BIT (27u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 165 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_LENGTH (12u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 168 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_MCU_WAFER_INFORMATION_SIGNAL_Y_WAFER_COORDINATE_START_BIT (23u) |
configuration of the wafer information message signals for multiplexer 'McuWaferInformation' in the 'DebugResponse' message
Definition at line 167 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_DAY_LENGTH (5u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 130 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_DAY_START_BIT (36u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 129 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_HOURS_LENGTH (5u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 126 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_HOURS_START_BIT (28u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 125 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_LENGTH (7u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 120 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_HUNDREDTH_OF_SECONDS_START_BIT (15u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 119 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_MINUTES_LENGTH (6u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 124 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_MINUTES_START_BIT (18u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 123 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_MONTH_LENGTH (4u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 132 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_MONTH_START_BIT (47u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 131 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_SECONDS_LENGTH (6u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 122 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_SECONDS_START_BIT (8u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 121 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_WEEKDAY_LENGTH (3u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 128 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_WEEKDAY_START_BIT (39u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 127 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_YEAR_LENGTH (7u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 134 of file can_cbs_tx_debug-response.c.
#define CANTX_MUX_RTC_SIGNAL_YEAR_START_BIT (43u) |
configuration of the RTC signals for multiplexer 'RtcTime' in the 'DebugResponse' message
Definition at line 133 of file can_cbs_tx_debug-response.c.
#define CANTX_WAFER_NUMBER_BITMASK (0xFF000000uLL) |
Register mapping of 'DIEIDL' (see CANTX_TransmitMcuWaferInformation) x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000 wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
Definition at line 197 of file can_cbs_tx_debug-response.c.
#define CANTX_WAFER_NUMBER_SHIFT_24_BITS (24uLL) |
Register mapping of 'DIEIDL' (see CANTX_TransmitMcuWaferInformation) x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000 wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
Definition at line 198 of file can_cbs_tx_debug-response.c.
#define CANTX_WAFER_X_COORDINATE_BITMASK (0x00000FFFuLL) |
Register mapping of 'DIEIDL' (see CANTX_TransmitMcuWaferInformation) x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000 wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
Definition at line 194 of file can_cbs_tx_debug-response.c.
#define CANTX_WAFER_Y_COORDINATE_BITMASK (0x00FFF000uLL) |
Register mapping of 'DIEIDL' (see CANTX_TransmitMcuWaferInformation) x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000 wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
Definition at line 195 of file can_cbs_tx_debug-response.c.
#define CANTX_WAFER_Y_COORDINATE_SHIFT_12_BITS (12uLL) |
Register mapping of 'DIEIDL' (see CANTX_TransmitMcuWaferInformation) x-coordinate: bits 0-11 -> 0b_0000_00000_0000_0000_0000_1111_1111_1111 = 0x_0000_0FFF y-coordinate: bits 12-23 -> 0b_0000_00000_1111_1111_1111_0000_0000_0000 = 0x_00FF_F000 wafer number: bits 24-32 -> 0b_1111_11111_0000_0000_0000_0000_0000_0000 = 0x_FF00_0000
source : SPNU563A-March 2018: Table 2-47. Die Identification Register, Lower Word (DIEIDL) Field Descriptions
Definition at line 196 of file can_cbs_tx_debug-response.c.
STD_RETURN_TYPE_e CANTX_DebugResponse | ( | CANTX_DEBUG_RESPONSE_ACTIONS_e | action | ) |
Handles Debug response message.
action | type of information that should be sent |
Definition at line 522 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the embedded software version information.
Definition at line 256 of file can_cbs_tx_debug-response.c.
|
static |
Transmit a boot message.
messageData | message data to be put in the boot message |
Definition at line 427 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the boot message and its magic end data.
Definition at line 450 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the boot message and its magic start data.
Definition at line 446 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the MCU's lot number ID information.
Definition at line 357 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the MCU's unique id.
Definition at line 331 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the MCU's wafer information.
Definition at line 383 of file can_cbs_tx_debug-response.c.
|
static |
Transmit the RTC time message.
Definition at line 454 of file can_cbs_tx_debug-response.c.