Lines Matching full:uart
10 * @brief Driver for UART on NXP IMX family processor.
21 #include <zephyr/drivers/uart.h>
47 * @brief Initialize UART channel
50 * It is assumed that this function is called only once per UART.
52 * @param dev UART device struct
58 UART_Type *uart = UART_STRUCT(dev); in uart_imx_init() local
66 /* Setup UART init structure */ in uart_imx_init()
81 initConfig.clockRate = get_uart_clock_freq(uart); in uart_imx_init()
83 UART_Init(uart, &initConfig); in uart_imx_init()
85 /* Set UART built-in hardware FIFO Watermark. */ in uart_imx_init()
86 UART_SetTxFifoWatermark(uart, 2); in uart_imx_init()
87 UART_SetRxFifoWatermark(uart, 1); in uart_imx_init()
96 /* Set UART modem mode */ in uart_imx_init()
97 UART_SetModemMode(uart, config->modem_mode); in uart_imx_init()
99 /* Finally, enable the UART module */ in uart_imx_init()
100 UART_Enable(uart); in uart_imx_init()
107 UART_Type *uart = UART_STRUCT(dev); in uart_imx_poll_out() local
109 while (!UART_GetStatusFlag(uart, uartStatusTxReady)) { in uart_imx_poll_out()
111 UART_Putchar(uart, c); in uart_imx_poll_out()
116 UART_Type *uart = UART_STRUCT(dev); in uart_imx_poll_in() local
119 if (UART_GetStatusFlag(uart, uartStatusRxDataReady)) { in uart_imx_poll_in()
120 *c = UART_Getchar(uart); in uart_imx_poll_in()
122 if (UART_GetStatusFlag(uart, uartStatusRxOverrun)) { in uart_imx_poll_in()
123 UART_ClearStatusFlag(uart, uartStatusRxOverrun); in uart_imx_poll_in()
137 UART_Type *uart = UART_STRUCT(dev); in uart_imx_fifo_fill() local
141 UART_GetStatusFlag(uart, uartStatusTxReady)) { in uart_imx_fifo_fill()
143 UART_Putchar(uart, tx_data[num_tx]); in uart_imx_fifo_fill()
153 UART_Type *uart = UART_STRUCT(dev); in uart_imx_fifo_read() local
157 UART_GetStatusFlag(uart, uartStatusRxReady)) { in uart_imx_fifo_read()
159 rx_data[num_rx++] = UART_Getchar(uart); in uart_imx_fifo_read()
162 if (UART_GetStatusFlag(uart, uartStatusRxOverrun)) { in uart_imx_fifo_read()
163 UART_ClearStatusFlag(uart, uartStatusRxOverrun); in uart_imx_fifo_read()
171 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_tx_enable() local
173 UART_SetIntCmd(uart, uartIntTxReady, true); in uart_imx_irq_tx_enable()
178 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_tx_disable() local
180 UART_SetIntCmd(uart, uartIntTxReady, false); in uart_imx_irq_tx_disable()
185 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_tx_ready() local
187 return UART_GetStatusFlag(uart, uartStatusTxReady); in uart_imx_irq_tx_ready()
192 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_rx_enable() local
194 UART_SetIntCmd(uart, uartIntRxReady, true); in uart_imx_irq_rx_enable()
199 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_rx_disable() local
201 UART_SetIntCmd(uart, uartIntRxReady, false); in uart_imx_irq_rx_disable()
206 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_rx_ready() local
208 return UART_GetStatusFlag(uart, uartStatusRxReady); in uart_imx_irq_rx_ready()
213 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_err_enable() local
215 UART_SetIntCmd(uart, uartIntParityError, true); in uart_imx_irq_err_enable()
216 UART_SetIntCmd(uart, uartIntFrameError, true); in uart_imx_irq_err_enable()
221 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_err_disable() local
223 UART_SetIntCmd(uart, uartIntParityError, false); in uart_imx_irq_err_disable()
224 UART_SetIntCmd(uart, uartIntFrameError, false); in uart_imx_irq_err_disable()
229 UART_Type *uart = UART_STRUCT(dev); in uart_imx_irq_is_pending() local
231 return UART_GetStatusFlag(uart, uartStatusRxReady) || in uart_imx_irq_is_pending()
232 UART_GetStatusFlag(uart, uartStatusTxReady); in uart_imx_irq_is_pending()
255 * Note: imx UART Tx interrupts when ready to send; Rx interrupts when char