LPC_I2C->ADR0 = 0xF1; // 0x78<<1 + 1 // Monitor mode LPC_I2C->MMCTRL = MM_ENA; /* Configure interrupt for I2C in NVIC of ARM core */ NVIC_EnableIRQ(I2C_IRQn); /* Enable I2C operation */ LPC_I2C->CONSET = I2CONSET_I2EN |I2CONSET_SI; |
... ToggleGPIOBit( 2, 6 ); switch ( StatValue ){ case 0xA8: WrIndex = 0; I2CWrBuffer[WrIndex++] = LPC_I2C->DAT; break; case 0xB8: I2CWrBuffer[WrIndex++] = LPC_I2C->DAT; break; case 0xC0: I2CWrBuffer[WrIndex++] = LPC_I2C->DAT; break; ... } LPC_I2C->CONSET = I2CONSET_AA; LPC_I2C->CONCLR = I2CONCLR_SIC; ToggleGPIOBit( 2, 6 ); |