I willing to make slave fifo with i2c in 56pin fx2lp.
And i2c make by fx2lp's hardware.
I heard that i2c should using vendor command.
So i willing to use i2c_hw.c.
But i have question in here.
Vendor command is working on i2c?
I'm not sure how can i call i2c func in windows application.
What is relationship between vendor command and i2c_hw.c?
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.
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.