USBFS CDC: Interrupt or callback when host sends data

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

cross mob
ricardoquesada
Level 4
Level 4
First solution authored 50 sign-ins 25 replies posted

Hi,

I have a PSoC 5LP using USBFS-UART component.

I tested the example that comes with PSoC Creator and works great.

But instead of polling for data by calling USBUART_DataIsReady(), I'd like to get notified when data is ready to be read (either via an interrupt or callback).

Is that possible?

Many thanks!

 

PS: I tried with USBUART_DISPATCH_CDC_CLASS_CDC_READ_REQUESTS_CALLBACK / USBUART_DISPATCH_CDC_CLASS_CDC_WRITE_REQUESTS_CALLBACK but it seems they are meant for something else.

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

You can use the endpoint interrupt callback to notify your application. The interrupt handlers are implemented in the USBUART_episr.c. Pick the one linked to the USBUART output endpoint (EP3).

View solution in original post

1 Reply
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

You can use the endpoint interrupt callback to notify your application. The interrupt handlers are implemented in the USBUART_episr.c. Pick the one linked to the USBUART output endpoint (EP3).