char I2C_read(char slave_address, char reg_address){ char DATA; //DISABLE INTERRUPTS IntDisable(I2C0_MASTER_BASE); I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, slave_address, true); //BufferIn(reg_address); I2CMasterDataPut(I2C0_MASTER_BASE, reg_address); I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE); while(I2CMasterBusy(I2C0_MASTER_BASE)) { } DATA = I2CMasterDataGet(I2C0_MASTER_BASE); //ENABLE INTERRUPTS IntEnable(I2C0_MASTER_BASE); return DATA; }
Hello Martin,
I tried implementing master read portion of your code. My control never comes out of
while(I2CMasterBusy(I2C0_MASTER_BASE)){}
Any possible reason you could think of?
Thanks