mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
Diff: targets/hal/TARGET_Freescale/TARGET_K20D5M/i2c_api.c
- Revision:
- 180:097147d37470
- Parent:
- 178:a873352662d8
- Child:
- 182:242346c42295
--- a/targets/hal/TARGET_Freescale/TARGET_K20D5M/i2c_api.c Wed May 07 11:30:07 2014 +0100 +++ b/targets/hal/TARGET_Freescale/TARGET_K20D5M/i2c_api.c Wed May 07 11:45:52 2014 +0100 @@ -68,6 +68,11 @@ pinmap_pinout(sda, PinMap_I2C_SDA); pinmap_pinout(scl, PinMap_I2C_SCL); + /* enable open drain for I2C pins, only port b available */ + uint32_t pin_n = (uint32_t)(sda & 0x7C) >> 2; + PORTB->PCR[pin_n] |= PORT_PCR_ODE_MASK; + pin_n = (uint32_t)(scl & 0x7C) >> 2; + PORTB->PCR[pin_n] |= PORT_PCR_ODE_MASK; } int i2c_start(i2c_t *obj) {