Lines Matching full:uart
8 * @brief UART driver for the SiFive Freedom Processor
15 #include <zephyr/drivers/uart.h>
80 * @param dev UART device struct
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()
92 uart->tx = (int)c; in uart_sifive_poll_out()
98 * @param dev UART device struct
105 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_poll_in() local
106 uint32_t val = uart->rx; in uart_sifive_poll_in()
122 * @param dev UART device struct
132 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_fifo_fill() local
135 for (i = 0; i < size && !(uart->tx & TXDATA_FULL); i++) { in uart_sifive_fifo_fill()
136 uart->tx = (int)tx_data[i]; in uart_sifive_fifo_fill()
145 * @param dev UART device struct
155 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_fifo_read() local
160 val = uart->rx; in uart_sifive_fifo_read()
175 * @param dev UART device struct
179 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_enable() local
181 uart->ie |= IE_TXWM; in uart_sifive_irq_tx_enable()
187 * @param dev UART device struct
191 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_disable() local
193 uart->ie &= ~IE_TXWM; in uart_sifive_irq_tx_disable()
199 * @param dev UART device struct
205 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_ready() local
207 return !!(uart->ip & IE_TXWM); in uart_sifive_irq_tx_ready()
213 * @param dev UART device struct
219 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_complete() local
225 return !(uart->tx & TXDATA_FULL); in uart_sifive_irq_tx_complete()
231 * @param dev UART device struct
235 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_enable() local
237 uart->ie |= IE_RXWM; in uart_sifive_irq_rx_enable()
243 * @param dev UART device struct
247 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_disable() local
249 uart->ie &= ~IE_RXWM; in uart_sifive_irq_rx_disable()
255 * @param dev UART device struct
261 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_ready() local
263 return !!(uart->ip & IE_RXWM); in uart_sifive_irq_rx_ready()
280 * @param dev UART device struct
286 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_is_pending() local
288 return !!(uart->ip & (IE_RXWM | IE_TXWM)); in uart_sifive_irq_is_pending()
299 * @param dev UART device struct
327 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_init() local
333 uart->txctrl = TXCTRL_TXEN | CTRL_CNT(cfg->txcnt_irq); in uart_sifive_init()
334 uart->rxctrl = RXCTRL_RXEN | CTRL_CNT(cfg->rxcnt_irq); in uart_sifive_init()
337 uart->div = cfg->sys_clk_freq / cfg->baud_rate - 1; in uart_sifive_init()
340 /* Ensure that uart IRQ is disabled initially */ in uart_sifive_init()
341 uart->ie = 0U; in uart_sifive_init()
357 static DEVICE_API(uart, uart_sifive_driver_api) = {