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

General Description

Functions

uint8_t SelfTest_CAN (CAN_Type *base, const cy_stc_can_config_t *config, cy_stc_can_context_t *context, cy_en_can_test_mode_t testMode)
 This function performs a self-test of the CAN hardware.

Function Documentation

◆ SelfTest_CAN()

uint8_t SelfTest_CAN ( CAN_Type * base,
const cy_stc_can_config_t * config,
cy_stc_can_context_t * context,
cy_en_can_test_mode_t testMode )

This function performs a self-test of the CAN hardware.

It recconfigures the CAN module in the selected loopback mode and transmits test messages. The function verifies if the transmitted messages are received correctly and restores the original configuration.

Note
Do not call this function while the selected CAN instance is handling application bus traffic. The test temporarily reconfigures the CAN block into the requested loopback mode and transmits test messages.
Parameters
baseThe pointer to a CAN instance.
configThe pointer to the CAN configuration structure.
contextThe pointer to the CAN context structure allocated by the user.
testModeThe test mode to be used for the self-test.
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed