uart_irq_update

Function uart_irq_update 

Source
pub unsafe extern "C" fn uart_irq_update(dev: *const device) -> i32
Expand description

@brief Start processing interrupts in ISR.

This function should be called the first thing in the ISR. Calling uart_irq_rx_ready(), uart_irq_tx_ready(), uart_irq_tx_complete() allowed only after this.

The purpose of this function is:

  • For devices with auto-acknowledge of interrupt status on register read to cache the value of this register (rx_ready, etc. then use this case).
  • For devices with explicit acknowledgment of interrupts, to ack any pending interrupts and likewise to cache the original value.
  • For devices with implicit acknowledgment, this function will be empty. But the ISR must perform the actions needs to ack the interrupts (usually, call uart_fifo_read() on rx_ready, and uart_fifo_fill() on tx_ready).

@param dev UART device instance.

@retval 1 On success. @retval -ENOSYS If this function is not implemented. @retval -ENOTSUP If API is not enabled.