AnsweredAssumed Answered

USB driver callback - passing user data?

Question asked by G40 on Jun 12, 2012
Latest reply on Jun 14, 2012 by G40

The USB Bulk example opens both the USB controller and the USB bulk class driver with an argument of 0x01 as the 4th parameter (ClientHandle).


The callback is prototyped as:


void ClientCallback( void *AppHandle, u32 Event, void *pArg)


The callback itself checks for a value of 0x01 when an ADI_USB_EVENT_SET_CONFIG event is received.


if (0x1 == (u32)pArg)


Is the significance of this magic value that it represents the USB current configuration?


Is the only way to map the AppHandle parameter to the user instance data by some other means, e.g:


void* pUserData = FindUsingSomeLookup(AppHandle);