[riot-notifications] [RIOT-OS/RIOT] UART driver doesn't support more advanced configuration? (#10814)

Mohamed notifications at github.com
Fri Jan 18 12:48:18 CET 2019


When I enable 9 bit mode and enable parity control, one bit is used for parity and I get 8 bit data.

### Protocol
I'm implementing SBUS protocol which uses inverted serial with the following:
frame: 1 (Frame Start) + 22 (data) + 1 (flag) + 1 (Frame End) = 25 bytes
1 byte: 1 (start bit) + 8 (data bits) + 1 (parity) + 2 (stop bits) = 12 bits

### Software
My code will receive stream of bytes and build a full frame, then send it to another thread for processing. This is working as expected after using configurations below.

### Hardware
Radio transmitter ~> Radio Receiver -> STM32F7 with RIOT
Radio Receiver is connected to UART2 RX pin and configured using the following code

``` c
MODIFY_REG(__UART_DEV(uart)->CR1, USART_CR1_M_Msk, USART_CR1_M0);           // 9-bits word
MODIFY_REG(__UART_DEV(uart)->CR1, USART_CR1_PCE_Msk, USART_CR1_PCE);        // Enable parity control
MODIFY_REG(__UART_DEV(uart)->CR1, USART_CR1_PS_Msk, 0);                     // Even Parity
MODIFY_REG(__UART_DEV(uart)->CR2, USART_CR2_STOP_Msk, USART_CR2_STOP_1);    // 2 stop bits
MODIFY_REG(__UART_DEV(uart)->CR2, USART_CR2_RXINV_Msk, USART_CR2_RXINV);    // invert RX
```



-- 
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/issues/10814#issuecomment-455520574
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190118/7256366b/attachment.html>


More information about the notifications mailing list