I am using the cypress4000 CY8Ckit-040，when i use i2c to read or wirte flash，some troubles around me，like the picture：
like this ,when i write one byte into flash, i can get the register address and the data will be written into flash easy from the write_buffer array.
but when i want to read "N"Byte from flash, how can i recognize she is write or read from write_buffer ?
how can i recognize the write_buffer is the data will be written or the number of Byte will read?
who can help me?
Generally, PSoC4 uses same buffer for write and read. Which kind of flash are you using? Could you post your full project out? So that someone can help review the code.