mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
Diff: targets/TARGET_ONSEMI/TARGET_NCS36510/i2c_api.c
- Revision:
- 159:612c381a210f
- Parent:
- 149:156823d33999
- Child:
- 160:d5399cc887bb
diff -r b23ee177fd68 -r 612c381a210f targets/TARGET_ONSEMI/TARGET_NCS36510/i2c_api.c --- a/targets/TARGET_ONSEMI/TARGET_NCS36510/i2c_api.c Tue Feb 14 14:44:10 2017 +0000 +++ b/targets/TARGET_ONSEMI/TARGET_NCS36510/i2c_api.c Tue Feb 28 17:13:35 2017 +0000 @@ -31,6 +31,7 @@ #include "i2c.h" #include "i2c_api.h" +#include "wait_api.h" #define I2C_READ_WRITE_BIT_MASK 0xFE @@ -151,10 +152,10 @@ } if(last) { /* ACK */ - obj->membase->CMD_REG = I2C_CMD_WDAT0; + SEND_COMMAND(I2C_CMD_WDAT0); } else { /* No ACK */ - obj->membase->CMD_REG = I2C_CMD_WDAT1; + SEND_COMMAND(I2C_CMD_WDAT1); } return data; } @@ -168,8 +169,6 @@ return Count; } - obj->membase->CMD_REG = I2C_CMD_VRFY_ACK; /* Verify ACK */ - while(obj->membase->STATUS.WORD & I2C_STATUS_CMD_FIFO_OFL_BIT); /* Wait till command overflow ends */ if(obj->membase->STATUS.WORD & I2C_STATUS_BUS_ERR_BIT) { @@ -181,4 +180,4 @@ } } -#endif /* DEVICE_I2C */ +#endif /* DEVICE_I2C */ \ No newline at end of file