Skip to main content

MSS_UART_set_loopback

Function MSS_UART_set_loopback 

Source
pub unsafe extern "C" fn MSS_UART_set_loopback(
    this_uart: *mut mss_uart_instance_t,
    loopback: mss_uart_loopback_t,
)
Expand description

/ /** The MSS_UART_set_loopback() function is used to locally loop-back the Tx and Rx lines of a UART. This is not to be confused with the loop-back of UART0 to UART1, which can be achieved through the microprocessor subsystem’s system registers.

@param this_uart The this_uart parameter is a pointer to an mss_uart_instance_t structure that identifies the MSS UART hardware block performing the requested function. There are ten such data structures. The data structures from g_mss_uart0_lo to g_mss_uart4_lo are associated with MSS UART0 to MSS UART4 when they are connected on the AXI switch slave 5 (main APB bus). The data structures g_mss_uart0_hi to g_mss_uart4_hi are associated with MSS UART0 to MSS UART4 when they are connected on the AXI switch slave 6 (AMP APB bus). This parameter must point to one of these ten global data structure defined within the UART driver. Note: If you are using the UART on the AMP APB bus, the hardware configuration to connect UART on AMP APB bus must already be done by the application using SYSREG registers before initializing the UART instance structure.

@param loopback The loopback parameter indicates whether or not the UART’s transmit and receive lines should be looped back. Following are the allowed values:

  • MSS_UART_LOCAL_LOOPBACK_ON
  • MSS_UART_LOCAL_LOOPBACK_OFF
  • MSS_UART_REMOTE_LOOPBACK_ON
  • MSS_UART_REMOTE_LOOPBACK_OFF
  • MSS_UART_AUTO_ECHO_ON
  • MSS_UART_AUTO_ECHO_OFF

@return This function does not return a value.

@example @code MSS_UART_init(&g_mss_uart0_lo, MSS_UART_57600_BAUD, MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT);

MSS_UART_set_loopback(&g_mss_uart0_lo, MSS_UART_LOCAL_LOOPBACK_OFF); @endcode