Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
uart_async_to_irq.h File Reference

Go to the source code of this file.

#define UART_ASYNC_TO_IRQ_API_INIT()
 Interrupt driven API initializer.
 
#define UART_ASYNC_TO_IRQ_API_CONFIG_INITIALIZER(_api, _trampoline, _baudrate, _tx_buf, _tx_len, _rx_buf, _rx_len, _rx_cnt, _log)
 Configuration structure initializer.
 
typedef void(* uart_async_to_irq_trampoline) (const struct device *dev)
 
void uart_async_to_irq_trampoline_cb (const struct device *dev)
 Callback to be called from trampoline context.
 
int uart_async_to_irq_init (struct uart_async_to_irq_data *data, const struct uart_async_to_irq_config *config)
 Initialize the adaptation layer.
 
int uart_async_to_irq_rx_enable (const struct device *dev)
 
int uart_async_to_irq_rx_disable (const struct device *dev)
 

Macro Definition Documentation

◆ UART_ASYNC_TO_IRQ_API_CONFIG_INITIALIZER

#define UART_ASYNC_TO_IRQ_API_CONFIG_INITIALIZER (   _api,
  _trampoline,
  _baudrate,
  _tx_buf,
  _tx_len,
  _rx_buf,
  _rx_len,
  _rx_cnt,
  _log 
)
Value:
{ \
.tx_buf = _tx_buf, \
.tx_len = _tx_len, \
.async_rx = { \
.buffer = _rx_buf, \
.length = _rx_len, \
.buf_cnt = _rx_cnt \
}, \
.api = _api, \
.trampoline = _trampoline, \
.baudrate = _baudrate, \
LOG_OBJECT_PTR_INIT(log, \
(LOG_OBJECT_PTR(UART_ASYNC_TO_IRQ_LOG_NAME)), \
(_log) \
) \
) \
}
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:179
#define IS_EMPTY(...)
Check if a macro has a replacement expression.
Definition util_macro.h:277

Configuration structure initializer.

Parameters
_apiStructure with UART asynchronous API.
_trampolineFunction that trampolines to the interrupt context.
_baudrateUART baudrate.
_tx_bufTX buffer.
_tx_lenTX buffer length.
_rx_bufRX buffer.
_rx_lenRX buffer length.
_rx_cntNumber of chunks into which RX buffer is divided.
_logLogging instance, if not provided (empty) then default is used.

◆ UART_ASYNC_TO_IRQ_API_INIT

#define UART_ASYNC_TO_IRQ_API_INIT ( )
Value:
.fifo_fill = z_uart_async_to_irq_fifo_fill, \
.fifo_read = z_uart_async_to_irq_fifo_read, \
.irq_tx_enable = z_uart_async_to_irq_irq_tx_enable, \
.irq_tx_disable = z_uart_async_to_irq_irq_tx_disable, \
.irq_tx_ready = z_uart_async_to_irq_irq_tx_ready, \
.irq_rx_enable = z_uart_async_to_irq_irq_rx_enable, \
.irq_rx_disable = z_uart_async_to_irq_irq_rx_disable, \
.irq_tx_complete = z_uart_async_to_irq_irq_tx_complete,\
.irq_rx_ready = z_uart_async_to_irq_irq_rx_ready, \
.irq_err_enable = z_uart_async_to_irq_irq_err_enable, \
.irq_err_disable = z_uart_async_to_irq_irq_err_disable,\
.irq_is_pending = z_uart_async_to_irq_irq_is_pending, \
.irq_update = z_uart_async_to_irq_irq_update, \
.irq_callback_set = z_uart_async_to_irq_irq_callback_set

Interrupt driven API initializer.

It should be used in the initialization of the UART API structure in the driver to provide interrupt driven API functions.

Typedef Documentation

◆ uart_async_to_irq_trampoline

typedef void(* uart_async_to_irq_trampoline) (const struct device *dev)

Function Documentation

◆ uart_async_to_irq_init()

int uart_async_to_irq_init ( struct uart_async_to_irq_data *  data,
const struct uart_async_to_irq_config *  config 
)

Initialize the adaptation layer.

Parameters
dataData associated with the given adaptation layer instance.
configConfiguration structure. Must be persistent.
Return values
0On successful initialization.

◆ uart_async_to_irq_rx_disable()

int uart_async_to_irq_rx_disable ( const struct device dev)

◆ uart_async_to_irq_rx_enable()

int uart_async_to_irq_rx_enable ( const struct device dev)

◆ uart_async_to_irq_trampoline_cb()

void uart_async_to_irq_trampoline_cb ( const struct device dev)

Callback to be called from trampoline context.

Parameters
devUART device.