mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC11U6X/i2c_api.c
- Revision:
- 186:2e805bf06ee4
- Parent:
- 174:8bb9f3a33240
- Child:
- 227:7bd0639b8911
--- a/targets/hal/TARGET_NXP/TARGET_LPC11U6X/i2c_api.c Fri May 09 14:00:08 2014 +0100 +++ b/targets/hal/TARGET_NXP/TARGET_LPC11U6X/i2c_api.c Mon May 12 10:15:06 2014 +0100 @@ -44,10 +44,9 @@ #define I2C_SCLL(x, val) (x->i2c->SCLL = val) #define I2C_SCLH(x, val) (x->i2c->SCLH = val) -#warning [TODO] just copied from LPC11UXX code, need to check static const uint32_t I2C_addr_offset[2][4] = { - {0x0C, 0x20, 0x24, 0x28}, - {0x30, 0x34, 0x38, 0x3C} + {0x0C, 0x20, 0x24, 0x28}, // slave address offset + {0x30, 0x34, 0x38, 0x3C} // slave address mask offset }; static inline void i2c_conclr(i2c_t *obj, int start, int stop, int interrupt, int acknowledge) { @@ -183,8 +182,7 @@ void i2c_frequency(i2c_t *obj, int hz) { // No peripheral clock divider on the M0 -#warning "[TODO] This should be fixed to handle system core clock correctly." - uint32_t PCLK = 12000000; //SystemCoreClock; + uint32_t PCLK = SystemCoreClock; uint32_t pulse = PCLK / (hz * 2);