mbed library sources
Fork of mbed-src by
Revision 367:d0878bd5474b, committed 2014-10-26
- Comitter:
- mbed_official
- Date:
- Sun Oct 26 13:45:07 2014 +0000
- Parent:
- 366:2c37f9c21d44
- Child:
- 368:9c8af5961cee
- Commit message:
- Synchronized with git revision e770e6257e1470048bd5102cc8c881038ae2edfa
Full URL: https://github.com/mbedmicro/mbed/commit/e770e6257e1470048bd5102cc8c881038ae2edfa/
HAL: LPC824 - I2C ROMAPI/bitrate related fix
Changed in this revision
targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c Fri Oct 24 11:30:07 2014 +0100 +++ b/targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c Sun Oct 26 13:45:07 2014 +0000 @@ -151,13 +151,14 @@ // enable power i2c_power_enable(i2c_ch); - i2c_interface_enable(obj); uint32_t size_in_bytes = LPC_I2CD_API->i2c_get_mem_size(); i2c_buffer = malloc(size_in_bytes); obj->handler = LPC_I2CD_API->i2c_setup((uint32_t)(obj->i2c), i2c_buffer); LPC_I2CD_API->i2c_set_bitrate(obj->handler, SystemCoreClock, 100000); LPC_I2CD_API->i2c_set_timeout(obj->handler, 100000); + + i2c_interface_enable(obj); } inline int i2c_start(i2c_t *obj) @@ -211,7 +212,7 @@ void i2c_frequency(i2c_t *obj, int hz) { - LPC_I2CD_API->i2c_set_bitrate(obj->handler, SystemCoreClock, 100000); + LPC_I2CD_API->i2c_set_bitrate(obj->handler, SystemCoreClock, hz); } int i2c_read(i2c_t *obj, int address, char *data, int length, int stop)