AnsweredAssumed Answered

How to define call back function in USB interrupt?

Question asked by vu.andy on Aug 10, 2016
Latest reply on Aug 11, 2016 by FTITI.Walid
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.

Outcomes