RTEMS  5.0.0
Data Structures | Typedefs | Enumerations | Functions
alt_16550_uart.h File Reference
#include "hwlib.h"
#include "alt_clock_manager.h"

Go to the source code of this file.

Data Structures

struct  ALT_16550_HANDLE_s
 

Typedefs

typedef enum ALT_16550_DEVICE_e ALT_16550_DEVICE_t
 
typedef struct ALT_16550_HANDLE_s ALT_16550_HANDLE_t
 
typedef enum ALT_16550_FIFO_TRIGGER_RX_e ALT_16550_FIFO_TRIGGER_RX_t
 
typedef enum ALT_16550_FIFO_TRIGGER_TX_e ALT_16550_FIFO_TRIGGER_TX_t
 
typedef enum ALT_16550_BAUDRATE_e ALT_16550_BAUDRATE_t
 
typedef enum ALT_16550_INT_STATUS_e ALT_16550_INT_STATUS_t
 
typedef enum ALT_16550_MODEM_STATUS_e ALT_16550_MODEM_STATUS_t
 
typedef enum ALT_16550_DATABITS_e ALT_16550_DATABITS_t
 
typedef enum ALT_16550_STOPBITS_e ALT_16550_STOPBITS_t
 
typedef enum ALT_16550_PARITY_e ALT_16550_PARITY_t
 
typedef enum ALT_16550_LINE_STATUS_e ALT_16550_LINE_STATUS_t
 

Enumerations

enum  ALT_16550_DEVICE_e { ALT_16550_DEVICE_SOCFPGA_UART0 = 0, ALT_16550_DEVICE_SOCFPGA_UART1 = 1, ALT_16550_DEVICE_ALTERA_16550_UART = 0x100 }
 
enum  ALT_16550_FIFO_TRIGGER_RX_e { ALT_16550_FIFO_TRIGGER_RX_ANY = 0, ALT_16550_FIFO_TRIGGER_RX_QUARTER_FULL = 1, ALT_16550_FIFO_TRIGGER_RX_HALF_FULL = 2, ALT_16550_FIFO_TRIGGER_RX_ALMOST_FULL = 3 }
 
enum  ALT_16550_FIFO_TRIGGER_TX_e { ALT_16550_FIFO_TRIGGER_TX_EMPTY = 0, ALT_16550_FIFO_TRIGGER_TX_ALMOST_EMPTY = 1, ALT_16550_FIFO_TRIGGER_TX_QUARTER_FULL = 2, ALT_16550_FIFO_TRIGGER_TX_HALF_FULL = 3 }
 
enum  ALT_16550_BAUDRATE_e {
  ALT_16550_BAUDRATE_50 = 50, ALT_16550_BAUDRATE_75 = 75, ALT_16550_BAUDRATE_150 = 150, ALT_16550_BAUDRATE_300 = 300,
  ALT_16550_BAUDRATE_600 = 600, ALT_16550_BAUDRATE_900 = 900, ALT_16550_BAUDRATE_1200 = 1200, ALT_16550_BAUDRATE_1800 = 1800,
  ALT_16550_BAUDRATE_2400 = 2400, ALT_16550_BAUDRATE_3600 = 3600, ALT_16550_BAUDRATE_4800 = 4800, ALT_16550_BAUDRATE_7200 = 7200,
  ALT_16550_BAUDRATE_9600 = 9600, ALT_16550_BAUDRATE_14400 = 14400, ALT_16550_BAUDRATE_19200 = 19200, ALT_16550_BAUDRATE_28800 = 28800,
  ALT_16550_BAUDRATE_38400 = 38400, ALT_16550_BAUDRATE_57600 = 57600, ALT_16550_BAUDRATE_115200 = 115200
}
 
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
}
 
enum  ALT_16550_MODEM_STATUS_e {
  ALT_16550_MODEM_STATUS_DCD = 1 << 7, ALT_16550_MODEM_STATUS_RI = 1 << 6, ALT_16550_MODEM_STATUS_DSR = 1 << 5, ALT_16550_MODEM_STATUS_CTS = 1 << 4,
  ALT_16550_MODEM_STATUS_DDCD = 1 << 3, ALT_16550_MODEM_STATUS_TERI = 1 << 2, ALT_16550_MODEM_STATUS_DDSR = 1 << 1, ALT_16550_MODEM_STATUS_DCTS = 1 << 0
}
 
enum  ALT_16550_DATABITS_e { ALT_16550_DATABITS_5 = 0, ALT_16550_DATABITS_6 = 1, ALT_16550_DATABITS_7 = 2, ALT_16550_DATABITS_8 = 3 }
 
enum  ALT_16550_STOPBITS_e { ALT_16550_STOPBITS_1 = 0, ALT_16550_STOPBITS_2 = 1 }
 
enum  ALT_16550_PARITY_e { ALT_16550_PARITY_DISABLE = 0, ALT_16550_PARITY_ODD = 1, ALT_16550_PARITY_EVEN = 2 }
 
enum  ALT_16550_LINE_STATUS_e {
  ALT_16550_LINE_STATUS_RFE = 1 << 7, ALT_16550_LINE_STATUS_TEMT = 1 << 6, ALT_16550_LINE_STATUS_THRE = 1 << 5, ALT_16550_LINE_STATUS_BI = 1 << 4,
  ALT_16550_LINE_STATUS_FE = 1 << 3, ALT_16550_LINE_STATUS_PE = 1 << 2, ALT_16550_LINE_STATUS_OE = 1 << 1, ALT_16550_LINE_STATUS_DR = 1 << 0
}
 

Functions

ALT_STATUS_CODE alt_16550_init (ALT_16550_DEVICE_t device, void *location, alt_freq_t clock_freq, ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_uninit (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_reset (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_read (ALT_16550_HANDLE_t *handle, char *item)
 
ALT_STATUS_CODE alt_16550_write (ALT_16550_HANDLE_t *handle, char item)
 
ALT_STATUS_CODE alt_16550_fifo_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_fifo_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_fifo_read (ALT_16550_HANDLE_t *handle, char *buffer, size_t count)
 
ALT_STATUS_CODE alt_16550_fifo_write (ALT_16550_HANDLE_t *handle, const char *buffer, size_t count)
 
ALT_STATUS_CODE alt_16550_fifo_clear_rx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_fifo_clear_tx (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_fifo_clear_all (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_fifo_size_get_rx (ALT_16550_HANDLE_t *handle, uint32_t *size)
 
ALT_STATUS_CODE alt_16550_fifo_size_get_tx (ALT_16550_HANDLE_t *handle, uint32_t *size)
 
ALT_STATUS_CODE alt_16550_fifo_level_get_rx (ALT_16550_HANDLE_t *handle, uint32_t *level)
 
ALT_STATUS_CODE alt_16550_fifo_level_get_tx (ALT_16550_HANDLE_t *handle, uint32_t *level)
 
ALT_STATUS_CODE alt_16550_fifo_trigger_set_rx (ALT_16550_HANDLE_t *handle, ALT_16550_FIFO_TRIGGER_RX_t trigger)
 
ALT_STATUS_CODE alt_16550_fifo_trigger_set_tx (ALT_16550_HANDLE_t *handle, ALT_16550_FIFO_TRIGGER_TX_t trigger)
 
ALT_STATUS_CODE alt_16550_baudrate_get (ALT_16550_HANDLE_t *handle, uint32_t *baudrate)
 
ALT_STATUS_CODE alt_16550_baudrate_set (ALT_16550_HANDLE_t *handle, uint32_t baudrate)
 
ALT_STATUS_CODE alt_16550_divisor_get (ALT_16550_HANDLE_t *handle, uint32_t *divisor)
 
ALT_STATUS_CODE alt_16550_divisor_set (ALT_16550_HANDLE_t *handle, uint32_t divisor)
 
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)
 
ALT_STATUS_CODE alt_16550_flowcontrol_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_flowcontrol_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_loopback_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_loopback_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_out1 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_out1 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_out2 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_out2 (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_rts (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_rts (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_enable_dtr (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_disable_dtr (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_modem_status_get (ALT_16550_HANDLE_t *handle, uint32_t *status)
 
ALT_STATUS_CODE alt_16550_line_config_set (ALT_16550_HANDLE_t *handle, ALT_16550_DATABITS_t databits, ALT_16550_PARITY_t parity, ALT_16550_STOPBITS_t stopbits)
 
ALT_STATUS_CODE alt_16550_line_break_enable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_line_break_disable (ALT_16550_HANDLE_t *handle)
 
ALT_STATUS_CODE alt_16550_line_status_get (ALT_16550_HANDLE_t *handle, uint32_t *status)