2 Replies Latest reply on May 11, 2018 8:20 PM by jimmy_3301211

    How to send a code to PC Host software in UVC firmware

    maheswariamudha_2545856

      In UVC firmware, when a GPIO key pressed, in the GPIO interruption function I want to send a code like 0xFF to PC Host software, So it can take some action like turn on the LED. So how can I realized the function.I want some example application code for this.

        • 1. Re: How to send a code to PC Host software in UVC firmware
          rghe

          Hi!,

           

          In Fx3 UVC example project, endpoint 0x82 is used as a Status Interrupt endpoint. You can use this endpoint or define another Interrupt endpoint to send the status code to PC.

          You need to create a DMA Channel from CPU to this Interrupt Endpoint.

           

          You can refer to cyfxgpioapp example project provided in FX3 SDK for the usage of GPIO interrupts (C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples)

           

          In the GPIO Interrupt callback, you can set a flag to indicate a button press. Inside the for (;;) loop of UVCAppThread_Entry(), you need to check if the flag is set. If the flag is set, clear the flag and call a function; say, Send_Status_to_Host().

          Please find the attached code snippet.

          • 2. Re: How to send a code to PC Host software in UVC firmware
            jimmy_3301211

            Hi rghe,

            In my project, I use the sample code provided by you to send key status to host.

            In order to get the data sent by Send_Status_to_Host(), how can I do on the PC side?