libosmocore 1.10.0.9-9764
Osmocom core library
|
Configuration for a soft-UART. More...
#include <soft_uart.h>
Data Fields | |
uint8_t | num_data_bits |
Number of data bits (typically 5, 6, 7 or 8). More... | |
uint8_t | num_stop_bits |
Number of stop bits (typically 1 or 2). More... | |
enum osmo_soft_uart_parity_mode | parity_mode |
Parity mode (none, even, odd, space, mark). More... | |
unsigned int | rx_buf_size |
Size of the receive buffer; UART will buffer up to that number of characters before calling the receive call-back. More... | |
unsigned int | rx_timeout_ms |
Receive timeout; UART will flush the receive buffer via the receive call-back after indicated number of milliseconds, even if it is not full yet. More... | |
void * | priv |
Opaque application-private data; passed to call-backs. More... | |
void(* | rx_cb )(void *priv, struct msgb *rx_data, unsigned int flags) |
Receive call-back of the application. More... | |
void(* | tx_cb )(void *priv, struct msgb *tx_data) |
Transmit call-back of the application. More... | |
void(* | status_change_cb )(void *priv, unsigned int status) |
Modem status line change call-back. More... | |
enum osmo_soft_uart_flow_ctrl_mode | flow_ctrl_mode |
"Hardware" flow control mode. More... | |
Configuration for a soft-UART.
enum osmo_soft_uart_flow_ctrl_mode osmo_soft_uart_cfg::flow_ctrl_mode |
"Hardware" flow control mode.
Referenced by osmo_soft_uart_tx_ubits().
uint8_t osmo_soft_uart_cfg::num_data_bits |
Number of data bits (typically 5, 6, 7 or 8).
Referenced by osmo_soft_uart_configure(), osmo_soft_uart_tx_ubits(), suart_rx_bit(), and suart_tx_bit().
uint8_t osmo_soft_uart_cfg::num_stop_bits |
Number of stop bits (typically 1 or 2).
Referenced by osmo_soft_uart_configure(), osmo_soft_uart_tx_ubits(), suart_rx_bit(), and suart_tx_bit().
enum osmo_soft_uart_parity_mode osmo_soft_uart_cfg::parity_mode |
Parity mode (none, even, odd, space, mark).
Referenced by osmo_soft_uart_configure(), osmo_soft_uart_tx_ubits(), suart_rx_bit(), and suart_tx_bit().
void* osmo_soft_uart_cfg::priv |
Opaque application-private data; passed to call-backs.
Referenced by osmo_soft_uart_flush_rx(), osmo_soft_uart_set_status(), and osmo_soft_uart_tx_ubits().
unsigned int osmo_soft_uart_cfg::rx_buf_size |
Size of the receive buffer; UART will buffer up to that number of characters before calling the receive call-back.
Referenced by osmo_soft_uart_configure(), osmo_soft_uart_flush_rx(), osmo_soft_uart_set_rx(), and suart_rx_ch().
Receive call-back of the application.
Called if at least one of the following conditions is met: a) rx_buf_size characters were received (Rx buffer is full); b) rx_timeout_ms expired and Rx buffer is not empty; c) a parity or framing error is occurred.
[in] | priv | opaque application-private data. |
[in] | rx_data | msgb holding the received data. Must be free()ed by the application. |
[in] | flags | bit-mask of OSMO_SUART_F_*. |
Referenced by osmo_soft_uart_flush_rx().
unsigned int osmo_soft_uart_cfg::rx_timeout_ms |
Receive timeout; UART will flush the receive buffer via the receive call-back after indicated number of milliseconds, even if it is not full yet.
Referenced by osmo_soft_uart_configure(), and suart_rx_ch().
void(* osmo_soft_uart_cfg::status_change_cb) (void *priv, unsigned int status) |
Modem status line change call-back.
[in] | priv | opaque application-private data. |
[in] | status | updated status; bit-mask of OSMO_SUART_STATUS_F_*. |
Referenced by osmo_soft_uart_set_status().
Transmit call-back of the application.
The implementation is expected to provide at most tx_data->data_len characters (the actual amount is determined by the number of requested bits and the effective UART configuration).
[in] | priv | opaque application-private data. |
[in,out] | tx_data | msgb for writing to be transmitted data. |
Referenced by osmo_soft_uart_tx_ubits().