Visible to Intel only — GUID: iga1404929720635
Ixiasoft
Visible to Intel only — GUID: iga1404929720635
Ixiasoft
10.3.5.1. Public APIs
Prototype: | altera_16550_uart_state* altera_16550_uart_open (const char *name); |
Include: | <altera_16550_uart.h> |
Parameters: | name—the 16550 UART device name to open. |
Returns: | Pointer to 16550 UART or NULL if fail to open |
Description | Open 16550 UART device. |
Prototype: | int altera_16550_uart_close(altera_16550_uart_state* sp, int flags); |
Include: | <altera_16550_uart.h> |
Parameters: | sp—the 16550 UART device name to close. flags—for indicating blocking/non-blocking access for single/multi threaded. |
Returns: | None |
Description: | Closes 16550 UART device. |
Prototype: | int altera_16550_uart_read(altera_16550_uart_state* sp, wchar_t* ptr, int len, int flags); |
Include: | <altera_16550_uart.h> |
Parameters: | sp - The UART device ptr – destination address len – maximum length of the data flags – for indicating blocking/non-blocking access for single/multi threaded |
Returns: | Number of bytes read |
Description: | Read data to the UART receiver buffer. UART required to be in a known settings prior executing this function |
Prototype: | int altera_16550_uart_write(altera_16550_uart_state* sp, const wchar_t* ptr, int len, int flags); |
Include: | <altera_16550_uart.h> |
Parameters: | sp - The UART device ptr – source address len – maximum length of the data flags – for indicating blocking/non-blocking access for single/multi threaded |
Returns: | Number of bytes written |
Description: | Writes data to the UART transmitter buffer. UART required to be in a known settings prior executing this function |
Prototype: | alt_u32 alt_16550_uart_config(altera_16550_uart_state* sp, UartConfig *setting); |
Include: | <altera_16550_uart.h> |
Parameters: | sp - The UART device setting – UART configuration structure to configure UART (refer to UART device structure) |
Returns: | Return 0 for success otherwise fail |
Description: | Configure UART per user input before initiating read or write |