Please go through the following link which speaks about I2C Memory addressing
Thanks for your replay..
Given "FX3_I2C_DETAILS" doc they mention only 2 byte memory address. they are not specifying 3,4,5 byte of memory address.
0nly Read operation the control mask is changing, but in Write operation control mask is always "0x0000" what is region?
Q1. Therefore what is the value of ctrlMask in 3-byte, 4-byte and 5-byte address?
an I2C EEPROM read requires the byte address for the read to be written first.
A.3- byte addressing mode with random read operation:
preamble.buffer = SlaveAddr; /* Slave address: Write operation */
preamble.buffer = (uint8_t)(( ByteAddr & 0Xff0000) >> 16);
preamble.buffer = (uint8_t)( ByteAddr & 0x00ff00)
preamble.buffer = (uint8_t)( ByteAddr & 0x0000ff)
preamble.buffer = SlaveAddr | 0x1; /* Slave address: Read operation */
preamble.length = 5;
preamble.ctrlMask = 0x0008;
CyU3PI2cReceiveBytes (&preamble, testbuf, 1,0)
ctrlMask field will be 0x0008 as a start bit is required after the 4th byte (fourth bit is set)
B.3-byte addressing mode with random read operation:
The buffer field shall hold the 4 bytes, the length field shall be 4, and the ctrlMask field is zero as no additional start/stop conditions are needed.
-- 4-byte addressing mode with random read operation ctrlMask field will be 0x0010 as a start bit is required after the 5th byte (5th bit is set).
--5--byte addressing mode with random read operation ctrlMask field will be 0x0020 as a start bit is required after the 6th byte (6th bit is set).
--Only write operation ctrlMask field will be 0x0000.