Lines Matching full:uart
8 #include <zephyr/drivers/uart.h>
39 } uart; member
53 if (!ring_buf_is_empty(dev_data->uart.tx_ringbuf)) { in bt_notif_enabled()
54 k_work_reschedule_for_queue(&nus_work_queue, &dev_data->uart.tx_work, K_NO_WAIT); in bt_notif_enabled()
67 struct ring_buf *ringbuf = dev_data->uart.rx_ringbuf; in bt_received()
78 k_work_submit_to_queue(&nus_work_queue, &dev_data->uart.cb_work); in bt_received()
83 struct uart_bt_data *dev_data = CONTAINER_OF(work, struct uart_bt_data, uart.cb_work); in cb_work_handler()
85 if (dev_data->uart.callback.cb) { in cb_work_handler()
86 dev_data->uart.callback.cb( in cb_work_handler()
87 dev_data->uart.callback.dev, in cb_work_handler()
88 dev_data->uart.callback.cb_data); in cb_work_handler()
95 struct uart_bt_data *dev_data = CONTAINER_OF(dwork, struct uart_bt_data, uart.tx_work); in tx_work_handler()
108 len = ring_buf_get_claim(dev_data->uart.tx_ringbuf, &data, 20); in tx_work_handler()
116 ring_buf_get_finish(dev_data->uart.tx_ringbuf, len); in tx_work_handler()
119 if ((ring_buf_space_get(dev_data->uart.tx_ringbuf) > 0) && dev_data->uart.tx_irq_ena) { in tx_work_handler()
120 k_work_submit_to_queue(&nus_work_queue, &dev_data->uart.cb_work); in tx_work_handler()
129 wrote = ring_buf_put(dev_data->uart.tx_ringbuf, tx_data, len); in uart_bt_fifo_fill()
135 k_work_reschedule_for_queue(&nus_work_queue, &dev_data->uart.tx_work, K_NO_WAIT); in uart_bt_fifo_fill()
145 return ring_buf_get(dev_data->uart.rx_ringbuf, rx_data, size); in uart_bt_fifo_read()
158 struct ring_buf *ringbuf = dev_data->uart.tx_ringbuf; in uart_bt_poll_out()
176 k_work_schedule_for_queue(&nus_work_queue, &dev_data->uart.tx_work, K_MSEC(1)); in uart_bt_poll_out()
184 if ((ring_buf_space_get(dev_data->uart.tx_ringbuf) > 0) && dev_data->uart.tx_irq_ena) { in uart_bt_irq_tx_ready()
195 dev_data->uart.tx_irq_ena = true; in uart_bt_irq_tx_enable()
198 k_work_submit_to_queue(&nus_work_queue, &dev_data->uart.cb_work); in uart_bt_irq_tx_enable()
206 dev_data->uart.tx_irq_ena = false; in uart_bt_irq_tx_disable()
213 if (!ring_buf_is_empty(dev_data->uart.rx_ringbuf) && dev_data->uart.rx_irq_ena) { in uart_bt_irq_rx_ready()
224 dev_data->uart.rx_irq_ena = true; in uart_bt_irq_rx_enable()
226 k_work_submit_to_queue(&nus_work_queue, &dev_data->uart.cb_work); in uart_bt_irq_rx_enable()
233 dev_data->uart.rx_irq_ena = false; in uart_bt_irq_rx_disable()
254 dev_data->uart.callback.cb = cb; in uart_bt_irq_callback_set()
255 dev_data->uart.callback.cb_data = cb_data; in uart_bt_irq_callback_set()
295 dev_data->uart.callback.dev = dev; in uart_bt_init()
297 k_work_init_delayable(&dev_data->uart.tx_work, tx_work_handler); in uart_bt_init()
298 k_work_init(&dev_data->uart.cb_work, cb_work_handler); in uart_bt_init()
327 .uart = { \