Lines Matching full:usart
92 static void wait_synchronization(SercomUsart *const usart) in wait_synchronization() argument
96 while ((usart->SYNCBUSY.reg & SERCOM_USART_SYNCBUSY_MASK) != 0) { in wait_synchronization()
100 while ((usart->STATUS.reg & SERCOM_USART_STATUS_SYNCBUSY) != 0) { in wait_synchronization()
107 static int uart_sam0_set_baudrate(SercomUsart *const usart, uint32_t baudrate, in uart_sam0_set_baudrate() argument
122 usart->BAUD.reg = baud; in uart_sam0_set_baudrate()
123 wait_synchronization(usart); in uart_sam0_set_baudrate()
397 SercomUsart * const usart = cfg->regs; in uart_sam0_configure() local
399 wait_synchronization(usart); in uart_sam0_configure()
401 usart->CTRLA.bit.ENABLE = 0; in uart_sam0_configure()
402 wait_synchronization(usart); in uart_sam0_configure()
413 SERCOM_USART_CTRLA_Type CTRLA_temp = usart->CTRLA; in uart_sam0_configure()
414 SERCOM_USART_CTRLB_Type CTRLB_temp = usart->CTRLB; in uart_sam0_configure()
473 usart->CTRLA = CTRLA_temp; in uart_sam0_configure()
474 wait_synchronization(usart); in uart_sam0_configure()
476 usart->CTRLB = CTRLB_temp; in uart_sam0_configure()
477 wait_synchronization(usart); in uart_sam0_configure()
479 retval = uart_sam0_set_baudrate(usart, new_cfg->baudrate, in uart_sam0_configure()
487 usart->CTRLA.bit.ENABLE = 1; in uart_sam0_configure()
488 wait_synchronization(usart); in uart_sam0_configure()
511 SercomUsart * const usart = cfg->regs; in uart_sam0_init() local
529 /* Disable all USART interrupts */ in uart_sam0_init()
530 usart->INTENCLR.reg = SERCOM_USART_INTENCLR_MASK; in uart_sam0_init()
531 wait_synchronization(usart); in uart_sam0_init()
534 usart->CTRLA.reg = in uart_sam0_init()
544 wait_synchronization(usart); in uart_sam0_init()
558 usart->CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | in uart_sam0_init()
560 wait_synchronization(usart); in uart_sam0_init()
562 retval = uart_sam0_set_baudrate(usart, cfg->baudrate, in uart_sam0_init()
597 dma_blk.dest_address = (uint32_t)(&(usart->DATA.reg)); in uart_sam0_init()
621 dma_blk.source_address = (uint32_t)(&(usart->DATA.reg)); in uart_sam0_init()
633 usart->CTRLA.bit.ENABLE = 1; in uart_sam0_init()
634 wait_synchronization(usart); in uart_sam0_init()
643 SercomUsart * const usart = config->regs; in uart_sam0_poll_in() local
645 if (!usart->INTFLAG.bit.RXC) { in uart_sam0_poll_in()
649 *c = (unsigned char)usart->DATA.reg; in uart_sam0_poll_in()
657 SercomUsart * const usart = config->regs; in uart_sam0_poll_out() local
659 while (!usart->INTFLAG.bit.DRE) { in uart_sam0_poll_out()
663 usart->DATA.reg = c; in uart_sam0_poll_out()