39 #define I2C_CON_FLAGS (I2C_CON_AA | I2C_CON_SI | I2C_CON_STO | I2C_CON_STA)
40 #define LPC_I2Cx(id) ((i2c[id].ip))
41 #define SLAVE_ACTIVE(iic) (((iic)->flags & 0xFF00) != 0)
133 uint32_t index = (uint32_t) sid - 1;
134 pI2C->
MASK[index] = mask;
139 volatile uint32_t *abase = &pI2C->
ADR1;
140 abase[index - 1] = addr;
148 return (addr1 & ~mask) == (addr2 & ~mask);
154 if (!(slaveAddr >> 1)) {
206 if (xfer->
rxSz > 1) {
277 if (xfer->
rxSz > 1) {
287 if (xfer->
rxSz > 1) {
299 if (xfer->
txSz > 0) {
389 LPC_I2Cx(
id)->SCLH = (uint32_t) (SCLValue >> 1);
406 return iic->
mEvent == event;
440 return (
int) xfer->
status;
451 return len - xfer.
txSz;
466 return len - xfer.
rxSz;
477 return len - xfer.
rxSz;
514 iic->
flags |= 1 << (sid + 8);