fx2lp cdc class

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

cross mob
gean_3054931
Level 5
Level 5
10 likes given 5 likes given First like received

Hello,

i am using CDC ACM model,

i have SET_CONTROL_STATE: USB request in oder to  control DTE/CTS signal,

how can i implement this requset?

any code snippet is there for SET_CONTROL_STATE?

regards,

geetha.

0 Likes
1 Solution

Hello Geetha,

Please check with the following code-

case SET_CONTROL_STATE:                                                                                                                                                                                                                              

       DTR=SETUPDAT[2] & 0x01;                                                                           

       RTS=SETUPDAT[2] & 0x02;        

                                                          

       if(DTR|RTS)                                                                                                                             

       {

              /*code*/                                                                                       

        }            

   break;

Best Regards,

Sananya

View solution in original post

0 Likes
5 Replies
Sananya_14
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello Geetha,

You can add your required control function in the firmware when you receive request for SET_CONTROL_STATE in SETUPDAT register. Implementing a VIrtual COM port using FX2LP Application Note firmware can be used as a reference to implement the same. Please note that CTS signal is an input signal and cant be controlled by the host application.

Best Regards,

Sananya

Hello sananya,

in the virtual com port with fx2lp example,SET_CONTROL_STATE doesnot contain any code.

we are consider only DTR signal here for data synchronisation.

how to recieve/access setup data register byte?which byte of setup data containing DTR bit?

regards,

geetha.

0 Likes

Hello Geetha,

You can check for the request type in the first byte of SETUPDAT, the third byte should have bit B0 set if DTR is asserted on the host side.

Best Regards,

Sananya

0 Likes

Hello sananya,

can you please send me the code snippet to check bit 0 status?

regards,

geetha.

0 Likes

Hello Geetha,

Please check with the following code-

case SET_CONTROL_STATE:                                                                                                                                                                                                                              

       DTR=SETUPDAT[2] & 0x01;                                                                           

       RTS=SETUPDAT[2] & 0x02;        

                                                          

       if(DTR|RTS)                                                                                                                             

       {

              /*code*/                                                                                       

        }            

   break;

Best Regards,

Sananya

0 Likes