From c75d06232be41d704a3cf8d5a9b84ede0c9a4e36 Mon Sep 17 00:00:00 2001 From: railwaycoder Date: Tue, 28 Oct 2014 19:51:14 +0100 Subject: [PATCH 1/3] workaround for wrong I2C pinmap for testing --- .../targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c index 63a21eddeb4..981e1e81f3d 100644 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c @@ -19,13 +19,13 @@ #include "pinmap.h" static const PinMap PinMap_I2C_SDA[] = { - {p22, I2C_0, 1}, + {p10, I2C_0, 1}, {p13, I2C_1, 2}, {NC, NC, 0} }; static const PinMap PinMap_I2C_SCL[] = { - {p20, I2C_0, 1}, + {p8, I2C_0, 1}, {p15, I2C_1, 2}, {NC, NC, 0} }; From b0b170d7ba5bc5c6a98f6c6ed5ac5b2a730ff02d Mon Sep 17 00:00:00 2001 From: railwaycoder Date: Tue, 11 Nov 2014 18:27:30 +0100 Subject: [PATCH 2/3] pin change for testing --- .../targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c index 981e1e81f3d..37973c9d06e 100644 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c @@ -19,13 +19,13 @@ #include "pinmap.h" static const PinMap PinMap_I2C_SDA[] = { - {p10, I2C_0, 1}, + {p28, I2C_0, 1}, {p13, I2C_1, 2}, {NC, NC, 0} }; static const PinMap PinMap_I2C_SCL[] = { - {p8, I2C_0, 1}, + {p29, I2C_0, 1}, {p15, I2C_1, 2}, {NC, NC, 0} }; From 80de207cd8b7d08bbe14692be88e64743014feaa Mon Sep 17 00:00:00 2001 From: railwaycoder Date: Tue, 11 Nov 2014 18:49:07 +0100 Subject: [PATCH 3/3] removed pin definition --- .../TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c index 13c7f3677df..1b1e7e95bf4 100755 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c @@ -19,25 +19,11 @@ #include "pinmap.h" #include "mbed_error.h" -<<<<<<< HEAD -static const PinMap PinMap_I2C_SDA[] = { - {p28, I2C_0, 1}, - {p13, I2C_1, 2}, - {NC, NC, 0} -}; - -static const PinMap PinMap_I2C_SCL[] = { - {p29, I2C_0, 1}, - {p15, I2C_1, 2}, - {NC, NC, 0} -}; -======= // nRF51822's I2C_0 and SPI_0 (I2C_1, SPI_1 and SPIS1) share the same address. // They can't be used at the same time. So we use two global variable to track the usage. // See nRF51822 address information at nRF51822_PS v2.0.pdf - Table 15 Peripheral instance reference volatile i2c_spi_peripheral_t i2c0_spi0_peripheral = {0, 0, 0, 0}; volatile i2c_spi_peripheral_t i2c1_spi1_peripheral = {0, 0, 0, 0}; ->>>>>>> upstream/master void i2c_interface_enable(i2c_t *obj) {