SiLabs Pearl: I2C GPIO fix

GPIO pins were uninitialized. Fixed and tested.
pull/1501/head
jhokajar 2015-10-22 15:09:16 +03:00 committed by Steven Cooreman
parent 6095a67b95
commit 97a1674a94
1 changed files with 1 additions and 0 deletions

View File

@ -136,6 +136,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
obj->i2c.i2c->ROUTEPEN = I2C_ROUTEPEN_SDAPEN | I2C_ROUTEPEN_SCLPEN;
obj->i2c.i2c->ROUTELOC0 = (pin_location(obj->i2c.sda, PinMap_I2C_SDA) << _I2C_ROUTELOC0_SDALOC_SHIFT) |
(pin_location(obj->i2c.scl, PinMap_I2C_SCL) << _I2C_ROUTELOC0_SCLLOC_SHIFT);
i2c_enable_pins(obj, true);
#endif
/* Enable General Call Address Mode. That is; we respond to the general address (0x0) */