Lines Matching full:dev

31 static struct uart_async_to_irq_data *get_data(const struct device *dev)  in get_data()  argument
33 struct uart_async_to_irq_data **data = dev->data; in get_data()
38 static const struct uart_async_to_irq_config *get_config(const struct device *dev) in get_config() argument
40 const struct uart_async_to_irq_config * const *config = dev->config; in get_config()
46 static uint32_t get_rx_timeout(const struct device *dev) in get_rx_timeout() argument
52 err = uart_config_get(dev, &cfg); in get_rx_timeout()
56 baudrate = get_config(dev)->baudrate; in get_rx_timeout()
64 static int rx_enable(const struct device *dev, in rx_enable() argument
70 const struct uart_async_to_irq_config *config = get_config(dev); in rx_enable()
72 err = config->api->rx_enable(dev, buf, len, get_rx_timeout(dev)); in rx_enable()
77 static int try_rx_enable(const struct device *dev, struct uart_async_to_irq_data *data) in try_rx_enable() argument
86 return rx_enable(dev, data, buf, len); in try_rx_enable()
89 static void on_rx_buf_req(const struct device *dev, in on_rx_buf_req() argument
98 int err = config->api->rx_buf_rsp(dev, buf, len); in on_rx_buf_req()
108 static void on_rx_dis(const struct device *dev, struct uart_async_to_irq_data *data) in on_rx_dis() argument
117 err = try_rx_enable(dev, data); in on_rx_dis()
122 LOG_INST_DBG(get_config(dev)->log, "Reenabling RX from RX_DISABLED (err:%d)", err); in on_rx_dis()
130 static void uart_async_to_irq_callback(const struct device *dev, in uart_async_to_irq_callback() argument
135 const struct uart_async_to_irq_config *config = get_config(dev); in uart_async_to_irq_callback()
148 on_rx_buf_req(dev, config, data); in uart_async_to_irq_callback()
158 on_rx_dis(dev, data); in uart_async_to_irq_callback()
166 config->trampoline(dev); in uart_async_to_irq_callback()
170 int z_uart_async_to_irq_fifo_fill(const struct device *dev, const uint8_t *buf, int len) in z_uart_async_to_irq_fifo_fill() argument
172 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_fifo_fill()
173 const struct uart_async_to_irq_config *config = get_config(dev); in z_uart_async_to_irq_fifo_fill()
183 err = config->api->tx(dev, data->tx.buf, len, SYS_FOREVER_US); in z_uart_async_to_irq_fifo_fill()
193 int z_uart_async_to_irq_fifo_read(const struct device *dev, in z_uart_async_to_irq_fifo_read() argument
197 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_fifo_read()
198 const struct uart_async_to_irq_config *config = get_config(dev); in z_uart_async_to_irq_fifo_read()
218 err = config->api->rx_buf_rsp(dev, buf, rx_len); in z_uart_async_to_irq_fifo_read()
222 err = rx_enable(dev, data, buf, rx_len); in z_uart_async_to_irq_fifo_read()
233 static void dir_disable(const struct device *dev, uint32_t flag) in dir_disable() argument
235 struct uart_async_to_irq_data *data = get_data(dev); in dir_disable()
240 static void dir_enable(const struct device *dev, uint32_t flag) in dir_enable() argument
242 struct uart_async_to_irq_data *data = get_data(dev); in dir_enable()
247 get_config(dev)->trampoline(dev); in dir_enable()
251 void z_uart_async_to_irq_irq_tx_enable(const struct device *dev) in z_uart_async_to_irq_irq_tx_enable() argument
253 dir_enable(dev, A2I_TX_IRQ_ENABLED); in z_uart_async_to_irq_irq_tx_enable()
257 void z_uart_async_to_irq_irq_tx_disable(const struct device *dev) in z_uart_async_to_irq_irq_tx_disable() argument
259 dir_disable(dev, A2I_TX_IRQ_ENABLED); in z_uart_async_to_irq_irq_tx_disable()
263 int z_uart_async_to_irq_irq_tx_ready(const struct device *dev) in z_uart_async_to_irq_irq_tx_ready() argument
265 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_irq_tx_ready()
273 void z_uart_async_to_irq_irq_rx_enable(const struct device *dev) in z_uart_async_to_irq_irq_rx_enable() argument
275 dir_enable(dev, A2I_RX_IRQ_ENABLED); in z_uart_async_to_irq_irq_rx_enable()
279 void z_uart_async_to_irq_irq_rx_disable(const struct device *dev) in z_uart_async_to_irq_irq_rx_disable() argument
281 dir_disable(dev, A2I_RX_IRQ_ENABLED); in z_uart_async_to_irq_irq_rx_disable()
285 int z_uart_async_to_irq_irq_tx_complete(const struct device *dev) in z_uart_async_to_irq_irq_tx_complete() argument
287 return z_uart_async_to_irq_irq_tx_ready(dev) > 0 ? 1 : 0; in z_uart_async_to_irq_irq_tx_complete()
291 int z_uart_async_to_irq_irq_rx_ready(const struct device *dev) in z_uart_async_to_irq_irq_rx_ready() argument
293 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_irq_rx_ready()
299 void z_uart_async_to_irq_irq_err_enable(const struct device *dev) in z_uart_async_to_irq_irq_err_enable() argument
301 dir_enable(dev, A2I_ERR_IRQ_ENABLED); in z_uart_async_to_irq_irq_err_enable()
305 void z_uart_async_to_irq_irq_err_disable(const struct device *dev) in z_uart_async_to_irq_irq_err_disable() argument
307 dir_disable(dev, A2I_ERR_IRQ_ENABLED); in z_uart_async_to_irq_irq_err_disable()
311 int z_uart_async_to_irq_irq_is_pending(const struct device *dev) in z_uart_async_to_irq_irq_is_pending() argument
313 bool tx_rdy = z_uart_async_to_irq_irq_tx_ready(dev); in z_uart_async_to_irq_irq_is_pending()
314 bool rx_rdy = z_uart_async_to_irq_irq_rx_ready(dev); in z_uart_async_to_irq_irq_is_pending()
315 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_irq_is_pending()
322 int z_uart_async_to_irq_irq_update(const struct device *dev) in z_uart_async_to_irq_irq_update() argument
328 void z_uart_async_to_irq_irq_callback_set(const struct device *dev, in z_uart_async_to_irq_irq_callback_set() argument
332 struct uart_async_to_irq_data *data = get_data(dev); in z_uart_async_to_irq_irq_callback_set()
338 int uart_async_to_irq_rx_enable(const struct device *dev) in uart_async_to_irq_rx_enable() argument
340 struct uart_async_to_irq_data *data = get_data(dev); in uart_async_to_irq_rx_enable()
343 err = try_rx_enable(dev, data); in uart_async_to_irq_rx_enable()
351 int uart_async_to_irq_rx_disable(const struct device *dev) in uart_async_to_irq_rx_disable() argument
353 struct uart_async_to_irq_data *data = get_data(dev); in uart_async_to_irq_rx_disable()
354 const struct uart_async_to_irq_config *config = get_config(dev); in uart_async_to_irq_rx_disable()
358 err = config->api->rx_disable(dev); in uart_async_to_irq_rx_disable()
370 void uart_async_to_irq_trampoline_cb(const struct device *dev) in uart_async_to_irq_trampoline_cb() argument
372 struct uart_async_to_irq_data *data = get_data(dev); in uart_async_to_irq_trampoline_cb()
375 data->callback(dev, data->user_data); in uart_async_to_irq_trampoline_cb()
379 int uart_async_to_irq_init(const struct device *dev) in uart_async_to_irq_init() argument
381 struct uart_async_to_irq_data *data = get_data(dev); in uart_async_to_irq_init()
382 const struct uart_async_to_irq_config *config = get_config(dev); in uart_async_to_irq_init()
390 err = config->api->callback_set(dev, uart_async_to_irq_callback, data); in uart_async_to_irq_init()