Basically you want to do I2C read and write from the PC application. right?.
So whenever you want to do I2C read, your PC side application should send some command to FX2LP so that FX2LP firmware does the I2C read operation (by calling the functions present in i2c_hw.c) whenever it receives that perticular command.
Similarly for I2C write operation.
Your data path is as follows...
Whenever you want to do I2C read..
PC side application sends vendor command to EP0 of FX2LP --> FX2LP parse that command and understands that it has to do I2C read --> FX2LP firmware executes I2C read function in i2c_hw.c file --> FX2LP gets data from the I2C device --> FX2LP can send that data back to PC side application.
You can look at the example projects that you get along with the Cypress Suite USB to get an idea on how to implement PC side application.
Hi. Thanks for reply.
you mean that pc side use vendor command. ok. i understand fully.
You don't have to do any other settings.
You can directly use the functions
bit I2CWrite(BYTE i2cAddr, WORD addr, BYTE write_dat) and
bit I2CRead(BYTE i2cAddr, WORD addr, BYTE *read_dat) which are present in the i2c_hw.c file.
Yes. You can use them (functions from EZUSB.lib) as well.
It's your choice. But you have more flexibility in using the functions present in i2c_hw.c since you have the source code for each function.
It is your choice.