Home
last modified time | relevance | path

Searched refs:uart_dev (Results 1 – 25 of 45) sorted by relevance

12

/Zephyr-Core-3.7.0/drivers/modem/
Dmodem_receiver.c42 if (contexts[i] && contexts[i]->uart_dev == dev) { in context_from_dev()
88 __ASSERT(ctx->uart_dev, "invalid ctx device"); in mdm_receiver_flush()
90 while (uart_fifo_read(ctx->uart_dev, &c, 1) > 0) { in mdm_receiver_flush()
105 static void mdm_receiver_isr(const struct device *uart_dev, void *user_data) in mdm_receiver_isr() argument
114 ctx = context_from_dev(uart_dev); in mdm_receiver_isr()
120 while (uart_irq_update(ctx->uart_dev) && in mdm_receiver_isr()
121 uart_irq_rx_ready(ctx->uart_dev)) { in mdm_receiver_isr()
122 rx = uart_fifo_read(ctx->uart_dev, read_buf, sizeof(read_buf)); in mdm_receiver_isr()
149 uart_irq_rx_disable(ctx->uart_dev); in mdm_receiver_setup()
150 uart_irq_tx_disable(ctx->uart_dev); in mdm_receiver_setup()
[all …]
/Zephyr-Core-3.7.0/subsys/debug/gdbstub/
Dgdbstub_backend_serial.c11 static const struct device *uart_dev; variable
28 if (uart_dev == NULL) { in z_gdb_backend_init()
29 uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_gdbstub_uart)); in z_gdb_backend_init()
31 __ASSERT(device_is_ready(uart_dev), "uart device is not ready"); in z_gdb_backend_init()
33 ret = uart_configure(uart_dev, &uart_cfg); in z_gdb_backend_init()
45 uart_poll_out(uart_dev, ch); in z_gdb_putchar()
52 while (uart_poll_in(uart_dev, &ch) < 0) { in z_gdb_getchar()
/Zephyr-Core-3.7.0/tests/drivers/uart/uart_basic_api/src/
Dtest_uart_fifo.c101 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_fifo_read() local
103 if (!device_is_ready(uart_dev)) { in test_fifo_read()
109 uart_irq_callback_set(uart_dev, uart_fifo_callback); in test_fifo_read()
113 uart_irq_rx_enable(uart_dev); in test_fifo_read()
124 uart_irq_rx_disable(uart_dev); in test_fifo_read()
131 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_fifo_fill() local
133 if (!device_is_ready(uart_dev)) { in test_fifo_fill()
141 uart_irq_callback_set(uart_dev, uart_fifo_callback); in test_fifo_fill()
145 uart_irq_tx_enable(uart_dev); in test_fifo_fill()
150 uart_irq_tx_disable(uart_dev); in test_fifo_fill()
Dtest_uart_poll.c14 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_poll_in() local
16 if (!device_is_ready(uart_dev)) { in test_poll_in()
25 while (uart_poll_in(uart_dev, &recv_char) < 0) { in test_poll_in()
43 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_poll_out() local
45 if (!device_is_ready(uart_dev)) { in test_poll_out()
52 uart_poll_out(uart_dev, poll_data[i]); in test_poll_out()
Dtest_uart_config_wide.c38 const struct device *const uart_dev = DEVICE_DT_GET(DT_NODELABEL(dut)); in test_configure_wide() local
40 if (!device_is_ready(uart_dev)) { in test_configure_wide()
46 int ret = uart_configure(uart_dev, &uart_cfg_wide); in test_configure_wide()
61 const struct device *const uart_dev = DEVICE_DT_GET(DT_NODELABEL(dut)); in test_config_get_wide() local
63 if (!device_is_ready(uart_dev)) { in test_config_get_wide()
72 int ret = uart_configure(uart_dev, &uart_cfg_wide); in test_config_get_wide()
83 ret = uart_config_get(uart_dev, &uart_cfg_check); in test_config_get_wide()
Dtest_uart_config.c38 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_configure() local
40 if (!device_is_ready(uart_dev)) { in test_configure()
46 int ret = uart_configure(uart_dev, &uart_cfg); in test_configure()
61 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_config_get() local
63 if (!device_is_ready(uart_dev)) { in test_config_get()
72 int ret = uart_configure(uart_dev, &uart_cfg); in test_config_get()
83 ret = uart_config_get(uart_dev, &uart_cfg_check); in test_config_get()
Dtest_uart_pending.c96 const struct device *const uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in test_pending() local
98 if (!device_is_ready(uart_dev)) { in test_pending()
106 uart_irq_callback_set(uart_dev, uart_pending_callback); in test_pending()
113 uart_irq_tx_disable(uart_dev); in test_pending()
119 uart_irq_rx_enable(uart_dev); in test_pending()
/Zephyr-Core-3.7.0/samples/drivers/uart/echo_bot/src/
Dmain.c21 static const struct device *const uart_dev = DEVICE_DT_GET(UART_DEVICE_NODE); variable
35 if (!uart_irq_update(uart_dev)) { in serial_cb()
39 if (!uart_irq_rx_ready(uart_dev)) { in serial_cb()
44 while (uart_fifo_read(uart_dev, &c, 1) == 1) { in serial_cb()
69 uart_poll_out(uart_dev, buf[i]); in print_uart()
77 if (!device_is_ready(uart_dev)) { in main()
83 int ret = uart_irq_callback_user_data_set(uart_dev, serial_cb, NULL); in main()
95 uart_irq_rx_enable(uart_dev); in main()
/Zephyr-Core-3.7.0/drivers/sensor/a01nyub/
Da01nyub.c42 const struct device *uart_dev; member
46 static void a01nyub_uart_flush(const struct device *uart_dev) in a01nyub_uart_flush() argument
50 while (uart_fifo_read(uart_dev, &c, 1) > 0) { in a01nyub_uart_flush()
122 static void a01nyub_uart_isr(const struct device *uart_dev, void *user_data) in a01nyub_uart_isr() argument
127 if (uart_dev == NULL) { in a01nyub_uart_isr()
132 if (!uart_irq_update(uart_dev)) { in a01nyub_uart_isr()
137 if (uart_irq_rx_ready(uart_dev)) { in a01nyub_uart_isr()
138 data->xfer_bytes += uart_fifo_read(uart_dev, &data->rd_data[data->xfer_bytes], in a01nyub_uart_isr()
156 a01nyub_uart_flush(uart_dev); in a01nyub_uart_isr()
167 uart_irq_rx_disable(cfg->uart_dev); in a01nyub_init()
[all …]
/Zephyr-Core-3.7.0/subsys/logging/backends/
Dlog_backend_uart.c32 const struct device *uart_dev; member
38 COND_CODE_1(DT_HAS_CHOSEN(zephyr_log_uart), (ctx->uart_dev), \
64 static void dict_char_out_hex(const struct device *uart_dev, uint8_t *data, size_t length) in dict_char_out_hex() argument
73 uart_poll_out(uart_dev, c); in dict_char_out_hex()
78 uart_poll_out(uart_dev, c); in dict_char_out_hex()
87 const struct device *uart_dev = LBU_UART_DEV(cb_ctx); in char_out() local
89 if (pm_device_runtime_get(uart_dev) < 0) { in char_out()
97 dict_char_out_hex(uart_dev, data, length); in char_out()
104 uart_poll_out(uart_dev, data[i]); in char_out()
109 err = uart_tx(uart_dev, data, length, SYS_FOREVER_US); in char_out()
[all …]
/Zephyr-Core-3.7.0/tests/drivers/uart/uart_elementary/src/
Dmain.c32 static const struct device *const uart_dev = DEVICE_DT_GET(UART_NODE); variable
143 err = uart_configure(uart_dev, &test_uart_config); in ZTEST()
146 err = uart_config_get(uart_dev, &test_expected_uart_config); in ZTEST()
184 err = uart_configure(uart_dev, &test_uart_config); in ZTEST()
204 err = uart_configure(uart_dev, &test_uart_config); in ZTEST()
207 err = uart_irq_callback_set(uart_dev, interrupt_driven_uart_callback_main_uart); in ZTEST()
209 err = uart_irq_callback_user_data_set(uart_dev, interrupt_driven_uart_callback_main_uart, in ZTEST()
212 uart_irq_err_enable(uart_dev); in ZTEST()
213 uart_irq_rx_enable(uart_dev); in ZTEST()
214 uart_irq_tx_enable(uart_dev); in ZTEST()
[all …]
/Zephyr-Core-3.7.0/drivers/sensor/explorir_m/
Dexplorir_m.c55 const struct device *uart_dev; member
71 static void explorir_m_uart_flush(const struct device *uart_dev) in explorir_m_uart_flush() argument
75 while (uart_fifo_read(uart_dev, &tmp, 1) > 0) { in explorir_m_uart_flush()
80 static void explorir_m_uart_flush_until_end(const struct device *uart_dev) in explorir_m_uart_flush_until_end() argument
87 uart_poll_in(uart_dev, &tmp); in explorir_m_uart_flush_until_end()
154 static void explorir_m_uart_isr(const struct device *uart_dev, void *user_data) in explorir_m_uart_isr() argument
160 if (!device_is_ready(uart_dev)) { in explorir_m_uart_isr()
165 if (!uart_irq_update(uart_dev)) { in explorir_m_uart_isr()
170 if (!uart_irq_rx_ready(uart_dev)) { in explorir_m_uart_isr()
176 rc = uart_fifo_read(uart_dev, &data->read_buffer[data->read_index], read_len); in explorir_m_uart_isr()
[all …]
/Zephyr-Core-3.7.0/tests/drivers/uart/uart_async_api/src/
Dtest_uart_async.c28 static ZTEST_BMEM const struct device *const uart_dev = variable
37 __ASSERT_NO_MSG(device_is_ready(uart_dev)); in init_test()
38 uart_rx_disable(uart_dev); in init_test()
39 uart_tx_abort(uart_dev); in init_test()
52 &rx_disabled, uart_dev, &read_abort_timer); in set_permissions()
60 __ASSERT_NO_MSG(device_is_ready(uart_dev)); in uart_async_test_init()
61 uart_rx_disable(uart_dev); in uart_async_test_init()
62 uart_tx_abort(uart_dev); in uart_async_test_init()
78 __ASSERT_NO_MSG(uart_configure(uart_dev, &uart_cfg) == 0); in uart_async_test_init()
154 uart_callback_set(uart_dev, in single_read_setup()
[all …]
Dtest_uart_wide.c15 static ZTEST_BMEM const struct device *const uart_dev = variable
20 __ASSERT_NO_MSG(device_is_ready(uart_dev)); in init_test()
21 uart_rx_disable(uart_dev); in init_test()
22 uart_tx_abort(uart_dev); in init_test()
35 uart_dev); in set_permissions()
80 uart_callback_set(uart_dev, in single_read_setup_wide()
97 uart_rx_enable_u16(uart_dev, rx_buf, 10, 50 * USEC_PER_MSEC); in ZTEST_USER()
101 uart_tx_u16(uart_dev, tx_buf, sizeof(tx_buf)/sizeof(uint16_t), 100 * USEC_PER_MSEC); in ZTEST_USER()
110 uart_tx_u16(uart_dev, tx_buf, sizeof(tx_buf)/sizeof(uint16_t), 100 * USEC_PER_MSEC); in ZTEST_USER()
/Zephyr-Core-3.7.0/drivers/sensor/mhz19b/
Dmhz19b.c54 static void mhz19b_uart_flush(const struct device *uart_dev) in mhz19b_uart_flush() argument
58 while (uart_fifo_read(uart_dev, &c, 1) > 0) { in mhz19b_uart_flush()
90 uart_irq_tx_enable(cfg->uart_dev); in mhz19b_send_cmd()
93 uart_irq_rx_enable(cfg->uart_dev); in mhz19b_send_cmd()
257 static void mhz19b_uart_isr(const struct device *uart_dev, void *user_data) in mhz19b_uart_isr() argument
264 if (uart_dev == NULL) { in mhz19b_uart_isr()
268 if (!uart_irq_update(uart_dev)) { in mhz19b_uart_isr()
272 if (uart_irq_rx_ready(uart_dev)) { in mhz19b_uart_isr()
273 data->xfer_bytes += uart_fifo_read(uart_dev, &data->rd_data[data->xfer_bytes], in mhz19b_uart_isr()
278 uart_irq_rx_disable(uart_dev); in mhz19b_uart_isr()
[all …]
/Zephyr-Core-3.7.0/tests/drivers/uart/uart_mix_fifo_poll/src/
Dmain.c69 static const struct device *const uart_dev = variable
110 err = uart_rx_enable(uart_dev, async_rx_buf, in counter_top_handler()
116 uart_irq_rx_enable(uart_dev); in counter_top_handler()
118 uart_irq_rx_disable(uart_dev); in counter_top_handler()
125 while (uart_poll_in(uart_dev, &c) >= 0) { in counter_top_handler()
140 zassert_true(device_is_ready(uart_dev), "uart device is not ready"); in init_test()
142 if (uart_callback_set(uart_dev, async_callback, NULL) == 0) { in init_test()
146 int_driven = uart_irq_tx_complete(uart_dev) >= 0; in init_test()
148 uart_irq_callback_set(uart_dev, int_driven_callback); in init_test()
172 len = uart_fifo_read(uart_dev, buf, BUF_SIZE); in rx_isr()
[all …]
/Zephyr-Core-3.7.0/subsys/console/
Dgetchar.c52 const struct device *uart_dev; in console_init() local
55 uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in console_init()
56 if (!device_is_ready(uart_dev)) { in console_init()
60 ret = tty_init(&console_serial, uart_dev); in console_init()
69 (const struct uart_driver_api *)uart_dev->api; in console_init()
Dtty.c96 uart_irq_tx_enable(tty->uart_dev); in tty_putchar()
111 uart_poll_out(tty->uart_dev, *p++); in tty_write()
171 res = uart_poll_in(tty->uart_dev, &c); in tty_read_unbuf()
241 int tty_init(struct tty_serial *tty, const struct device *uart_dev) in tty_init() argument
243 if (!uart_dev) { in tty_init()
247 tty->uart_dev = uart_dev; in tty_init()
260 uart_irq_callback_user_data_set(uart_dev, tty_uart_isr, tty); in tty_init()
267 uart_irq_rx_disable(tty->uart_dev); in tty_set_rx_buf()
274 uart_irq_rx_enable(tty->uart_dev); in tty_set_rx_buf()
282 uart_irq_tx_disable(tty->uart_dev); in tty_set_tx_buf()
/Zephyr-Core-3.7.0/drivers/input/
Dinput_sbus.c40 const struct device *uart_dev; member
202 static void sbus_resync(const struct device *uart_dev, struct input_sbus_data *const data) in sbus_resync() argument
207 data->xfer_bytes += uart_fifo_read(uart_dev, &rd_data[data->xfer_bytes], in sbus_resync()
219 uart_fifo_read(uart_dev, &rd_data[0], 1); in sbus_resync()
225 if (uart_fifo_read(uart_dev, &rd_data[0], 1) == 1) { in sbus_resync()
235 static void sbus_uart_isr(const struct device *uart_dev, void *user_data) in sbus_uart_isr() argument
241 if (uart_dev == NULL) { in sbus_uart_isr()
246 if (!uart_irq_update(uart_dev)) { in sbus_uart_isr()
251 while (uart_irq_rx_ready(uart_dev) && data->xfer_bytes <= SBUS_FRAME_LEN) { in sbus_uart_isr()
256 data->xfer_bytes += uart_fifo_read(uart_dev, &rd_data[data->xfer_bytes], in sbus_uart_isr()
[all …]
/Zephyr-Core-3.7.0/samples/subsys/usb/cdc_acm/src/
Dmain.c29 const struct device *const uart_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart); variable
176 if (!device_is_ready(uart_dev)) { in main()
202 uart_line_ctrl_get(uart_dev, UART_LINE_CTRL_DTR, &dtr); in main()
215 ret = uart_line_ctrl_set(uart_dev, UART_LINE_CTRL_DCD, 1); in main()
220 ret = uart_line_ctrl_set(uart_dev, UART_LINE_CTRL_DSR, 1); in main()
229 print_baudrate(uart_dev); in main()
231 uart_irq_callback_set(uart_dev, interrupt_handler); in main()
234 uart_irq_rx_enable(uart_dev); in main()
/Zephyr-Core-3.7.0/samples/subsys/zbus/remote_mock/src/
Dmock_proxy.c17 const static struct device *uart_dev = DEVICE_DT_GET(DT_NODELABEL(uart1)); variable
70 uart_poll_out(uart_dev, '$'); in proxy_callback()
72 uart_poll_out(uart_dev, encoder(chan)); in proxy_callback()
75 uart_poll_out(uart_dev, ((unsigned char *)zbus_chan_const_msg(chan))[i]); in proxy_callback()
78 uart_poll_out(uart_dev, '*'); in proxy_callback()
138 while (uart_poll_in(uart_dev, &byte) < 0) { in mock_proxy_rx_thread()
/Zephyr-Core-3.7.0/subsys/mgmt/ec_host_cmd/backends/
Dec_host_cmd_backend_uart.c71 const struct device *uart_dev; member
143 res = uart_rx_disable(hc_uart->uart_dev); in rx_timeout()
144 res = uart_rx_enable(hc_uart->uart_dev, hc_uart->rx_ctx->buf, hc_uart->rx_buf_size, 0); in rx_timeout()
202 uart_rx_disable(hc_uart->uart_dev); in uart_callback()
241 if (!device_is_ready(hc_uart->uart_dev)) { in ec_host_cmd_uart_init()
262 uart_callback_set(hc_uart->uart_dev, uart_callback, hc_uart); in ec_host_cmd_uart_init()
263 ret = uart_rx_enable(hc_uart->uart_dev, hc_uart->rx_ctx->buf, hc_uart->rx_buf_size, 0); in ec_host_cmd_uart_init()
285 uart_rx_enable(hc_uart->uart_dev, hc_uart->rx_ctx->buf, hc_uart->rx_buf_size, 0); in ec_host_cmd_uart_send()
290 ret = uart_tx(hc_uart->uart_dev, hc_uart->tx_buf->buf, hc_uart->tx_buf->len, in ec_host_cmd_uart_send()
312 hc_uart->uart_dev = dev; in ec_host_cmd_backend_get_uart()
/Zephyr-Core-3.7.0/drivers/w1/
Dw1_zephyr_serial.c55 const struct device *uart_dev; member
81 while (uart_poll_in(cfg->uart_dev, &dummy) == 0) { in serial_tx_rx()
85 uart_poll_out(cfg->uart_dev, tx_data[i]); in serial_tx_rx()
89 ret = uart_poll_in(cfg->uart_dev, &rx_data[i]); in serial_tx_rx()
143 if (uart_configure(cfg->uart_dev, &data->uart_cfg) != 0) { in w1_serial_reset_bus()
155 if (uart_configure(cfg->uart_dev, &data->uart_cfg) != 0) { in w1_serial_reset_bus()
229 if (uart_configure(cfg->uart_dev, &data->uart_cfg) != 0) { in w1_serial_configure()
245 if (!device_is_ready(cfg->uart_dev)) { in w1_serial_init()
256 if (uart_configure(cfg->uart_dev, &data->uart_cfg) != 0) { in w1_serial_init()
279 .uart_dev = DEVICE_DT_GET(DT_INST_BUS(inst)), \
/Zephyr-Core-3.7.0/drivers/sensor/fcx_mldx5/
Dfcx_mldx5.c55 const struct device *uart_dev; member
97 static void fcx_mldx5_uart_flush(const struct device *uart_dev) in fcx_mldx5_uart_flush() argument
101 while (uart_fifo_read(uart_dev, &tmp, 1) > 0) { in fcx_mldx5_uart_flush()
186 static void fcx_mldx5_uart_isr(const struct device *uart_dev, void *user_data) in fcx_mldx5_uart_isr() argument
192 if (!device_is_ready(uart_dev)) { in fcx_mldx5_uart_isr()
197 if (!uart_irq_update(uart_dev)) { in fcx_mldx5_uart_isr()
202 if (!uart_irq_rx_ready(uart_dev)) { in fcx_mldx5_uart_isr()
208 rc = read_len > 0 ? uart_fifo_read(uart_dev, &data->frame[data->frame_len], read_len) in fcx_mldx5_uart_isr()
213 fcx_mldx5_uart_flush(uart_dev); in fcx_mldx5_uart_isr()
248 uart_poll_out(cfg->uart_dev, buf[i]); in fcx_mldx5_uart_send()
[all …]
/Zephyr-Core-3.7.0/drivers/sensor/pms7003/
Dpms7003.c31 const struct device *uart_dev; member
124 if (uart_wait_for(cfg->uart_dev, pms7003_start_bytes, in pms7003_sample_fetch()
131 if (uart_read_bytes(cfg->uart_dev, pms7003_receive_buffer, 30, in pms7003_sample_fetch()
179 if (!device_is_ready(cfg->uart_dev)) { in pms7003_init()
191 .uart_dev = DEVICE_DT_GET(DT_INST_BUS(inst)), \

12