[riot-notifications] [RIOT-OS/RIOT] cpu/nrf5x: rework periph_uart driver to allow use of multiple UARTs with nrf52840 (#10621)

Alexandre Abadie notifications at github.com
Mon Jan 14 13:43:39 CET 2019


aabadie commented on this pull request.



> @@ -76,128 +107,185 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
     PSEL_TXD = UART_PIN_TX;
 
     /* enable HW-flow control if defined */
-#if UART_HWFLOWCTRL
-    /* set pin mode for RTS and CTS pins */
-    gpio_init(UART_PIN_RTS, GPIO_OUT);
-    gpio_init(UART_PIN_CTS, GPIO_IN);
-    /* configure RTS and CTS pins to use */
-    PSEL_RTS = UART_PIN_RTS;
-    PSEL_CTS = UART_PIN_CTS;
-    NRF_UART0->CONFIG |= UART_CONFIG_HWFC_Msk;  /* enable HW flow control */
-#else
-    PSEL_RTS = 0xffffffff;            /* pin disconnected */
-    PSEL_CTS = 0xffffffff;            /* pin disconnected */
-#endif
+    if (UART_HWFLOWCTRL) {

In the case of nrf52840 family, this MACRO is defined [above](https://github.com/RIOT-OS/RIOT/pull/10621/files#diff-09415752bfc5dc7483589c86f7a1f0a5R45) and depends on the fact that `rts_pin` and `cts_pin` are defined to something different from `GPIO_UNDEF`.

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


More information about the notifications mailing list