FX2LP18 : How to manage SETUPDAT[7] and SETUPDAT[6]

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

cross mob
JeBo_4132831
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi,

I 'm using C# code from an application note (AN63620).

I need to send infortmation SETUPDAT[6] and SETUPDAT[7] to my Firmware.

C# APPLICATION SIDE :

                CtrlEndPt = myDevice.ControlEndPt;

                CtrlEndPt.Value is REPRENTATIVE of the valueParam SETUPDAT[2] & SETUPDAT[3] : RIGHT ?

                CtrlEndPt.Index is REPRENTATIVE of the indexParam  SETUPDAT[4] & SETUPDAT[5] : RIGHT ?

                But What About lengthParam ??

Is there any way to set SETUPDAT[7] and SETUPDAT[6] in the code application C# side ?

To pass this information to the FX2LP18 firmware ...

FIRMWARE SIDE :

// Retrieve parameters, sent in big endian format for STICEX vendor requests

// (thus not respecting USB-2.0 spec, but 8051 processor endianness).

// The 8051 is a big endian processor => no byte swap required, simply

// cast the pointer

valueParam  = *(WORD *)(&(SETUPDAT[2]));

indexParam  = *(WORD *)(&(SETUPDAT[4]));

// The length param is sent in little endian format by the CyUSB driver,

// respecting the USB-2.0 spec.

// The 8051 is a big endian processor => byte swap required

lengthParam = ((WORD)(SETUPDAT[7]))<<8 | SETUPDAT[6];

Thanks for help.

0 Likes
1 Solution

Hello,

Please refer to the below example snippet:

pastedImage_1.png

The length parameter (SETUPDAT[6:7] = wLength) of the control transfer will be taken from the second parameter in the XferData() call.

In the above example the length SETUPDAT[6:7] will be equal to len.

Please let me know if you have any more queries.

Thanks,

Yatheesh

View solution in original post

4 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

Please refer to the Section 15.12.21 Setup Data - 8 Bytes from Mobl-USB_TRM FX2LP18 for complete details on the Setup Data bytes.

Thanks,

Yatheesh

0 Likes

Sorry, but my question was not clear en ought.

I understand the SETUDAT from Firmware FX2LP18 side.

What i need to know, is HOW can i managed it from USB Host Side using your SDK (Lib / dll / etc ...) ?

Using the C# project from the AN.

0 Likes

Hello,

Please refer to the below example snippet:

pastedImage_1.png

The length parameter (SETUPDAT[6:7] = wLength) of the control transfer will be taken from the second parameter in the XferData() call.

In the above example the length SETUPDAT[6:7] will be equal to len.

Please let me know if you have any more queries.

Thanks,

Yatheesh

Crystal Clear : THANKS !

0 Likes