RTEMS  5.1
Typedefs | Enumerations | Functions

Typedefs

typedef enum ALT_16550_INT_STATUS_e ALT_16550_INT_STATUS_t
 

Enumerations

enum  ALT_16550_INT_STATUS_e {
  ALT_16550_INT_STATUS_LINE = 0x6, ALT_16550_INT_STATUS_RX_DATA = 0x4, ALT_16550_INT_STATUS_RX_TIMEOUT = 0xC, ALT_16550_INT_STATUS_TX_IDLE = 0x2,
  ALT_16550_INT_STATUS_MODEM = 0x0, ALT_16550_INT_STATUS_NONE = 0x1
}
 

Functions

ALT_STATUS_CODE alt_16550_int_enable_rx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_disable_rx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_enable_tx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_disable_tx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_enable_line (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_disable_line (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_enable_modem (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_disable_modem (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_disable_all (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_int_status_get (ALT_16550_HANDLE_t *handle, ALT_16550_INT_STATUS_t *status)
 

Detailed Description

This group of APIs provides access, configuration, and control of the UART interrupts.

Typedef Documentation

◆ ALT_16550_INT_STATUS_t

This type definition enumerates the different interrupt conditions that can be generated by the UART controller.

Interrupts are listed in highest to lowest priority order.

Enumeration Type Documentation

◆ ALT_16550_INT_STATUS_e

This type definition enumerates the different interrupt conditions that can be generated by the UART controller.

Interrupts are listed in highest to lowest priority order.

Enumerator
ALT_16550_INT_STATUS_LINE 

This interrupt signals that a overrun, parity, or framing error occurred, or a break event occured. The interrupt is cleared by reading the line status by calling alt_16550_line_status_get() or by disabling line status interrupts by calling alt_16550_int_disable_line().

ALT_16550_INT_STATUS_RX_DATA 

This interrupt signals that some data is available to be read from the UART. The definition of some depends on whether FIFOs are enabled or not.

If FIFOs are disabled, this interrupt signals that the receiver contains data. In this case, the interrupt is cleared by reading the data from the UART by calling alt_16550_read().

If FIFOs are enabled, this interrupt signals that the receiver FIFO level is above the receiver trigger level specified. In this case, the interrupt is cleared by reading a sufficiently large buffer from the receiver FIFO such that the FIFO is filled below the receiver trigger level specified by calling alt_16550_fifo_read() or by adjusting the receiver trigger level appropriately by calling alt_16550_fifo_trigger_set_rx().

In either case, this interrupt can also be cleared by disabling receiver interrupts by calling alt_16550_int_disable_rx().

ALT_16550_INT_STATUS_RX_TIMEOUT 

This interrupt signals that data is available in the receiver FIFO and that there has been no activity with the receiver FIFO for the last 4 character frames. In essence, the receiver FIFO has temporarily settled thus it may be a good time to empty the receiver FIFO. This interrupt is only available if FIFOs are enabled. The interrupt is cleared by reading from the receiver FIFO by calling alt_16550_fifo_read() or by disabling receiver interrupts by calling alt_16550_int_disable_rx().

ALT_16550_INT_STATUS_TX_IDLE 

This interrupt signals that the transmitter is idling. The definition of idling depends on whether FIFOs are enabled or not.

If FIFOs are disabled, this interrupt signals that the transmitter shift register is empty. In this case, the interrupt is cleared by writing data to the UART by calling alt_16550_write().

If FIFO are enabled, this interrupt signals that the transmitter FIFO level is below the transmitter trigger level specified. In this case, the interrupt is cleared by writing a sufficiently large buffer to the transmitter FIFO such that the FIFO is filled above the transmitter trigger level specified by calling alt_16550_fifo_write() or by adjusting the transmitter trigger level appropriately by calling alt_16550_fifo_trigger_set_tx().

In either case, this interrupt can also be cleared by disabling transmitter interrupts by calling alt_16550_int_disable_tx().

ALT_16550_INT_STATUS_MODEM 

Modem status interrupt pending. The interrupt is cleared by reading the modem status by calling alt_16550_modem_status_get() or by disabling modem status interrupts by calling alt_16550_int_disable_modem().

ALT_16550_INT_STATUS_NONE 

No interrupts pending.

Function Documentation

◆ alt_16550_int_disable_all()

ALT_STATUS_CODE alt_16550_int_disable_all ( ALT_16550_HANDLE_t handle)

Disables all interrupts on the UART.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_disable_line()

ALT_STATUS_CODE alt_16550_int_disable_line ( ALT_16550_HANDLE_t handle)

Disables the receiver from generating line status interrupts.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_disable_modem()

ALT_STATUS_CODE alt_16550_int_disable_modem ( ALT_16550_HANDLE_t handle)

Disables the UART from generate modem status interrupts.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_disable_rx()

ALT_STATUS_CODE alt_16550_int_disable_rx ( ALT_16550_HANDLE_t handle)

Disables the receiver FIFO from generating interrupts.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_disable_tx()

ALT_STATUS_CODE alt_16550_int_disable_tx ( ALT_16550_HANDLE_t handle)

Disables the transmitter FIFO from generating interrupts.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_enable_line()

ALT_STATUS_CODE alt_16550_int_enable_line ( ALT_16550_HANDLE_t handle)

Enables the receiver to generate line status interrupts. Enabling this interrupt allows for the following interrupt signal(s):

  • ALT_16550_INT_STATUS_LINE

This interrupt is disabled by default.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_enable_modem()

ALT_STATUS_CODE alt_16550_int_enable_modem ( ALT_16550_HANDLE_t handle)

Enables the UART to generate modem status interrupts. Enabling this interrupt allows for the following interrupt signal(s):

  • ALT_16550_INT_STATUS_MODEM

This interrupt is disabled by default.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_enable_rx()

ALT_STATUS_CODE alt_16550_int_enable_rx ( ALT_16550_HANDLE_t handle)

Enables the receiver FIFO to generate interrupts. Enabling this interrupt allows for the following interrupt signal(s):

  • ALT_16550_INT_STATUS_RX_DATA
  • ALT_16550_INT_STATUS_RX_TIMEOUT

This interrupt is disabled by default.

The FIFOs must also be enabled for this interrupt to actually be generated.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_enable_tx()

ALT_STATUS_CODE alt_16550_int_enable_tx ( ALT_16550_HANDLE_t handle)

Enables the transmitter FIFO to generate interrupts. Enabling this interrupt allows for the following interrupt signal(s):

  • ALT_16550_INT_STATUS_TX_IDLE

This interrupt is disabled by default.

The FIFOs must also be enabled for this interrupt to actually be generated.

Parameters
handleThe UART device handle.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.

◆ alt_16550_int_status_get()

ALT_STATUS_CODE alt_16550_int_status_get ( ALT_16550_HANDLE_t handle,
ALT_16550_INT_STATUS_t status 
)

Queries the interrupt status of the UART. This returns the highest priority interrupt pending. The appropriate interrupts must be enabled for them be generated in the UART.

Parameters
handleThe UART device handle.
status[out] Pointer to an output parameter that contains the current interrupt status of the UART.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given UART device handle is invalid.