uart_fifo_fill

Function uart_fifo_fill 

Source
pub unsafe extern "C" fn uart_fifo_fill(
    dev: *const device,
    tx_data: *const u8,
    size: i32,
) -> i32
Expand description

@brief Fill FIFO with data.

@details This function is expected to be called from UART interrupt handler (ISR), if uart_irq_tx_ready() returns true. Result of calling this function not from an ISR is undefined (hardware-dependent). Likewise, not calling this function from an ISR if uart_irq_tx_ready() returns true may lead to undefined behavior, e.g. infinite interrupt loops. It’s mandatory to test return value of this function, as different hardware has different FIFO depth (oftentimes just 1).

@param dev UART device instance. @param tx_data Data to transmit. @param size Number of bytes to send.

@return Number of bytes sent. @retval -ENOSYS if this function is not supported @retval -ENOTSUP If API is not enabled.