Lines Matching full:async
97 struct uart_npcx_async_data async; member
356 data->async.user_callback = NULL; in uart_npcx_irq_callback_set()
357 data->async.user_data = NULL; in uart_npcx_irq_callback_set()
423 if (data->async.user_callback) { in async_user_callback()
424 data->async.user_callback(dev, evt, data->async.user_data); in async_user_callback()
431 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in async_evt_rx_rdy()
454 (void)k_work_cancel_delayable(&data->async.tx_dma_params.timeout_work); in async_evt_tx_done()
456 LOG_DBG("TX done: %d", data->async.tx_dma_params.buf_len); in async_evt_tx_done()
459 .data.tx.buf = data->async.tx_dma_params.buf, in async_evt_tx_done()
460 .data.tx.len = data->async.tx_dma_params.buf_len}; in async_evt_tx_done()
463 data->async.tx_dma_params.buf = NULL; in async_evt_tx_done()
464 data->async.tx_dma_params.buf_len = 0U; in async_evt_tx_done()
483 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in uart_npcx_async_rx_flush()
515 data->async.user_callback = callback; in uart_npcx_async_callback_set()
516 data->async.user_data = user_data; in uart_npcx_async_callback_set()
529 LOG_DBG("async timer started for %d us", timeout_us); in async_timer_start()
556 struct uart_npcx_tx_dma_params *tx_dma_params = &data->async.tx_dma_params; in uart_npcx_async_tx()
569 data->async.tx_in_progress = true; in uart_npcx_async_tx()
571 data->async.tx_dma_params.buf = buf; in uart_npcx_async_tx()
572 data->async.tx_dma_params.buf_len = len; in uart_npcx_async_tx()
573 data->async.tx_dma_params.timeout_us = timeout; in uart_npcx_async_tx()
578 async_timer_start(&data->async.tx_dma_params.timeout_work, timeout); in uart_npcx_async_tx()
600 k_work_cancel_delayable(&data->async.tx_dma_params.timeout_work); in uart_npcx_async_tx_abort()
608 bytes_transmitted = data->async.tx_dma_params.buf_len - dma_pending_len; in uart_npcx_async_tx_abort()
613 .data.tx.buf = data->async.tx_dma_params.buf, in uart_npcx_async_tx_abort()
630 LOG_ERR("Async Tx Timeout"); in uart_npcx_async_tx_timeout()
641 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in uart_npcx_async_rx_enable()
682 .data.rx_buf.buf = data->async.rx_dma_params.buf, in async_evt_rx_buf_release()
686 data->async.rx_dma_params.buf = NULL; in async_evt_rx_buf_release()
687 data->async.rx_dma_params.buf_len = 0U; in async_evt_rx_buf_release()
688 data->async.rx_dma_params.offset = 0U; in async_evt_rx_buf_release()
689 data->async.rx_dma_params.counter = 0U; in async_evt_rx_buf_release()
698 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in uart_npcx_async_rx_disable()
701 LOG_DBG("Async RX Disable"); in uart_npcx_async_rx_disable()
717 if (data->async.next_rx_buffer != NULL) { in uart_npcx_async_rx_disable()
718 rx_dma_params->buf = data->async.next_rx_buffer; in uart_npcx_async_rx_disable()
719 rx_dma_params->buf_len = data->async.next_rx_buffer_len; in uart_npcx_async_rx_disable()
720 data->async.next_rx_buffer = NULL; in uart_npcx_async_rx_disable()
721 data->async.next_rx_buffer_len = 0; in uart_npcx_async_rx_disable()
741 if (data->async.next_rx_buffer != NULL) { in uart_npcx_async_rx_buf_rsp()
743 } else if (data->async.rx_dma_params.enabled == false) { in uart_npcx_async_rx_buf_rsp()
747 data->async.next_rx_buffer = buf; in uart_npcx_async_rx_buf_rsp()
748 data->async.next_rx_buffer_len = len; in uart_npcx_async_rx_buf_rsp()
764 LOG_DBG("Async RX timeout"); in uart_npcx_async_rx_timeout()
774 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in uart_npcx_async_dma_load_new_rx_buf()
779 rx_dma_params->buf = data->async.next_rx_buffer; in uart_npcx_async_dma_load_new_rx_buf()
780 rx_dma_params->buf_len = data->async.next_rx_buffer_len; in uart_npcx_async_dma_load_new_rx_buf()
781 data->async.next_rx_buffer = NULL; in uart_npcx_async_dma_load_new_rx_buf()
782 data->async.next_rx_buffer_len = 0; in uart_npcx_async_dma_load_new_rx_buf()
794 struct uart_npcx_rx_dma_params *rx_dma_params = &data->async.rx_dma_params; in uart_npcx_async_dma_rx_complete()
801 if (data->async.next_rx_buffer != NULL) { in uart_npcx_async_dma_rx_complete()
844 if (data->async.user_callback) { in uart_npcx_isr()
852 if (data->async.rx_dma_params.timeout_us == 0) { in uart_npcx_isr()
855 async_timer_start(&data->async.rx_dma_params.timeout_work, in uart_npcx_isr()
856 data->async.rx_dma_params.timeout_us); in uart_npcx_isr()
887 data->async.tx_in_progress = false; in uart_npcx_isr()
910 if (data->async.tx_in_progress) { in uart_npcx_isr()
911 data->async.tx_in_progress = false; in uart_npcx_isr()
1077 data->async.next_rx_buffer = NULL; in uart_npcx_init()
1078 data->async.next_rx_buffer_len = 0; in uart_npcx_init()
1079 data->async.uart_dev = dev; in uart_npcx_init()
1080 k_work_init_delayable(&data->async.rx_dma_params.timeout_work, uart_npcx_async_rx_timeout); in uart_npcx_init()
1081 k_work_init_delayable(&data->async.tx_dma_params.timeout_work, uart_npcx_async_tx_timeout); in uart_npcx_init()