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

General Description

Functions

uint8_t SelfTest_UART_SCB (CySCB_Type *base)
 This function tests a loopback of UART (transmitted byte must be equal to received).

Function Documentation

◆ SelfTest_UART_SCB()

uint8_t SelfTest_UART_SCB ( CySCB_Type * base)

This function tests a loopback of UART (transmitted byte must be equal to received).

This function should be called repeatedly while it returns the PASS_STILL_TESTING_STATUS status. The test is complete when PASS_COMPLETE_STATUS or any error status is returned.

Parameters
baseThe pointer to SCB hardware to configure.
Returns
ERROR_STATUS (1) - Test failed
PASS_STILL_TESTING_STATUS (2) - Still testing
PASS_COMPLETE_STATUS (3) - Test completed OK
ERROR_TX_NOT_EMPTY (4) - TX buffer is not empty
ERROR_RX_NOT_EMPTY (5) - RX buffer is not empty
ERROR_UART_NOT_ENABLE (6) - UART block is not enabled
Note
During a call, the function transmits and receives bytes from 0x00 to 0xFF. The user is responsible for the routing the loop back before the test. Do not call this function while application traffic is active on the same UART instance. The test clears RX/TX FIFOs and temporarily disables UART RX/TX interrupt masks while each byte is checked.