MSS_UART_irq_tx

Function MSS_UART_irq_tx 

Source
pub unsafe extern "C" fn MSS_UART_irq_tx(
    this_uart: *mut mss_uart_instance_t,
    pbuff: *const u8,
    tx_size: u32,
)
Expand description

/ /** The function MSS_UART_irq_tx() initiates an interrupt-driven transmit. It returns immediately after passing the transmit buffer location to the MMUART instance and enabling transmit interrupts both at the UART and the PolarFire® SoC Core Complex PLIC level. This function takes a pointer, the pbuff parameter, to a memory buffer containing the data to transmit. The memory buffer specified through this pointer must remain allocated and contain the data to transmit until the transmit completion is detected through calling the MSS_UART_tx_complete() function. The actual transmission over the serial connection is still in progress until calls to the MSS_UART_tx_complete() function indicate transmit completion.

Note: The MSS_UART_irq_tx() function enables both the transmit holding register empty (THRE) interrupt in the UART and the MSS UART instance interrupt in the PolarFire® SoC Core Complex PLIC as part of its implementation.

@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 pbuff The pbuff parameter is a pointer to a buffer containing the data to transmit.

@param tx_size The tx_size parameter specifies the size, in bytes, of the data to transmit.

@return This function does not return a value.

@example @code #include “mss_uart.h”

int main(void) { uint8_t tx_buff[10] = “abcdefghi”;

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_irq_tx(&g_mss_uart0_lo, tx_buff, sizeof(tx_buff));

while(0 == MSS_UART_tx_complete(&g_mss_uart0_lo)) { ; } return(0); } @endcode