Lines Matching refs:uart_cfg
118 struct swm_uart_cfg *uart_cfg; member
158 struct swm_uart_cfg *uart_cfg; in swm_uart_configure() local
161 uart_cfg = serial_device->parent.user_data; in swm_uart_configure()
163 uart_cfg->uart_initstruct.Baudrate = configure->baud_rate; in swm_uart_configure()
167 uart_cfg->uart_initstruct.DataBits = UART_DATA_8BIT; in swm_uart_configure()
170 uart_cfg->uart_initstruct.DataBits = UART_DATA_9BIT; in swm_uart_configure()
173 uart_cfg->uart_initstruct.DataBits = UART_DATA_8BIT; in swm_uart_configure()
179 uart_cfg->uart_initstruct.StopBits = UART_STOP_1BIT; in swm_uart_configure()
182 uart_cfg->uart_initstruct.StopBits = UART_STOP_2BIT; in swm_uart_configure()
185 uart_cfg->uart_initstruct.StopBits = UART_STOP_1BIT; in swm_uart_configure()
191 uart_cfg->uart_initstruct.Parity = UART_PARITY_NONE; in swm_uart_configure()
194 uart_cfg->uart_initstruct.Parity = UART_PARITY_ODD; in swm_uart_configure()
197 uart_cfg->uart_initstruct.Parity = UART_PARITY_EVEN; in swm_uart_configure()
200 uart_cfg->uart_initstruct.Parity = UART_PARITY_NONE; in swm_uart_configure()
204 UART_Init(uart_cfg->UARTx, &(uart_cfg->uart_initstruct)); in swm_uart_configure()
205 UART_Open(uart_cfg->UARTx); in swm_uart_configure()
211 struct swm_uart_cfg *uart_cfg; in swm_uart_control() local
213 uart_cfg = serial_device->parent.user_data; in swm_uart_control()
219 NVIC_DisableIRQ(uart_cfg->irq); in swm_uart_control()
223 NVIC_EnableIRQ(uart_cfg->irq); in swm_uart_control()
231 struct swm_uart_cfg *uart_cfg; in swm_uart_putc() local
233 uart_cfg = serial_device->parent.user_data; in swm_uart_putc()
235 UART_WriteByte(uart_cfg->UARTx, c); in swm_uart_putc()
236 while (UART_IsTXBusy(uart_cfg->UARTx)) in swm_uart_putc()
244 struct swm_uart_cfg *uart_cfg; in swm_uart_getc() local
246 uart_cfg = serial_device->parent.user_data; in swm_uart_getc()
249 if (UART_IsRXFIFOEmpty(uart_cfg->UARTx) == 0) in swm_uart_getc()
251 UART_ReadByte(uart_cfg->UARTx, (uint32_t *)&ch); in swm_uart_getc()
271 struct swm_uart_cfg *uart_cfg; in swm_uart_isr() local
273 uart_cfg = serial_device->parent.user_data; in swm_uart_isr()
276 …if (UART_INTStat(uart_cfg->UARTx, UART_IT_RX_THR) || UART_INTStat(uart_cfg->UARTx, UART_IT_RX_TOUT… in swm_uart_isr()
278 if(!UART_IsRXFIFOEmpty(uart_cfg->UARTx)) in swm_uart_isr()
283 if(UART_INTStat(uart_cfg->UARTx, UART_IT_RX_TOUT)) in swm_uart_isr()
285 UART_INTClr(uart_cfg->UARTx, UART_IT_RX_TOUT); in swm_uart_isr()
353 uart_obj[i].uart_cfg = &swm_uart_cfg[i]; in swm_uart_init()
357 result = rt_hw_serial_register(&uart_obj[i].serial_device, uart_obj[i].uart_cfg->name, in swm_uart_init()
358 … RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, uart_obj[i].uart_cfg); in swm_uart_init()