You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/25 19:28:20 UTC

[GitHub] andrzej-kaczmarek closed pull request #1056: bsp/nrf52840pdk: replace bitbang by native uart for UART1

andrzej-kaczmarek closed pull request #1056: bsp/nrf52840pdk: replace bitbang by native uart for UART1
URL: https://github.com/apache/mynewt-core/pull/1056
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/bsp/nrf52840pdk/src/hal_bsp.c b/hw/bsp/nrf52840pdk/src/hal_bsp.c
index e155e85322..8996dd5d98 100644
--- a/hw/bsp/nrf52840pdk/src/hal_bsp.c
+++ b/hw/bsp/nrf52840pdk/src/hal_bsp.c
@@ -33,12 +33,9 @@
 #if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart/uart.h"
 #endif
-#if MYNEWT_VAL(UART_0)
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart_hal/uart_hal.h"
 #endif
-#if MYNEWT_VAL(UART_1)
-#include "uart_bitbang/uart_bitbang.h"
-#endif
 #include "bsp.h"
 #if MYNEWT_VAL(ADC_0)
 #include <adc_nrf52/adc_nrf52.h>
@@ -65,11 +62,12 @@ static const struct nrf52_uart_cfg os_bsp_uart0_cfg = {
 #endif
 
 #if MYNEWT_VAL(UART_1)
-static struct uart_dev os_bsp_bitbang_uart1;
-static const struct uart_bitbang_conf os_bsp_uart1_cfg = {
-    .ubc_txpin = MYNEWT_VAL(UART_1_PIN_TX),
-    .ubc_rxpin = MYNEWT_VAL(UART_1_PIN_RX),
-    .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ),
+static struct uart_dev os_bsp_uart1;
+static const struct nrf52_uart_cfg os_bsp_uart1_cfg = {
+    .suc_pin_tx = MYNEWT_VAL(UART_1_PIN_TX),
+    .suc_pin_rx = MYNEWT_VAL(UART_1_PIN_RX),
+    .suc_pin_rts = MYNEWT_VAL(UART_1_PIN_RTS),
+    .suc_pin_cts = MYNEWT_VAL(UART_1_PIN_CTS),
 };
 #endif
 
@@ -316,8 +314,8 @@ hal_bsp_init(void)
 #endif
 
 #if MYNEWT_VAL(UART_1)
-    rc = os_dev_create((struct os_dev *) &os_bsp_bitbang_uart1, "uart1",
-      OS_DEV_INIT_PRIMARY, 0, uart_bitbang_init, (void *)&os_bsp_uart1_cfg);
+    rc = os_dev_create((struct os_dev *) &os_bsp_uart1, "uart1",
+      OS_DEV_INIT_PRIMARY, 1, uart_hal_init, (void *)&os_bsp_uart1_cfg);
     assert(rc == 0);
 #endif
 
diff --git a/hw/bsp/nrf52840pdk/syscfg.yml b/hw/bsp/nrf52840pdk/syscfg.yml
index da0b5c248d..134a28cab6 100644
--- a/hw/bsp/nrf52840pdk/syscfg.yml
+++ b/hw/bsp/nrf52840pdk/syscfg.yml
@@ -40,7 +40,7 @@ syscfg.defs:
         value: 7
 
     UART_1:
-        description: 'Bitbanger UART'
+        description: 'Whether to enable UART1'
         value:  0
     UART_1_PIN_TX:
         description: 'TX pin for UART1'
@@ -48,6 +48,12 @@ syscfg.defs:
     UART_1_PIN_RX:
         description: 'RX pin for UART1'
         value:  -1
+    UART_1_PIN_RTS:
+        description: 'RTS pin for UART1'
+        value:  -1
+    UART_1_PIN_CTS:
+        description: 'CTS pin for UART1'
+        value: -1
 
     SPI_0_MASTER_PIN_SCK:
         description: 'SCK pin for SPI_0_MASTER'


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services