26 #include <sol-common-buildopts.h>
105 #ifndef SOL_NO_API_VERSION
106 #define SOL_UART_CONFIG_API_VERSION (1)
107 uint16_t api_version;
183 SOL_ATTR_WARN_UNUSED_RESULT
200 SOL_ATTR_WARN_UNUSED_RESULT
217 SOL_ATTR_WARN_UNUSED_RESULT
234 SOL_ATTR_WARN_UNUSED_RESULT
251 SOL_ATTR_WARN_UNUSED_RESULT
268 SOL_ATTR_WARN_UNUSED_RESULT
285 SOL_ATTR_WARN_UNUSED_RESULT
const char * sol_uart_baud_rate_to_str(enum sol_uart_baud_rate baud_rate)
Converts sol_uart_baud_rate to a string name.
no parity is used.
Definition: sol-uart.h:85
enum sol_uart_baud_rate sol_uart_baud_rate_from_str(const char *baud_rate)
Converts a string UART baudRate to sol_uart_baud_rate.
sol_uart_stop_bits
Amount of stop bits.
Definition: sol-uart.h:93
Definition: sol-uart.h:66
Use 7 data bits.
Definition: sol-uart.h:75
ssize_t(* on_data)(void *data, struct sol_uart *uart, const struct sol_buffer *buf)
Callback containing data was read from UART.
Definition: sol-uart.h:118
bool flow_control
Enables software flow control(XOFF and XON)
Definition: sol-uart.h:150
Use 6 data bits.
Definition: sol-uart.h:76
enum sol_uart_parity parity
The parity value.
Definition: sol-uart.h:148
These routines are used for Soletta types' manipulation.
const char * sol_uart_parity_to_str(enum sol_uart_parity parity)
Converts sol_uart_parity to a string name.
Definition: sol-uart.h:65
the last data bit transmitted will be a logical 1 if the data transmitted had an odd amount of 0 bits...
Definition: sol-uart.h:87
Definition: sol-uart.h:64
sol_uart_baud_rate
Baud rate is the number of times the signal can switch states in one second.
Definition: sol-uart.h:62
These are common Soletta macros.
void(* on_feed_done)(void *data, struct sol_uart *uart, struct sol_blob *blob, int status)
Informs that a feed operation has ended.
Definition: sol-uart.h:129
These are routines that Soletta provides for its buffer implementation.
void sol_uart_close(struct sol_uart *uart)
Close an UART bus.
const char * sol_uart_stop_bits_to_str(enum sol_uart_stop_bits stop_bits)
Converts sol_uart_stop_bits to a string name.
#define SOL_ATTR_WARN_UNUSED_RESULT
Causes a warning to be emitted if a caller of the function with this attribute does not use its retur...
Definition: sol-macros.h:187
const char * sol_uart_data_bits_to_str(enum sol_uart_data_bits data_bits)
Converts sol_uart_data_bits to a string name.
const void * user_data
User data to sol_uart_config::on_feed_done() and sol_uart_config::on_data()
Definition: sol-uart.h:130
size_t data_buffer_size
The receiving buffer max size.
Definition: sol-uart.h:145
void * data
Buffer data.
Definition: sol-buffer.h:131
enum sol_uart_data_bits data_bits
The data bits value.
Definition: sol-uart.h:147
int sol_uart_feed(struct sol_uart *uart, struct sol_blob *blob)
Perform an UART asynchronous transmission.
Definition: sol-uart.h:63
enum sol_uart_stop_bits sol_uart_stop_bits_from_str(const char *stop_bits)
Converts a string UART stopBits to sol_uart_stop_bits.
Use one stop bit.
Definition: sol-uart.h:94
Use 5 data bits.
Definition: sol-uart.h:77
Data type describing the default blob implementation.
Definition: sol-types.h:468
size_t feed_size
The feed buffer max size.
Definition: sol-uart.h:140
Use two stop bits.
Definition: sol-uart.h:95
Use 8 data bits.
Definition: sol-uart.h:74
enum sol_uart_stop_bits stop_bits
The stop bits value.
Definition: sol-uart.h:149
sol_uart_data_bits
Amount of data bits.
Definition: sol-uart.h:73
enum sol_uart_data_bits sol_uart_data_bits_from_str(const char *data_bits)
Converts a string UART dataBits to sol_uart_data_bits.
sol_uart_parity
The parity characteristic can be even, odd, or none and it influences last trasmitted bit...
Definition: sol-uart.h:84
enum sol_uart_parity sol_uart_parity_from_str(const char *parity)
Converts a string UART parity to sol_uart_parity.
enum sol_uart_baud_rate baud_rate
The baud rate value.
Definition: sol-uart.h:146
the last data bit transmitted will be a logical 1 if the data transmitted had an even amount of 0 bit...
Definition: sol-uart.h:86
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
struct sol_uart sol_uart
A handle to a UART device.
Definition: sol-uart.h:55
A configuration struct used to set the UART paramenters.
Definition: sol-uart.h:104
Definition: sol-uart.h:67
struct sol_uart * sol_uart_open(const char *port_name, const struct sol_uart_config *config)
Open an UART bus.
struct sol_uart_config sol_uart_config
A configuration struct used to set the UART paramenters.