5 Replies Latest reply on Oct 9, 2018 11:48 PM by sanm

    fx2lp cdc class

    Geethanjali_3054931

      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.

        • 1. Re: fx2lp cdc class
          sanm

          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

          1 of 1 people found this helpful
          • 2. Re: fx2lp cdc class
            Geethanjali_3054931

            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.

            • 3. Re: fx2lp cdc class
              sanm

              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

              • 4. Re: fx2lp cdc class
                Geethanjali_3054931

                Hello sananya,

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

                 

                regards,

                geetha.

                • 5. Re: fx2lp cdc class
                  sanm

                  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