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

MrKevinWeiss notifications at github.com
Fri Jan 25 15:54:36 CET 2019


MrKevinWeiss commented on this pull request.



> +            data_bits = UART_DATA_BITS_7;
+        }
+    }
+    if ((data_bits & UART_INVALID_MODE) || (parity & UART_INVALID_MODE)) {
+        return UART_NOMODE;
+    }
+
+#ifdef USART_CR1_M1
+    if (!(dev(uart)->ISR & USART_ISR_TC)) {
+        return UART_INTERR;
+    }
+    dev(uart)->CR1 &= ~(USART_CR1_UE | USART_CR1_TE);
+#endif
+
+    dev(uart)->CR2 |= stop_bits;
+    dev(uart)->CR1 |= (USART_CR1_UE | USART_CR1_TE | data_bits | parity);

It can be done at the same time.
The reason for this is the [stm32l0xxx](https://www.st.com/content/ccc/resource/technical/document/reference_manual/2f/b9/c6/34/28/29/42/d2/DM00095744.pdf/files/DM00095744.pdf/jcr:content/translations/en.DM00095744.pdf) page 802 states

> This bit can only be written when the USART is disabled (UE=0).

-- 
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#discussion_r251012095
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190125/ac4d22db/attachment.html>


More information about the notifications mailing list