Skip to content

Commit 316e873

Browse files
mpolojarstevew817
authored andcommitted
SiLabs Pearl: I2C: Do not try to force specific locations of pins
Pearl can freely select pins, so do not force both SDA and SCL pins to have the same "location".
1 parent c1e5c0b commit 316e873

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,13 @@ void i2c_preinit(i2c_t *obj, PinName sda, PinName scl)
107107
obj->i2c.i2c = (I2C_TypeDef*) pinmap_merge(i2c_sda, i2c_scl);
108108
MBED_ASSERT(((int) obj->i2c.i2c) != NC);
109109

110+
#ifndef _SILICON_LABS_32B_PLATFORM_2
110111
int loc_sda = pin_location(sda, PinMap_I2C_SDA);
111112
int loc_scl = pin_location(scl, PinMap_I2C_SCL);
112113
obj->i2c.loc = pinmap_merge(loc_sda, loc_scl);
113114
MBED_ASSERT(obj->i2c.loc != NC);
115+
#endif
116+
114117
obj->i2c.sda = sda;
115118
obj->i2c.scl = scl;
116119
}

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/objects.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ struct dac_s {
6666
#if DEVICE_I2C
6767
struct i2c_s {
6868
I2C_TypeDef *i2c;
69+
#ifndef _SILICON_LABS_32B_PLATFORM_2
6970
int loc;
71+
#endif
7072
uint8_t index;
7173
PinName sda;
7274
PinName scl;

0 commit comments

Comments
 (0)