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
-
| base | The pointer to a CAN instance.
|
| config | The pointer to the CAN configuration structure. |
| context | The pointer to the CAN context structure allocated by the user. |
| testMode | The test mode to be used for the self-test. |
- Returns
- OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed