MSS_UART_set_linsync_handler

Function MSS_UART_set_linsync_handler 

Source
pub unsafe extern "C" fn MSS_UART_set_linsync_handler(
    this_uart: *mut mss_uart_instance_t,
    handler: mss_uart_irq_handler_t,
)
Expand description

/ /** The MSS_UART_set_linsync_handler() function assigns a custom interrupt handler for the LIN Sync character detection interrupt when the MSS UART is operating in LIN mode.

Note: The MSS_UART_set_linsync_handler() function enables both the LIN SYNC interrupt in the MSS UART instance and the corresponding MSS UART instance interrupt in the PolarFire® SoC Core Complex PLIC as part of its implementation.

Note: You can disable the LIN SYNC interrupt when required by calling the MSS_UART_disable_irq() function. This is your choice and it depends upon your application.

@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 handler The handler parameter is the pointer to the custom handler function. This parameter is of mss_uart_irq_handler_t type.

@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_set_linsync_handler(&g_mss_uart0_lo, my_linsync_handler);

return(0); }

@endcode