mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] sterlinghughes closed pull request #872: puckjs: i2c syscfg
Date Tue, 06 Mar 2018 18:15:24 GMT
sterlinghughes closed pull request #872: puckjs: i2c syscfg
URL: https://github.com/apache/mynewt-core/pull/872
 
 
   

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/puckjs/src/hal_bsp.c b/hw/bsp/puckjs/src/hal_bsp.c
index b7a36b444..d623adb96 100644
--- a/hw/bsp/puckjs/src/hal_bsp.c
+++ b/hw/bsp/puckjs/src/hal_bsp.c
@@ -121,9 +121,9 @@ static struct pwm_dev os_bsp_spwm;
 
 #if MYNEWT_VAL(I2C_0)
 static const struct nrf52_hal_i2c_cfg hal_i2c_cfg = {
-    .scl_pin = 33,
-    .sda_pin = 34,
-    .i2c_frequency = 400    /* 400 kHz */
+    .scl_pin = MYNEWT_VAL(I2C_0_PIN_SCL),
+    .sda_pin = MYNEWT_VAL(I2C_0_PIN_SDA),
+    .i2c_frequency = MYNEWT_VAL(I2C_0_FREQ_KHZ),
 };
 #endif
 
diff --git a/hw/bsp/puckjs/syscfg.yml b/hw/bsp/puckjs/syscfg.yml
index dfce9d242..3a6142be2 100644
--- a/hw/bsp/puckjs/syscfg.yml
+++ b/hw/bsp/puckjs/syscfg.yml
@@ -76,6 +76,16 @@ syscfg.defs:
         description: 'SS pin for SPI_0_SLAVE'
         value:  31
 
+    I2C_0_PIN_SCL:
+        description: 'SCL pin for I2C_0'
+        value:  33
+    I2C_0_PIN_SDA:
+        description: 'SDA pin for I2C_0'
+        value:  34
+    I2C_0_FREQ_KHZ:
+        description: 'Frequency in khz for I2C_0 bus'
+        value:  400
+
     TIMER_0:
         description: 'NRF52 Timer 0'
         value:  1


 

----------------------------------------------------------------
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

Mime
View raw message