Soletta™ Framework
|
A configuration struct used to set the UART paramenters. More...
#include <sol-uart.h>
Data Fields | |
uint16_t | api_version |
must match SOL_UART_CONFIG_API_VERSION at runtime More... | |
enum sol_uart_baud_rate | baud_rate |
The baud rate value. More... | |
enum sol_uart_data_bits | data_bits |
The data bits value. More... | |
size_t | data_buffer_size |
The receiving buffer max size. More... | |
size_t | feed_size |
The feed buffer max size. More... | |
bool | flow_control |
Enables software flow control(XOFF and XON) More... | |
ssize_t(* | on_data )(void *data, struct sol_uart *uart, const struct sol_buffer *buf) |
Callback containing data was read from UART. More... | |
void(* | on_feed_done )(void *data, struct sol_uart *uart, struct sol_blob *blob, int status) |
Informs that a feed operation has ended. More... | |
enum sol_uart_parity | parity |
The parity value. More... | |
enum sol_uart_stop_bits | stop_bits |
The stop bits value. More... | |
const void * | user_data |
User data to sol_uart_config::on_feed_done() and sol_uart_config::on_data() More... | |
A configuration struct used to set the UART paramenters.
uint16_t sol_uart_config::api_version |
must match SOL_UART_CONFIG_API_VERSION at runtime
Referenced by startup().
enum sol_uart_baud_rate sol_uart_config::baud_rate |
The baud rate value.
enum sol_uart_data_bits sol_uart_config::data_bits |
The data bits value.
size_t sol_uart_config::data_buffer_size |
The receiving buffer max size.
The value 0
means unlimited data. In other words, the buffer will always grow in order to store all the data and shrink when data is consumed.
size_t sol_uart_config::feed_size |
The feed buffer max size.
The value 0
means unlimited data. Since sol_uart_feed() works with blobs, no extra buffers will be allocated in order to store feed_size
bytes. All the blobs that are schedule to be written will be referenced and the sum of all queued blobs must not be equal or exceed feed_size
. If it happens sol_uart_feed() will return -ENOSPC
and one must start to control the writing flow until on_feed_done
is called.
bool sol_uart_config::flow_control |
Enables software flow control(XOFF and XON)
ssize_t(* sol_uart_config::on_data)(void *data, struct sol_uart *uart, const struct sol_buffer *buf) |
Callback containing data was read from UART.
data | User data as provided in sol_uart_config::user_data |
uart | The UART handle |
buf | The UART data |
buf
or negative errno on error. void(* sol_uart_config::on_feed_done)(void *data, struct sol_uart *uart, struct sol_blob *blob, int status) |
Informs that a feed operation has ended.
data | User data as provided in sol_uart_config::user_data |
uart | The UART handle |
blob | The blob that was written |
status | 0 on success or negative errno on error |
enum sol_uart_parity sol_uart_config::parity |
The parity value.
enum sol_uart_stop_bits sol_uart_config::stop_bits |
The stop bits value.
const void* sol_uart_config::user_data |
User data to sol_uart_config::on_feed_done() and sol_uart_config::on_data()