Lines Matching full:async

121 	struct uart_esp32_async_data async;  member
501 data->async.cb = NULL; in uart_esp32_irq_callback_set()
502 data->async.user_data = NULL; in uart_esp32_irq_callback_set()
513 LOG_DBG("Async timer started for %d us", timeout); in uart_esp32_async_timer_start()
551 data->async.rx_counter++; in uart_esp32_isr()
552 uart_esp32_async_timer_start(&data->async.rx_timeout_work, data->async.rx_timeout); in uart_esp32_isr()
572 if (data->async.rx_counter != data->async.rx_len) { in uart_esp32_dma_rx_done()
574 (uint32_t)data->async.rx_buf + data->async.rx_counter, in uart_esp32_dma_rx_done()
575 data->async.rx_len - data->async.rx_counter); in uart_esp32_dma_rx_done()
577 data->uhci_dev->pkt_thres.thrs = data->async.rx_len - data->async.rx_counter; in uart_esp32_dma_rx_done()
584 evt.data.rx.buf = data->async.rx_buf; in uart_esp32_dma_rx_done()
585 evt.data.rx.len = data->async.rx_counter - data->async.rx_offset; in uart_esp32_dma_rx_done()
586 evt.data.rx.offset = data->async.rx_offset; in uart_esp32_dma_rx_done()
588 if (data->async.cb && evt.data.rx.len) { in uart_esp32_dma_rx_done()
589 data->async.cb(data->uart_dev, &evt, data->async.user_data); in uart_esp32_dma_rx_done()
592 data->async.rx_offset = 0; in uart_esp32_dma_rx_done()
593 data->async.rx_counter = 0; in uart_esp32_dma_rx_done()
597 evt.data.rx_buf.buf = data->async.rx_buf; in uart_esp32_dma_rx_done()
598 if (data->async.cb) { in uart_esp32_dma_rx_done()
599 data->async.cb(uart_dev, &evt, data->async.user_data); in uart_esp32_dma_rx_done()
603 data->async.rx_buf = data->async.rx_next_buf; in uart_esp32_dma_rx_done()
604 data->async.rx_len = data->async.rx_next_len; in uart_esp32_dma_rx_done()
605 data->async.rx_next_buf = NULL; in uart_esp32_dma_rx_done()
606 data->async.rx_next_len = 0U; in uart_esp32_dma_rx_done()
608 if (data->async.cb) { in uart_esp32_dma_rx_done()
609 data->async.cb(uart_dev, &evt, data->async.user_data); in uart_esp32_dma_rx_done()
613 if (!data->async.rx_buf) { in uart_esp32_dma_rx_done()
615 if (data->async.cb) { in uart_esp32_dma_rx_done()
616 data->async.cb(uart_dev, &evt, data->async.user_data); in uart_esp32_dma_rx_done()
620 dma_reload(config->dma_dev, config->rx_dma_channel, 0, (uint32_t)data->async.rx_buf, in uart_esp32_dma_rx_done()
621 data->async.rx_len); in uart_esp32_dma_rx_done()
623 data->uhci_dev->pkt_thres.thrs = data->async.rx_len; in uart_esp32_dma_rx_done()
637 k_work_cancel_delayable(&data->async.tx_timeout_work); in uart_esp32_dma_tx_done()
640 evt.data.tx.buf = data->async.tx_buf; in uart_esp32_dma_tx_done()
641 evt.data.tx.len = data->async.tx_len; in uart_esp32_dma_tx_done()
642 if (data->async.cb) { in uart_esp32_dma_tx_done()
643 data->async.cb(uart_dev, &evt, data->async.user_data); in uart_esp32_dma_tx_done()
647 data->async.tx_buf = NULL; in uart_esp32_dma_tx_done()
648 data->async.tx_len = 0U; in uart_esp32_dma_tx_done()
660 k_work_cancel_delayable(&data->async.tx_timeout_work); in uart_esp32_async_tx_abort()
669 evt.data.tx.buf = data->async.tx_buf; in uart_esp32_async_tx_abort()
670 evt.data.tx.len = data->async.tx_len; in uart_esp32_async_tx_abort()
672 if (data->async.cb) { in uart_esp32_async_tx_abort()
673 data->async.cb(dev, &evt, data->async.user_data); in uart_esp32_async_tx_abort()
684 struct uart_esp32_async_data *async = in uart_esp32_async_tx_timeout() local
686 struct uart_esp32_data *data = CONTAINER_OF(async, struct uart_esp32_data, async); in uart_esp32_async_tx_timeout()
694 struct uart_esp32_async_data *async = in uart_esp32_async_rx_timeout() local
696 struct uart_esp32_data *data = CONTAINER_OF(async, struct uart_esp32_data, async); in uart_esp32_async_rx_timeout()
701 evt.data.rx.buf = data->async.rx_buf; in uart_esp32_async_rx_timeout()
702 evt.data.rx.len = data->async.rx_counter - data->async.rx_offset; in uart_esp32_async_rx_timeout()
703 evt.data.rx.offset = data->async.rx_offset; in uart_esp32_async_rx_timeout()
705 if (data->async.cb && evt.data.rx.len) { in uart_esp32_async_rx_timeout()
706 data->async.cb(data->uart_dev, &evt, data->async.user_data); in uart_esp32_async_rx_timeout()
709 data->async.rx_offset = data->async.rx_counter; in uart_esp32_async_rx_timeout()
710 k_work_cancel_delayable(&data->async.rx_timeout_work); in uart_esp32_async_rx_timeout()
723 data->async.cb = callback; in uart_esp32_async_callback_set()
724 data->async.user_data = user_data; in uart_esp32_async_callback_set()
763 data->async.tx_buf = buf; in uart_esp32_async_tx()
764 data->async.tx_len = len; in uart_esp32_async_tx()
781 uart_esp32_async_timer_start(&data->async.tx_timeout_work, timeout); in uart_esp32_async_tx()
823 data->async.rx_buf = buf; in uart_esp32_async_rx_enable()
824 data->async.rx_len = len; in uart_esp32_async_rx_enable()
825 data->async.rx_timeout = timeout; in uart_esp32_async_rx_enable()
834 dma_blk.dest_address = (uint32_t)data->async.rx_buf; in uart_esp32_async_rx_enable()
843 * Enable interrupt on first receive byte so we can start async timer in uart_esp32_async_rx_enable()
860 if (data->async.cb) { in uart_esp32_async_rx_enable()
861 data->async.cb(dev, &evt, data->async.user_data); in uart_esp32_async_rx_enable()
873 data->async.rx_next_buf = buf; in uart_esp32_async_rx_buf_rsp()
874 data->async.rx_next_len = len; in uart_esp32_async_rx_buf_rsp()
887 k_work_cancel_delayable(&data->async.rx_timeout_work); in uart_esp32_async_rx_disable()
889 if (!data->async.rx_len) { in uart_esp32_async_rx_disable()
902 evt.data.rx.buf = data->async.rx_buf; in uart_esp32_async_rx_disable()
903 evt.data.rx.len = data->async.rx_counter - data->async.rx_offset; in uart_esp32_async_rx_disable()
904 evt.data.rx.offset = data->async.rx_offset; in uart_esp32_async_rx_disable()
906 if (data->async.cb && evt.data.rx.len) { in uart_esp32_async_rx_disable()
907 data->async.cb(data->uart_dev, &evt, data->async.user_data); in uart_esp32_async_rx_disable()
910 data->async.rx_offset = 0; in uart_esp32_async_rx_disable()
911 data->async.rx_counter = 0; in uart_esp32_async_rx_disable()
915 evt.data.rx_buf.buf = data->async.rx_buf; in uart_esp32_async_rx_disable()
917 if (data->async.cb) { in uart_esp32_async_rx_disable()
918 data->async.cb(dev, &evt, data->async.user_data); in uart_esp32_async_rx_disable()
921 data->async.rx_len = 0; in uart_esp32_async_rx_disable()
922 data->async.rx_buf = NULL; in uart_esp32_async_rx_disable()
925 if (data->async.rx_next_len) { in uart_esp32_async_rx_disable()
927 evt.data.rx_buf.buf = data->async.rx_next_buf; in uart_esp32_async_rx_disable()
928 if (data->async.cb) { in uart_esp32_async_rx_disable()
929 data->async.cb(dev, &evt, data->async.user_data); in uart_esp32_async_rx_disable()
932 data->async.rx_next_len = 0; in uart_esp32_async_rx_disable()
933 data->async.rx_next_buf = NULL; in uart_esp32_async_rx_disable()
938 if (data->async.cb) { in uart_esp32_async_rx_disable()
939 data->async.cb(dev, &evt, data->async.user_data); in uart_esp32_async_rx_disable()
986 k_work_init_delayable(&data->async.tx_timeout_work, uart_esp32_async_tx_timeout); in uart_esp32_init()
987 k_work_init_delayable(&data->async.rx_timeout_work, uart_esp32_async_rx_timeout); in uart_esp32_init()