Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Public APIs for UART drivers. More...
Go to the source code of this file.
Data Structures | |
struct | uart_config |
UART controller configuration structure. More... | |
struct | uart_event_tx |
UART TX event data. More... | |
struct | uart_event_rx |
UART RX event data. More... | |
struct | uart_event_rx_buf |
UART RX buffer released event data. More... | |
struct | uart_event_rx_stop |
UART RX stopped data. More... | |
struct | uart_event |
Structure containing information about current event. More... | |
union | uart_event::uart_event_data |
Event data. More... | |
Typedefs | |
typedef void(* | uart_irq_callback_user_data_t) (const struct device *dev, void *user_data) |
Define the application callback function signature for uart_irq_callback_user_data_set() function. | |
typedef void(* | uart_irq_config_func_t) (const struct device *dev) |
For configuring IRQ on each individual UART device. | |
typedef void(* | uart_callback_t) (const struct device *dev, struct uart_event *evt, void *user_data) |
Define the application callback function signature for uart_callback_set() function. | |
Functions | |
int | uart_err_check (const struct device *dev) |
Check whether an error was detected. | |
int | uart_poll_in (const struct device *dev, unsigned char *p_char) |
Read a character from the device for input. | |
int | uart_poll_in_u16 (const struct device *dev, uint16_t *p_u16) |
Read a 16-bit datum from the device for input. | |
void | uart_poll_out (const struct device *dev, unsigned char out_char) |
Write a character to the device for output. | |
void | uart_poll_out_u16 (const struct device *dev, uint16_t out_u16) |
Write a 16-bit datum to the device for output. | |
int | uart_configure (const struct device *dev, const struct uart_config *cfg) |
Set UART configuration. | |
int | uart_config_get (const struct device *dev, struct uart_config *cfg) |
Get UART configuration. | |
static int | uart_fifo_fill (const struct device *dev, const uint8_t *tx_data, int size) |
Fill FIFO with data. | |
static int | uart_fifo_fill_u16 (const struct device *dev, const uint16_t *tx_data, int size) |
Fill FIFO with wide data. | |
static int | uart_fifo_read (const struct device *dev, uint8_t *rx_data, const int size) |
Read data from FIFO. | |
static int | uart_fifo_read_u16 (const struct device *dev, uint16_t *rx_data, const int size) |
Read wide data from FIFO. | |
void | uart_irq_tx_enable (const struct device *dev) |
Enable TX interrupt in IER. | |
void | uart_irq_tx_disable (const struct device *dev) |
Disable TX interrupt in IER. | |
static int | uart_irq_tx_ready (const struct device *dev) |
Check if UART TX buffer can accept bytes. | |
void | uart_irq_rx_enable (const struct device *dev) |
Enable RX interrupt. | |
void | uart_irq_rx_disable (const struct device *dev) |
Disable RX interrupt. | |
static int | uart_irq_tx_complete (const struct device *dev) |
Check if UART TX block finished transmission. | |
static int | uart_irq_rx_ready (const struct device *dev) |
Check if UART RX buffer has a received char. | |
void | uart_irq_err_enable (const struct device *dev) |
Enable error interrupt. | |
void | uart_irq_err_disable (const struct device *dev) |
Disable error interrupt. | |
int | uart_irq_is_pending (const struct device *dev) |
Check if any IRQs is pending. | |
int | uart_irq_update (const struct device *dev) |
Start processing interrupts in ISR. | |
static int | uart_irq_callback_user_data_set (const struct device *dev, uart_irq_callback_user_data_t cb, void *user_data) |
Set the IRQ callback function pointer. | |
static int | uart_irq_callback_set (const struct device *dev, uart_irq_callback_user_data_t cb) |
Set the IRQ callback function pointer (legacy). | |
static int | uart_callback_set (const struct device *dev, uart_callback_t callback, void *user_data) |
Set event handler function. | |
int | uart_tx (const struct device *dev, const uint8_t *buf, size_t len, int32_t timeout) |
Send given number of bytes from buffer through UART. | |
int | uart_tx_u16 (const struct device *dev, const uint16_t *buf, size_t len, int32_t timeout) |
Send given number of datum from buffer through UART. | |
int | uart_tx_abort (const struct device *dev) |
Abort current TX transmission. | |
int | uart_rx_enable (const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) |
Start receiving data through UART. | |
int | uart_rx_enable_u16 (const struct device *dev, uint16_t *buf, size_t len, int32_t timeout) |
Start receiving wide data through UART. | |
static int | uart_rx_buf_rsp (const struct device *dev, uint8_t *buf, size_t len) |
Provide receive buffer in response to UART_RX_BUF_REQUEST event. | |
static int | uart_rx_buf_rsp_u16 (const struct device *dev, uint16_t *buf, size_t len) |
Provide wide data receive buffer in response to UART_RX_BUF_REQUEST event. | |
int | uart_rx_disable (const struct device *dev) |
Disable RX. | |
int | uart_line_ctrl_set (const struct device *dev, uint32_t ctrl, uint32_t val) |
Manipulate line control for UART. | |
int | uart_line_ctrl_get (const struct device *dev, uint32_t ctrl, uint32_t *val) |
Retrieve line control for UART. | |
int | uart_drv_cmd (const struct device *dev, uint32_t cmd, uint32_t p) |
Send extra command to driver. | |
Public APIs for UART drivers.