cyapi.lib Control Center I2C EEPROM

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi!

 

1.bmp

The IDE gives packaged applications control center without specific code to look up. Now I'm going to use the method provided by cypress in cyapi.lib to do this transfer through EP0. How do I do that?

At the same time, if the slave device FX3 receives such instructions, I require it to be fed back through EP0, and the upper computer software receives it again, then how should the upper computer software be implemented?

Because I didn't find a similar example. Cypress provides cyapi.lib, but I didn't find any examples and don't know how to use these methods.Could you help me?

0 Likes
1 Solution
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi,

We have a instruction document tells you how to use the cyapi.lib:

http://www.cypress.com/file/138766/download

Regards,

Yi

View solution in original post

0 Likes
5 Replies
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi,

We have a instruction document tells you how to use the cyapi.lib:

http://www.cypress.com/file/138766/download

Regards,

Yi

0 Likes
Anonymous
Not applicable

Hi!

You didn't understand my question.

I have loaded UsbI2cDmaMode into FX3,if I use control center 1.png,1.png

I can get 1.png by Hyper Terminal as I wrote  CyU3PDebugPrint (4, "I'm in write\r\n");   in cyfxusbi2cdmamode.c

1.png

As like this,I wrote my own PC code:

         CCyUSBDevice *USBDevice = new CCyUSBDevice(NULL);

         CCyControlEndPoint *ept = USBDevice->ControlEndPt;

         ept->Target = TGT_DEVICE;

         ept->ReqType = REQ_VENDOR;

         ept->Direction = DIR_TO_DEVICE;

         ept->ReqCode = 0xBA;

         ept->Value = 0;

         ept->Index = 0;

         unsigned char buf[1];

         ZeroMemory(buf, 1);

         LONG buflen = 1;

         ept->XferData(buf, buflen);

but no result.Which is wrong? What should i do?

The pc code's architecture is right,because I used it to other test.

0 Likes
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi,

Can you program detect whether your device is connected?

If your firmware works well, then the problem is in your PC applications.

I suggest you take a look at the link I sent to you first, it has helpful content in develop application including ANALYZING & DEBUGGING THE CODE you write.

Regards,

Yi

0 Likes
Anonymous
Not applicable

Hi,

Didn't i write clear! Assume all environment is all right!

I just want to send vendor order ,write and read.

In the CYAPI.pdf only like this:

CCyUSBDevice *USBDevice = new
CCyUSBDevice(NULL);
// Just for typing efficiency
CCyControlEndPoint *ept = USBDevice-
>ControlEndPt;
ept->Target = TGT_DEVICE;
ept->ReqType = REQ_VENDOR;
ept->Direction = DIR_TO_DEVICE;
ept->ReqCode =
0x05;
ept->Value =
1;
ept->Index =
0;
unsigned char buf[512];
ZeroMemory(buf,
512);

it doesn't have nothing.It didn't work.

Do you have any detailed demos?

0 Likes
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi, 

The code you put here is quoted from the CyAPI.pdf. It is just constructing the CCyControlEndPoint class. I can't see anything wrong from it.

I suggest you can add some debugging code to you code to find where is wrong, like printing the return value of XferData to see if the data transferring succeed.

Regards,

Yi

0 Likes