PSoC5 USBFS DTR detection using interrupt

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

cross mob
AnSa_1225656
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I am using interrupts in FreeRTOS to read data from USB and pass to UART (Using as software USB/UART bridge in one configuration).  I need to be able to control a DTR pin based on USB_GetLineControl(), but I am not sure how to detect a change in its status via an interrupt.  What interrupt will fire when this status changes?

0 Likes
1 Solution

This request goes through EP0, so yes, you could use the EP_0_ISR_ExitCallback(). But this function executes on any EP0 interrupt.

There is a more specific function that is executed when there is a class request (your case). Refer to the function USB_DispatchClassRqst in USB_cls.c.

In the end of the function, you can write code between this lines:

/* `#START USER_DEFINED_CLASS_CODE` Place your Class request here */

/* `#END` */

Or you can implement the USB_DispatchClassRqst_Callback() function and define the USBUART_DISPATCH_CLASS_RQST_CALLBACK. 

View solution in original post

4 Replies