Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
|
Backend API for emulated UART. More...
Go to the source code of this file.
Typedefs | |
typedef void(* | uart_emul_callback_tx_data_ready_t) (const struct device *dev, size_t size, void *user_data) |
Define the application callback function signature for uart_emul_callback_tx_data_ready_set() function. | |
Functions | |
void | uart_emul_callback_tx_data_ready_set (const struct device *dev, uart_emul_callback_tx_data_ready_t cb, void *user_data) |
Set the TX data ready callback. | |
uint32_t | uart_emul_put_rx_data (const struct device *dev, const uint8_t *data, size_t size) |
Write (copy) data to RX buffer. | |
uint32_t | uart_emul_get_tx_data (const struct device *dev, uint8_t *data, size_t size) |
Read data from TX buffer. | |
uint32_t | uart_emul_flush_rx_data (const struct device *dev) |
Clear RX buffer content. | |
uint32_t | uart_emul_flush_tx_data (const struct device *dev) |
Clear TX buffer content. | |
void | uart_emul_set_errors (const struct device *dev, int errors) |
Sets one or more driver errors. | |
void | uart_emul_set_release_buffer_on_timeout (const struct device *dev, bool release_on_timeout) |
Configures if rx buffer should be released on timeout, even when only partially filled. | |
Backend API for emulated UART.
typedef void(* uart_emul_callback_tx_data_ready_t) (const struct device *dev, size_t size, void *user_data) |
Define the application callback function signature for uart_emul_callback_tx_data_ready_set() function.
dev | UART device instance |
size | Number of available bytes in TX buffer |
user_data | Arbitrary user data |
void uart_emul_callback_tx_data_ready_set | ( | const struct device * | dev, |
uart_emul_callback_tx_data_ready_t | cb, | ||
void * | user_data ) |
Set the TX data ready callback.
This sets up the callback that is called every time data was appended to the TX buffer.
dev | The emulated UART device instance |
cb | Pointer to the callback function |
user_data | Data to pass to callback function |
Clear RX buffer content.
dev | The emulated UART device instance |
Clear TX buffer content.
dev | The emulated UART device instance |
Read data from TX buffer.
dev | The emulated UART device instance |
data | The address of the output buffer |
size | Number of bytes to read |
Write (copy) data to RX buffer.
dev | The emulated UART device instance |
data | The data to append |
size | Number of bytes to append |
void uart_emul_set_errors | ( | const struct device * | dev, |
int | errors ) |
Sets one or more driver errors.
dev | The emulated UART device instance |
errors | The uart_rx_stop_reason errors to set |