libosmocore 1.9.0.196-9975
Osmocom core library
osmo_soft_uart_cfg Struct Reference

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...
 

Detailed Description

Configuration for a soft-UART.

Field Documentation

◆ flow_ctrl_mode

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().

◆ num_data_bits

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().

◆ num_stop_bits

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().

◆ parity_mode

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().

◆ priv

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().

◆ rx_buf_size

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().

◆ rx_cb

void(* osmo_soft_uart_cfg::rx_cb) (void *priv, struct msgb *rx_data, unsigned int flags)

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.

Parameters
[in]privopaque application-private data.
[in]rx_datamsgb holding the received data. Must be free()ed by the application.
[in]flagsbit-mask of OSMO_SUART_F_*.

Referenced by osmo_soft_uart_flush_rx().

◆ rx_timeout_ms

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().

◆ status_change_cb

void(* osmo_soft_uart_cfg::status_change_cb) (void *priv, unsigned int status)

Modem status line change call-back.

Parameters
[in]privopaque application-private data.
[in]statusupdated status; bit-mask of OSMO_SUART_STATUS_F_*.

Referenced by osmo_soft_uart_set_status().

◆ tx_cb

void(* osmo_soft_uart_cfg::tx_cb) (void *priv, struct msgb *tx_data)

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).

Parameters
[in]privopaque application-private data.
[in,out]tx_datamsgb for writing to be transmitted data.

Referenced by osmo_soft_uart_tx_ubits().


The documentation for this struct was generated from the following file: