pub unsafe extern "C" fn MSS_UART_init(
this_uart: *mut mss_uart_instance_t,
baud_rate: u32,
line_config: u8,
)Expand description
/ /** The MSS_UART_init() function initializes and configures one of the PolarFire® SoC MSS UARTs with the configuration passed as parameters. The configuration parameters are the baud_rate, which generates the baud value, and the line_config, which specifies the line configuration (bit length, Stop bits, and parity).
@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 baud_rate The baud_rate parameter specifies the baud rate. It can be specified for common baud rates using the following defines:
- MSS_UART_110_BAUD
- MSS_UART_300_BAUD
- MSS_UART_600_BAUD
- MSS_UART_1200_BAUD
- MSS_UART_2400_BAUD
- MSS_UART_4800_BAUD
- MSS_UART_9600_BAUD
- MSS_UART_19200_BAUD
- MSS_UART_38400_BAUD
- MSS_UART_57600_BAUD
- MSS_UART_115200_BAUD
- MSS_UART_230400_BAUD
- MSS_UART_460800_BAUD
- MSS_UART_921600_BAUD Alternatively, any nonstandard baud rate can be specified by simply passing the actual required baud rate as the value for this parameter.
@param line_config The line_config parameter is the line configuration that specifies the bit length, number of Stop bits, and parity settings. This is a bitwise OR of one value from each of the following groups of allowed values:
- One of the following to specify the transmit/receive data bit length:
- MSS_UART_DATA_5_BITS
- MSS_UART_DATA_6_BITS
- MSS_UART_DATA_7_BITS
- MSS_UART_DATA_8_BITS
- One of the following to specify the parity setting:
- MSS_UART_EVEN_PARITY
- MSS_UART_NO_PARITY
- MSS_UART_ODD_PARITY
- MSS_UART_STICK_PARITY_0
- MSS_UART_STICK_PARITY_1
- One of the following to specify the number of Stop bits:
- MSS_UART_ONE_STOP_BIT
- MSS_UART_ONEHALF_STOP_BIT
- MSS_UART_TWO_STOP_BITS
@return This function does not return a value.
@example @code #include “mss_uart.h”
int main(void) { 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);
return(0); } @endcode