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()
144 * @param dev UART device struct
154 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_fifo_read() local
159 val = uart->rx; in uart_sifive_fifo_read()
173 * @param dev UART device struct
177 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_enable() local
179 uart->ie |= IE_TXWM; in uart_sifive_irq_tx_enable()
185 * @param dev UART device struct
189 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_disable() local
191 uart->ie &= ~IE_TXWM; in uart_sifive_irq_tx_disable()
197 * @param dev UART device struct
203 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_ready() local
205 return !!(uart->ip & IE_TXWM); in uart_sifive_irq_tx_ready()
211 * @param dev UART device struct
217 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_tx_complete() local
223 return !(uart->tx & TXDATA_FULL); in uart_sifive_irq_tx_complete()
229 * @param dev UART device struct
233 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_enable() local
235 uart->ie |= IE_RXWM; in uart_sifive_irq_rx_enable()
241 * @param dev UART device struct
245 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_disable() local
247 uart->ie &= ~IE_RXWM; in uart_sifive_irq_rx_disable()
253 * @param dev UART device struct
259 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_rx_ready() local
261 return !!(uart->ip & IE_RXWM); in uart_sifive_irq_rx_ready()
278 * @param dev UART device struct
284 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_irq_is_pending() local
286 return !!(uart->ip & (IE_RXWM | IE_TXWM)); in uart_sifive_irq_is_pending()
297 * @param dev UART device struct
324 volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); in uart_sifive_init() local
330 uart->txctrl = TXCTRL_TXEN | CTRL_CNT(cfg->txcnt_irq); in uart_sifive_init()
331 uart->rxctrl = RXCTRL_RXEN | CTRL_CNT(cfg->rxcnt_irq); in uart_sifive_init()
334 uart->div = cfg->sys_clk_freq / cfg->baud_rate - 1; in uart_sifive_init()
337 /* Ensure that uart IRQ is disabled initially */ in uart_sifive_init()
338 uart->ie = 0U; in uart_sifive_init()