- Set direction of transfer as read and clear the FIFO’s. Write
0x41to i2c.Control_reg0. - Clear interrupts. Read and write back the read value to i2c.Interrupt_status_reg0.
- Enable Timeout, NACK, RX overflow, Arbitration lost, DATA, Completion
interrupts. Write
0x22Fto i2c.Intrpt_en_reg0. - Write read data count to transfer size register and hold bus if required. Write read data count value to i2c.Transfer_size_reg0. If read data count greater than FIFO depth, set i2c.Control_reg0 [HOLD].
- Write the slave address. Write the address to the i2c.I2C_address_reg0 register.
- Wait for data to be received into FIFO.
- If read data count is equal to or greater than FIFO depth, wait for i2c.Interrupt_status_reg0 [DATA] = 1. Read 14 bytes from FIFO. Decrement the read data count by 14 and if it is less than or equal to the FIFO depth, clear i2c.Control_reg0[HOLD]
- Otherwise, wait for i2c.Interrupt_status_reg0 [COMP] = 1 and read data from the FIFO based on the read data count.
- Check for completion of transfer. Check if read count reaches zero. Otherwise repeat from step 6.