5 Replies Latest reply on Sep 18, 2018 7:10 PM by michael.song_3688011

    CX3 UVC extension unit

    michael.song_3688011

      I have implemneted the uvc extension in CX3, but it always failed in the test. I referenced the sample AN75779, Who can help to check where is the problem?

       

      My steps:

      1. add Extension Unit Descriptor in the cyfxuvcdscr.c ;

      2. modify cycx3_uvc.h ;

      3. modify cycx3_uvc.c

           a. set event in CyCx3UvcAppUSBSetupCB();

           b. get event in UVCAppEP0Thread_Entry().  if meet the conditions, it will execute UVCHandleExtensionUnitRqts(). But it seems that the conditions are always not met from the log.

               

      #define CY_FX_UVC_VIDEO_CONTROL_REQUEST_EVENT   (1 << 2)

      #define CY_FX_UVC_VIDEO_STREAM_REQUEST_EVENT    (1 << 3)

      #define CY_FX_UVC_EXTENSION_UNIT_ID     (uint8_t)(3)            /* wIndex value used to select Extension Unit. */

       

      for (;;)

          {

              /* Wait for a Video control or streaming related request on the control endpoint. */

      #if 1

              if (CyU3PEventGet (&glFxUVCEvent, eventMask, CYU3P_EVENT_OR_CLEAR, &eventFlag,

                          CYU3P_WAIT_FOREVER) == CY_U3P_SUCCESS)

              {

                  CyU3PUsbGetSpeed ();

      CyU3PDebugPrint(4,"michael: eventFlag = %d wIndex_mv = %d\n\r", eventFlag, wIndex_mv);

                  if (eventFlag & CY_FX_UVC_VIDEO_CONTROL_REQUEST_EVENT)

                  {

                      switch ((wIndex_mv >> 8))

                      {

                          case CY_FX_UVC_EXTENSION_UNIT_ID:

                              UVCHandleExtensionUnitRqts ();

                              break;

       

       

                          default:

                              /* Unsupported request. Fail by stalling the control endpoint. */

                              CyU3PUsbStall (0, CyTrue, CyFalse);

                              break;

                      }

                  }

          }