7#ifndef ZEPHYR_DRIVERS_SERIAL_UART_ASYNC_TO_IRQ_H_
8#define ZEPHYR_DRIVERS_SERIAL_UART_ASYNC_TO_IRQ_H_
32struct uart_async_to_irq_data;
38struct uart_async_to_irq_config;
61#define UART_ASYNC_TO_IRQ_API_INIT() \
62 .fifo_fill = z_uart_async_to_irq_fifo_fill, \
63 .fifo_read = z_uart_async_to_irq_fifo_read, \
64 .irq_tx_enable = z_uart_async_to_irq_irq_tx_enable, \
65 .irq_tx_disable = z_uart_async_to_irq_irq_tx_disable, \
66 .irq_tx_ready = z_uart_async_to_irq_irq_tx_ready, \
67 .irq_rx_enable = z_uart_async_to_irq_irq_rx_enable, \
68 .irq_rx_disable = z_uart_async_to_irq_irq_rx_disable, \
69 .irq_tx_complete = z_uart_async_to_irq_irq_tx_complete,\
70 .irq_rx_ready = z_uart_async_to_irq_irq_rx_ready, \
71 .irq_err_enable = z_uart_async_to_irq_irq_err_enable, \
72 .irq_err_disable = z_uart_async_to_irq_irq_err_disable,\
73 .irq_is_pending = z_uart_async_to_irq_irq_is_pending, \
74 .irq_update = z_uart_async_to_irq_irq_update, \
75 .irq_callback_set = z_uart_async_to_irq_irq_callback_set
89#define UART_ASYNC_TO_IRQ_API_CONFIG_INITIALIZER(_api, _trampoline, _baudrate, _tx_buf, \
90 _tx_len, _rx_buf, _rx_len, _rx_cnt, _log) \
100 .trampoline = _trampoline, \
101 .baudrate = _baudrate, \
102 LOG_OBJECT_PTR_INIT(log, \
103 COND_CODE_1(IS_EMPTY(_log), \
104 (LOG_OBJECT_PTR(UART_ASYNC_TO_IRQ_LOG_NAME)), \
143struct uart_async_to_irq_config {
154 const struct uart_async_to_irq_async_api *api;
167struct uart_async_to_irq_async_api {
168 int (*callback_set)(
const struct device *dev,
172 int (*tx)(
const struct device *dev,
const uint8_t *buf,
size_t len,
174 int (*tx_abort)(
const struct device *dev);
176 int (*rx_enable)(
const struct device *dev,
uint8_t *buf,
size_t len,
178 int (*rx_buf_rsp)(
const struct device *dev,
uint8_t *buf,
size_t len);
179 int (*rx_disable)(
const struct device *dev);
183struct uart_async_to_irq_rx_data {
195struct uart_async_to_irq_tx_data {
204struct uart_async_to_irq_data {
215 struct uart_async_to_irq_rx_data rx;
218 struct uart_async_to_irq_tx_data tx;
228int z_uart_async_to_irq_fifo_fill(
const struct device *dev,
233int z_uart_async_to_irq_fifo_read(
const struct device *dev,
238void z_uart_async_to_irq_irq_tx_enable(
const struct device *dev);
241void z_uart_async_to_irq_irq_tx_disable(
const struct device *dev);
244int z_uart_async_to_irq_irq_tx_ready(
const struct device *dev);
247void z_uart_async_to_irq_irq_rx_enable(
const struct device *dev);
250void z_uart_async_to_irq_irq_rx_disable(
const struct device *dev);
253int z_uart_async_to_irq_irq_tx_complete(
const struct device *dev);
256int z_uart_async_to_irq_irq_rx_ready(
const struct device *dev);
259void z_uart_async_to_irq_irq_err_enable(
const struct device *dev);
262void z_uart_async_to_irq_irq_err_disable(
const struct device *dev);
265int z_uart_async_to_irq_irq_is_pending(
const struct device *dev);
268int z_uart_async_to_irq_irq_update(
const struct device *dev);
271void z_uart_async_to_irq_irq_callback_set(
const struct device *dev,
long atomic_t
Definition atomic_types.h:15
Public APIs for UART drivers.
void(* uart_callback_t)(const struct device *dev, struct uart_event *evt, void *user_data)
Define the application callback function signature for uart_callback_set() function.
Definition uart.h:324
void(* uart_irq_callback_user_data_t)(const struct device *dev, void *user_data)
Define the application callback function signature for uart_irq_callback_user_data_set() function.
Definition uart.h:141
#define LOG_INSTANCE_PTR_DECLARE(_name)
Declare a logger instance pointer in the module structure.
Definition log_instance.h:147
flags
Definition parser.h:96
Public interface for spinlocks.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Kernel Spin Lock.
Definition spinlock.h:45
UART asynchronous RX helper configuration structure.
Definition uart_async_rx.h:62
UART asynchronous RX helper structure.
Definition uart_async_rx.h:36
Helper module for receiving using UART Asynchronous API.
int uart_async_to_irq_rx_enable(const struct device *dev)
int uart_async_to_irq_rx_disable(const struct device *dev)
void(* uart_async_to_irq_trampoline)(const struct device *dev)
Definition uart_async_to_irq.h:48
void uart_async_to_irq_trampoline_cb(const struct device *dev)
Callback to be called from trampoline context.
int uart_async_to_irq_init(const struct device *dev)
Initialize the adaptation layer.