/Zephyr-latest/drivers/serial/ |
D | uart_sam.c | 5 * SPDX-License-Identifier: Apache-2.0 11 * @brief UART driver for Atmel SAM MCU family. 19 #include <zephyr/drivers/uart.h> 26 Uart *regs; 45 static int uart_sam_poll_in(const struct device *dev, unsigned char *c) in uart_sam_poll_in() argument 47 const struct uart_sam_dev_cfg *const cfg = dev->config; in uart_sam_poll_in() 49 Uart * const uart = cfg->regs; in uart_sam_poll_in() local 51 if (!(uart->UART_SR & UART_SR_RXRDY)) { in uart_sam_poll_in() 52 return -1; in uart_sam_poll_in() 56 *c = (unsigned char)uart->UART_RHR; in uart_sam_poll_in() [all …]
|
D | uart_imx.c | 4 * SPDX-License-Identifier: Apache-2.0 10 * @brief Driver for UART on NXP IMX family processor. 21 #include <zephyr/drivers/uart.h> 26 #define UART_STRUCT(dev) \ argument 27 ((UART_Type *)((const struct imx_uart_config *const)(dev)->config)->base) 35 void (*irq_config_func)(const struct device *dev); 47 * @brief Initialize UART channel 50 * It is assumed that this function is called only once per UART. 52 * @param dev UART device struct 56 static int uart_imx_init(const struct device *dev) in uart_imx_init() argument [all …]
|
D | uart_numaker.c | 2 * SPDX-License-Identifier: Apache-2.0 10 #include <zephyr/drivers/uart.h> 22 UART_T *uart; member 30 void (*irq_config_func)(const struct device *dev); 44 static int uart_numaker_poll_in(const struct device *dev, unsigned char *c) in uart_numaker_poll_in() argument 46 const struct uart_numaker_config *config = dev->config; in uart_numaker_poll_in() 49 count = UART_Read(config->uart, c, 1); in uart_numaker_poll_in() 51 return -1; in uart_numaker_poll_in() 57 static void uart_numaker_poll_out(const struct device *dev, unsigned char c) in uart_numaker_poll_out() argument 59 const struct uart_numaker_config *config = dev->config; in uart_numaker_poll_out() [all …]
|
D | uart_stellaris.c | 1 /* stellarisUartDrv.c - Stellaris UART driver */ 6 * Copyright (c) 2013-2015 Wind River Systems, Inc. 8 * SPDX-License-Identifier: Apache-2.0 12 * @brief Driver for Stellaris UART 14 * Driver for Stellaris UART found namely on TI LM3S6965 board. It is similar to 15 * an 16550 in functionality, but is not register-compatible. 16 * It is also register-compatible with the UART found on TI CC2650 SoC, 19 * There is only support for poll-mode, so it can only be used with the printk 28 #include <zephyr/drivers/uart.h> 34 /* Stellaris UART module */ [all …]
|
D | uart_sifive.c | 2 * Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com> 4 * SPDX-License-Identifier: Apache-2.0 8 * @brief UART driver for the SiFive Freedom Processor 15 #include <zephyr/drivers/uart.h> 71 #define DEV_UART(dev) \ argument 73 ((const struct uart_sifive_device_config * const)(dev)->config)->port) 80 * @param dev UART device struct 83 static void uart_sifive_poll_out(const struct device *dev, in uart_sifive_poll_out() argument 86 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_poll_out() local 89 while (uart->tx & TXDATA_FULL) { in uart_sifive_poll_out() [all …]
|
D | uart_b91.c | 4 * SPDX-License-Identifier: Apache-2.0 11 #include <zephyr/drivers/uart.h> 20 /* Get UART instance */ 21 #define GET_UART(dev) ((volatile struct uart_b91_t *) \ argument 22 ((const struct uart_b91_config *)dev->config)->uart_addr) 24 /* UART TX buffer count max value */ 27 /* UART TX/RX data registers size */ 44 /* B91 UART registers structure */ 59 /* B91 UART data structure */ 70 /* B91 UART config structure */ [all …]
|
D | uart_miv.c | 4 * SPDX-License-Identifier: Apache-2.0 11 #include <zephyr/drivers/uart.h> 14 /* UART REGISTERS DEFINITIONS */ 71 /* Receive full - raised even when 1 char arrived */ 129 typedef void (*irq_cfg_func_t)(const struct device *dev); 144 const struct device *dev; member 150 #define DEV_UART(dev) \ argument 152 ((const struct uart_miv_device_config * const)(dev)->config)->uart_addr) 154 static void uart_miv_poll_out(const struct device *dev, in uart_miv_poll_out() argument 157 volatile struct uart_miv_regs_t *uart = DEV_UART(dev); in uart_miv_poll_out() local [all …]
|
D | uart_bt.c | 4 * SPDX-License-Identifier: Apache-2.0 8 #include <zephyr/drivers/uart.h> 37 const struct device *dev; member 41 } uart; member 48 const struct device *dev = (const struct device *)ctx; in bt_notif_enabled() local 49 struct uart_bt_data *dev_data = (struct uart_bt_data *)dev->data; in bt_notif_enabled() 51 (void)atomic_set(&dev_data->bt.enabled, enabled ? 1 : 0); in bt_notif_enabled() 53 LOG_DBG("%s() - %s", __func__, enabled ? "enabled" : "disabled"); in bt_notif_enabled() 55 if (!ring_buf_is_empty(dev_data->uart.tx_ringbuf)) { in bt_notif_enabled() 56 k_work_reschedule_for_queue(&nus_work_queue, &dev_data->uart.tx_work, K_NO_WAIT); in bt_notif_enabled() [all …]
|
D | uart_cmsdk_apb.c | 4 * SPDX-License-Identifier: Apache-2.0 10 * @brief Driver for UART on ARM CMSDK APB UART. 12 * UART has two wires for RX and TX, and does not provide CTS or RTS. 20 #include <zephyr/drivers/uart.h> 24 /* UART registers struct */ 42 /* UART Bits */ 65 volatile struct uart_cmsdk_apb *uart; member 79 /* UART Clock control in Active State */ 81 /* UART Clock control in Sleep State */ 83 /* UART Clock control in Deep Sleep State */ [all …]
|
D | uart_litex.c | 2 * Copyright (c) 2018 - 2019 Antmicro <www.antmicro.com> 4 * SPDX-License-Identifier: Apache-2.0 14 #include <zephyr/drivers/uart.h> 33 void (*config_func)(const struct device *dev); 50 * @param dev UART device struct 53 static void uart_litex_poll_out(const struct device *dev, unsigned char c) in uart_litex_poll_out() argument 55 const struct uart_litex_device_config *config = dev->config; in uart_litex_poll_out() 57 while (litex_read8(config->txfull_addr)) { in uart_litex_poll_out() 60 litex_write8(c, config->rxtx_addr); in uart_litex_poll_out() 66 * @param dev UART device struct [all …]
|
D | uart_numicro.c | 2 * SPDX-License-Identifier: Apache-2.0 9 #include <zephyr/drivers/uart.h> 16 UART_T *uart; member 27 static int uart_numicro_poll_in(const struct device *dev, unsigned char *c) in uart_numicro_poll_in() argument 29 const struct uart_numicro_config *config = dev->config; in uart_numicro_poll_in() 31 if ((config->uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) != 0) { in uart_numicro_poll_in() 32 return -1; in uart_numicro_poll_in() 35 *c = (uint8_t)config->uart->DAT; in uart_numicro_poll_in() 40 static void uart_numicro_poll_out(const struct device *dev, unsigned char c) in uart_numicro_poll_out() argument 42 const struct uart_numicro_config *config = dev->config; in uart_numicro_poll_out() [all …]
|
D | uart_altera_jtag.c | 2 * Copyright (c) 2017-2023 Intel Corporation 4 * SPDX-License-Identifier: Apache-2.0 8 * @brief UART driver for Intel FPGA UART Core IP 9 * Reference : Embedded Peripherals IP User Guide : 12. JTAG UART Core 15 #include <zephyr/drivers/uart.h> 70 * @param dev UART device instance 73 * @return 0 if a character arrived, -1 otherwise. 74 * -EINVAL if c is null pointer. 76 static int uart_altera_jtag_poll_in(const struct device *dev, in uart_altera_jtag_poll_in() argument 79 int ret = -1; in uart_altera_jtag_poll_in() [all …]
|
D | uart_sedi.c | 4 * SPDX-License-Identifier: Apache-2.0 9 #include <zephyr/drivers/uart.h> 21 /* UART IRQ handler declaration. */ 23 static void irq_config_uart_##n(const struct device *dev) 29 static void irq_config_uart_##n(const struct device *dev) \ 31 ARG_UNUSED(dev); \ 34 DEVICE_DT_GET(DT_NODELABEL(uart##n)), \ 45 /* Device init macro for UART instance. As multiple uart instances follow a 66 PM_DEVICE_DT_DEFINE(DT_NODELABEL(uart##n), \ 68 DEVICE_DT_DEFINE(DT_NODELABEL(uart##n), \ [all …]
|
D | uart_xmc4xxx.c | 5 * SPDX-License-Identifier: Apache-2.0 13 #include <zephyr/drivers/uart.h> 26 XMC_USIC_CH_t *uart; member 65 const struct device *dev; member 75 static int uart_xmc4xxx_poll_in(const struct device *dev, unsigned char *c) in uart_xmc4xxx_poll_in() argument 77 const struct uart_xmc4xxx_config *config = dev->config; in uart_xmc4xxx_poll_in() 80 if (config->fifo_rx_size > 0) { in uart_xmc4xxx_poll_in() 81 fifo_empty = XMC_USIC_CH_RXFIFO_IsEmpty(config->uart); in uart_xmc4xxx_poll_in() 83 fifo_empty = !XMC_USIC_CH_GetReceiveBufferStatus(config->uart); in uart_xmc4xxx_poll_in() 86 return -1; in uart_xmc4xxx_poll_in() [all …]
|
D | uart_altera.c | 4 * SPDX-License-Identifier: Apache-2.0 8 * @brief UART driver for Intel FPGA UART Core IP 9 * Reference : Embedded Peripherals IP User Guide : 11. UART Core 20 #include <zephyr/drivers/uart.h> 91 struct uart_config uart_cfg; /* stores uart config from device tree*/ 126 static int uart_altera_irq_update(const struct device *dev); 127 static int uart_altera_irq_tx_ready(const struct device *dev); 128 static int uart_altera_irq_rx_ready(const struct device *dev); 134 * This is a non-blocking function. 136 * @param dev UART device instance [all …]
|
D | uart_native_ptty.c | 4 * SPDX-License-Identifier: Apache-2.0 11 #include <zephyr/drivers/uart.h> 20 * UART driver for POSIX ARCH based boards. 23 * For the first UART: 31 * more like a real UART. 37 static int np_uart_stdin_poll_in(const struct device *dev, 39 static int np_uart_tty_poll_in(const struct device *dev, 41 static void np_uart_poll_out(const struct device *dev, 55 static DEVICE_API(uart, np_uart_driver_api_0) = { 67 static DEVICE_API(uart, np_uart_driver_api_1) = { [all …]
|
D | uart_pipe.c | 2 * @brief Pipe UART driver 4 * A pipe UART driver allowing application to handle all aspects of received 11 * SPDX-License-Identifier: Apache-2.0 19 #include <zephyr/drivers/uart.h> 32 static void uart_pipe_rx(const struct device *dev) in uart_pipe_rx() argument 38 int avail = recv_buf_len - recv_off; in uart_pipe_rx() 57 static void uart_pipe_isr(const struct device *dev, void *user_data) in uart_pipe_isr() argument 61 uart_irq_update(dev); in uart_pipe_isr() 63 if (uart_irq_rx_ready(dev)) { in uart_pipe_isr() 64 uart_pipe_rx(dev); in uart_pipe_isr() [all …]
|
D | uart_xlnx_ps.c | 1 /* uart_xlnx_ps.c - Xilinx Zynq family serial driver */ 6 * SPDX-License-Identifier: Apache-2.0 16 * Before individual UART port can be used, uart_xlnx_ps_init() has to be 19 * - the following macro for the number of bytes between register addresses: 33 #include <zephyr/drivers/uart.h> 42 * Comp. Xilinx Zynq-7000 Technical Reference Manual (ug585), chap. B.33 45 /* Register offsets within the UART device's register space */ 167 * @brief Disables the UART's RX and TX function. 170 * UART's Command Register, thus disabling the operation of the UART. 173 * bits, which are set when enabling the UART, are cleared. [all …]
|
/Zephyr-latest/drivers/wifi/eswifi/ |
D | eswifi_bus_uart.c | 5 * SPDX-License-Identifier: Apache-2.0 19 #include <zephyr/drivers/uart.h> 34 const struct device *dev; member 47 static void eswifi_iface_uart_flush(struct eswifi_uart_data *uart) in eswifi_iface_uart_flush() argument 51 while (uart_fifo_read(uart->dev, &c, 1) > 0) { in eswifi_iface_uart_flush() 59 struct eswifi_uart_data *uart = &eswifi_uart0; /* Static instance */ in eswifi_iface_uart_isr() local 67 while (uart_irq_update(uart->dev) && in eswifi_iface_uart_isr() 68 uart_irq_rx_ready(uart->dev)) { in eswifi_iface_uart_isr() 70 partial_size = ring_buf_put_claim(&uart->rx_rb, &dst, in eswifi_iface_uart_isr() 75 eswifi_iface_uart_flush(uart); in eswifi_iface_uart_isr() [all …]
|
/Zephyr-latest/include/zephyr/drivers/serial/ |
D | uart_emul.h | 4 * SPDX-License-Identifier: Apache-2.0 9 * @brief Backend API for emulated UART 26 * @param dev UART device instance 30 typedef void (*uart_emul_callback_tx_data_ready_t)(const struct device *dev, size_t size, 39 * @param dev The emulated UART device instance 43 void uart_emul_callback_tx_data_ready_set(const struct device *dev, 49 * @param dev The emulated UART device instance 55 uint32_t uart_emul_put_rx_data(const struct device *dev, const uint8_t *data, size_t size); 60 * @param dev The emulated UART device instance 66 uint32_t uart_emul_get_tx_data(const struct device *dev, uint8_t *data, size_t size); [all …]
|
D | uart_async_to_irq.h | 4 * SPDX-License-Identifier: Apache-2.0 10 #include <zephyr/drivers/uart.h> 17 * @brief UART Asynchronous to Interrupt driven API adaptation layer 30 * Pointer to that data must be the first element of the UART device data structure. 36 * Pointer to this data must be the first element of the UART device configuration structure. 42 * This context is used to call user UART interrupt handler. It is to used to 43 * fulfill the requirement that UART interrupt driven API shall be called from 44 * the UART interrupt. Trampoline context shall have the same priority as UART. 48 typedef void (*uart_async_to_irq_trampoline)(const struct device *dev); 52 * @param dev UART device. [all …]
|
/Zephyr-latest/include/zephyr/drivers/ |
D | uart.h | 2 * Copyright (c) 2018-2019 Nordic Semiconductor ASA 5 * SPDX-License-Identifier: Apache-2.0 10 * @brief Public APIs for UART drivers 17 * @brief UART Interface 18 * @defgroup uart_interface UART Interface 69 * RS-485 half-duplex. This error is only valid on UARTs that 118 * @brief UART controller configuration structure 129 * @defgroup uart_interrupt Interrupt-driven UART API 137 * @param dev UART device instance. 140 typedef void (*uart_irq_callback_user_data_t)(const struct device *dev, [all …]
|
/Zephyr-latest/drivers/bluetooth/hci/ |
D | h4.c | 1 /* h4.c - H:4 UART based Bluetooth driver */ 4 * Copyright (c) 2015-2016 Intel Corporation 6 * SPDX-License-Identifier: Apache-2.0 16 #include <zephyr/drivers/uart.h> 67 const struct device *uart; member 73 static inline void h4_get_type(const struct device *dev) in h4_get_type() argument 75 const struct h4_config *cfg = dev->config; in h4_get_type() 76 struct h4_data *h4 = dev->data; in h4_get_type() 79 if (uart_fifo_read(cfg->uart, &h4->rx.type, 1) != 1) { in h4_get_type() 81 h4->rx.type = BT_HCI_H4_NONE; in h4_get_type() [all …]
|
/Zephyr-latest/samples/drivers/uart/native_tty/ |
D | README.rst | 1 .. zephyr:code-sample:: uart-native-tty 2 :name: Native TTY UART 3 :relevant-api: uart_interface 5 Use native TTY driver to send and receive data between two UART-to-USB bridge dongles. 10 This sample demonstrates the usage of the Native TTY UART driver. It uses two 11 UART to USB bridge dongles that are wired together, writing demo data to one 15 :zephyr_file:`samples/drivers/uart/native_tty`. 17 You can learn more about the Native TTY UART driver in the 18 :ref:`TTY UART <native_tty_uart>` section of the native_sim board 24 #. Two UART to USB bridge dongles. Each dongle must have its TX pin wired to the [all …]
|
/Zephyr-latest/samples/subsys/shell/shell_module/src/ |
D | uart_reinit.c | 4 * SPDX-License-Identifier: Apache-2.0 8 #include <zephyr/drivers/uart.h> 13 const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart)); in shell_init_from_work() local 19 shell_init(shell_backend_uart_get_ptr(), dev, in shell_init_from_work() 20 shell_backend_uart_get_ptr()->ctx->cfg.flags, in shell_init_from_work() 35 static void direct_uart_callback(const struct device *dev, void *user_data) in direct_uart_callback() argument 40 uart_irq_update(dev); in direct_uart_callback() 43 if (uart_irq_rx_ready(dev)) { in direct_uart_callback() 44 while (uart_fifo_read(dev, buf, sizeof(buf))) { in direct_uart_callback() 46 uart_irq_tx_enable(dev); in direct_uart_callback() [all …]
|