[riot-notifications] [RIOT-OS/RIOT] RFC: UART enhanced settings (#10743)

Mohamed notifications at github.com
Tue Jan 22 04:33:29 CET 2019


@yegorich , I gave it a try but it didn't work! I know that I need to invert RX for my scenario so I added the following code (at the very end before you enable uart):
```
MODIFY_REG(dev(uart)->CR2, USART_CR2_RXINV_Msk, USART_CR2_RXINV);
```
but this didn't help!

I'll look bit more tomorrow, in case its something with my environment.

Here is how I initialize (working case):
```
uart_init_ex(uart, baudrate, UartReceiveCallback, this, false);
uart_configure(uart, UART_9BITS, UART_PARITY_EVEN, UART_STOPBITS_TWO, UART_RX_INVERT);
uart_enable(uart);
```

Here is with new uart_mode (not working case):
```
uart_init(uart, baudrate, UartReceiveCallback, this);
uart_mode(uart, UART_DATABITS_8, UART_PARITY_EVEN, UART_STOPBITS_2);
```

Couple notes on implementation:
- I'm not an expert in this, but not a fan of starting up device, stopping it to configure, then starting it again.
- Not sure why we have UART_DATABITS_9 if we are setting this internally (code could use some comment around this as it's not intuitive)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10743#issuecomment-456260016
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190121/9c0ae26e/attachment.html>


More information about the notifications mailing list