cancel
Showing results for 
Search instead for 
Did you mean: 

How to define call back function in USB interrupt?

Vu.Andy
Associate III
Posted on August 10, 2016 at 02:16

I am new to the USB libraries so this question may seems obvious.  I've worked on I2C and USART which has a user defined callback function so one can decide what to do when there is an interrupt like when receiving data.

For the USB interrupt routine, how does one define the user callback function.

For example, the library interrupt routines are:

HAL_HCD_IRQHandler()

HAL_PCD_IRQHandler()

USBD_OTG_ISR_Handler()

But these are general calls.  How does the user get to decide what to do based on the given interrupt?  For example, if the USB receives data from the PC, how does the user know what to do?

Thanks.

1 REPLY 1
Walid FTITI_O
Senior II