Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Is vendor command working by i2c?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Is vendor command working by i2c?
Moderator:
RSKV

Post Reply
Follow this topic



Is vendor command working by i2c?

dv2 posted on 12 Dec 2012 4:46 AM PST
Top Contributor
74 Forum Posts

 Hi 

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?

 




Re: Is vendor command working by i2c?

RSKV posted on 12 Dec 2012 06:56 AM PST
Cypress Employee
655 Forum Posts

Dv2,

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.

Thanks,

sai krishna.



Re: Is vendor command working by i2c?

dv2 posted on 12 Dec 2012 07:25 AM PST
Top Contributor
74 Forum Posts

Hi. Thanks for reply.

you mean that pc side use vendor command. ok. i understand fully.

But i  have still some questions.

 

1) Are there need any configuration setting(such as DSCR.A51) for I2C work in HW?

 

 

2) May i just only use following functions for i2c work ? (declared in EZUSE.LIB)?

        EZUSB_InitI2C(); // Initialize I2C Bus

EZUSB_ReadI2C(I2C_Addr, length, buf);

EZUSB_WriteI2C(I2C_Addr, i, ee_str);

 



Re: Is vendor command working by i2c?

RSKV posted on 12 Dec 2012 08:23 AM PST
Cypress Employee
655 Forum Posts

Hi,

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.

Thanks,

sai krishna.



Re: Is vendor command working by i2c?

dv2 posted on 12 Dec 2012 08:28 AM PST
Top Contributor
74 Forum Posts

 

Hi sai krishna.

 

You mean that i can work i2c without i2c_hw.c?

Because EZUSB.LIB have I2CWrite(BYTE i2cAddr, WORD addr, BYTE write_dat) and  I2CRead(BYTE i2cAddr, WORD addr, BYTE *read_dat). Right?

 

 

 


Re: Is vendor command working by i2c?

RSKV posted on 12 Dec 2012 08:37 AM PST
Cypress Employee
655 Forum Posts

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.

Thanks,

sai krishna.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.