Lines Matching full:async
25 if (!atomic_test_bit(&backend->async.state, in modem_backend_uart_async_is_uart_stopped()
27 !atomic_test_bit(&backend->async.state, in modem_backend_uart_async_is_uart_stopped()
29 !atomic_test_bit(&backend->async.state, in modem_backend_uart_async_is_uart_stopped()
31 !atomic_test_bit(&backend->async.state, in modem_backend_uart_async_is_uart_stopped()
41 return atomic_test_bit(&backend->async.state, in modem_backend_uart_async_is_open()
47 return ring_buf_size_get(&backend->async.receive_rb); in get_receive_buf_length()
59 atomic_clear_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
68 atomic_clear_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
75 if (!atomic_test_and_set_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
77 uart_rx_buf_rsp(backend->uart, backend->async.receive_bufs[0], in modem_backend_uart_async_event_handler()
78 backend->async.receive_buf_size); in modem_backend_uart_async_event_handler()
83 if (!atomic_test_and_set_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
85 uart_rx_buf_rsp(backend->uart, backend->async.receive_bufs[1], in modem_backend_uart_async_event_handler()
86 backend->async.receive_buf_size); in modem_backend_uart_async_event_handler()
95 if (evt->data.rx_buf.buf == backend->async.receive_bufs[0]) { in modem_backend_uart_async_event_handler()
96 atomic_clear_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
102 if (evt->data.rx_buf.buf == backend->async.receive_bufs[1]) { in modem_backend_uart_async_event_handler()
103 atomic_clear_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
113 key = k_spin_lock(&backend->async.receive_rb_lock); in modem_backend_uart_async_event_handler()
114 received = ring_buf_put(&backend->async.receive_rb, in modem_backend_uart_async_event_handler()
121 ring_buf_reset(&backend->async.receive_rb); in modem_backend_uart_async_event_handler()
122 k_spin_unlock(&backend->async.receive_rb_lock, key); in modem_backend_uart_async_event_handler()
129 k_spin_unlock(&backend->async.receive_rb_lock, key); in modem_backend_uart_async_event_handler()
134 atomic_clear_bit(&backend->async.state, in modem_backend_uart_async_event_handler()
147 k_work_submit(&backend->async.rx_disabled_work); in modem_backend_uart_async_event_handler()
156 atomic_clear(&backend->async.state); in modem_backend_uart_async_open()
157 ring_buf_reset(&backend->async.receive_rb); in modem_backend_uart_async_open()
159 atomic_set_bit(&backend->async.state, MODEM_BACKEND_UART_ASYNC_STATE_RX_BUF0_USED_BIT); in modem_backend_uart_async_open()
160 atomic_set_bit(&backend->async.state, MODEM_BACKEND_UART_ASYNC_STATE_RECEIVING_BIT); in modem_backend_uart_async_open()
161 atomic_set_bit(&backend->async.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); in modem_backend_uart_async_open()
166 ret = uart_rx_enable(backend->uart, backend->async.receive_bufs[0], in modem_backend_uart_async_open()
167 backend->async.receive_buf_size, in modem_backend_uart_async_open()
170 atomic_clear(&backend->async.state); in modem_backend_uart_async_open()
181 return ring_buf_capacity_get(&backend->async.receive_rb); in get_receive_buf_size()
200 return backend->async.transmit_buf_size; in get_transmit_buf_size()
210 transmitting = atomic_test_and_set_bit(&backend->async.state, in modem_backend_uart_async_transmit()
220 memcpy(backend->async.transmit_buf, buf, bytes_to_transmit); in modem_backend_uart_async_transmit()
222 ret = uart_tx(backend->uart, backend->async.transmit_buf, bytes_to_transmit, in modem_backend_uart_async_transmit()
231 "start async transmit for", bytes_to_transmit, ret); in modem_backend_uart_async_transmit()
245 key = k_spin_lock(&backend->async.receive_rb_lock); in modem_backend_uart_async_receive()
251 received = ring_buf_get(&backend->async.receive_rb, buf, size); in modem_backend_uart_async_receive()
252 empty = ring_buf_is_empty(&backend->async.receive_rb); in modem_backend_uart_async_receive()
253 k_spin_unlock(&backend->async.receive_rb_lock, key); in modem_backend_uart_async_receive()
266 atomic_clear_bit(&backend->async.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); in modem_backend_uart_async_close()
287 struct modem_backend_uart_async *async = in modem_backend_uart_async_notify_closed() local
291 CONTAINER_OF(async, struct modem_backend_uart, async); in modem_backend_uart_async_notify_closed()
319 backend->async.receive_buf_size = receive_buf_size_quarter; in modem_backend_uart_async_init()
320 backend->async.receive_bufs[0] = &config->receive_buf[0]; in modem_backend_uart_async_init()
321 backend->async.receive_bufs[1] = &config->receive_buf[receive_buf_size_quarter]; in modem_backend_uart_async_init()
324 ring_buf_init(&backend->async.receive_rb, (receive_buf_size_quarter * 2), in modem_backend_uart_async_init()
327 backend->async.transmit_buf = config->transmit_buf; in modem_backend_uart_async_init()
328 backend->async.transmit_buf_size = config->transmit_buf_size; in modem_backend_uart_async_init()
329 k_work_init(&backend->async.rx_disabled_work, modem_backend_uart_async_notify_closed); in modem_backend_uart_async_init()