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/03/06 18:15:24 UTC

[GitHub] sterlinghughes closed pull request #872: puckjs: i2c syscfg

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