Visible to Intel only — GUID: ecf1661953034890
Ixiasoft
Visible to Intel only — GUID: ecf1661953034890
Ixiasoft
56.5.1.1.1. UART API
- Lightweight UART is a character device. Instead of calling public API directly, you must use the system function, so that the device is access correctly. System functions are C standard library functions such as fopen, fclose, fread, read, fwrite, write, and fprintf.
- If small driver is set up in BSP Editor, only read and write API will be available.
Prototype | intel_lw_uart_read_fd (alt_fd* fd, char* ptr, int len); |
Include | <intel_lw_uart_fd.h> |
Parameters |
|
Return | Number of bytes read if successful and otherwise return:
|
Description | This is a wrapper function to redirect system call to driver function intel_lw_uart_read should be called indirectly by using system function fread or read. |
Prototype | intel_lw_uart_write_fd(alt_fd* fd, const char* buffer, int len); |
Include | <intel_lw_uart_fd.h> |
Parameters |
|
Return | Number of bytes written if successful and otherwise return:
|
Description | This is a wrapper function to redirect system call to driver function intel_lw_uart_write. Should be called indirectly by using system function fwrite, write or fprintf. |
Prototype | int intel_lw_uart_close_fd (alt_fd* fd); |
Include | <intel_lw_uart_fd.h> |
Parameters |
|
Return | Return 0 if successful and otherwise return:
|
Description | This is a wrapper function to redirect system call to driver function intel_lw_uart_close. Should be called indirectly by using system function fclose or close. |
Prototype | intel_lw_uart_ioctl_fd (alt_fd* fd, int req, void* arg); |
Include | <intel_lw_uart.h> |
Parameters |
|
Return | Return 0 if successful and otherwise return:
|
Description | This is a wrapper function to redirect system call to driver function intel_lw_uart_ioctl. Should be called indirectly by using system function ioctl. |
Prototype | intel_lw_uart_init_eop (const int file, const EOP_Callback eop_cb_in, const alt_u8 eop); |
Include | <intel_lw_uart.h> |
Parameters |
|
Return | Return 0 if successful and otherwise return:
|
Description | Call this in the init function of your application to enable and use the EOP feature and add custom call back. |
Prototype | intel_lw_uart_init_eh (const int file, const EH_Callback eh_cb_in) |
Include | <intel_lw_uart.h> |
Parameters |
|
Return | Return 0 if successful and otherwise return:
|
Description | Call this in the init function of your application to enable exception handling and add custom call back. |
Prototype | intel_lw_uart_init(intel_lw_uart_state* sp, alt_u32 irq_controller_id, alt_u32 irq); |
Include | <intel_lw_uart.h> |
Parameters |
|
Return | None. |
Description | Called by the auto-generated function alt_sys_init() for each UART in the system. |
Prototype | intel_lw_uart_set_trbk (const int file, const alt_u8 enable); |
Include | <intel_lw_uart.h> |
Parameters |
|
Return | Return 0 if successful and otherwise return:
|
Description | Called by the user application to transmit a break character over the TXD output. |