ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Functions

uint8_t SelfTest_CANFD (CANFD_Type *base, uint32_t chan, const cy_stc_canfd_config_t *config, cy_stc_canfd_context_t *context, cy_stc_canfd_test_mode_t test_mode)
 This function configure the CANFD channel in an internal loopback and then it is configure to accept message IDs in the range 0x50 to 0x55 and a message with message ID 0x60 is transmitted and RX fifo is verified to be empty.

Function Documentation

◆ SelfTest_CANFD()

uint8_t SelfTest_CANFD ( CANFD_Type * base,
uint32_t chan,
const cy_stc_canfd_config_t * config,
cy_stc_canfd_context_t * context,
cy_stc_canfd_test_mode_t test_mode )

This function configure the CANFD channel in an internal loopback and then it is configure to accept message IDs in the range 0x50 to 0x55 and a message with message ID 0x60 is transmitted and RX fifo is verified to be empty.

Similarly, a message with message ID 0x50 is transmitted and the message received in RX FIFO is verified.

Note
Do not call this function while the selected CAN FD channel is handling application bus traffic. Internal test mode keeps the test inside the CAN FD block; external test mode also drives the external CAN FD pins.
Parameters
baseThe pointer to a CAN FD instance
chanThe CAN FD channel number
configThe pointer to the CAN FD configuration structure
contextThe pointer to the context structure allocated by the user. The structure is used during the CAN FD operation for internal configuration and data retention. The user must not modify anything in this structure.
test_modeinternal: will not drive the pin
external: will drive the external pins along with loopback
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed