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

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

cross mob
MaAr_2545856
Level 4
Level 4
5 sign-ins 5 solutions authored First solution authored

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.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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.

View solution in original post

0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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.

0 Likes

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?

0 Likes