Jump to main content

##

# 2.2.4.49 USB_DEVICE_EVENT_HANDLER Type

## C

    typedef USB_DEVICE_EVENT_RESPONSE (* USB_DEVICE_EVENT_HANDLER)(USB_DEVICE_EVENT event, void * eventData, uintptr_t context);

## Description

USB Device Layer Event Handler Function Pointer Type

This data type defines the required function signature of the USB Device Layer Event handling callback function. The application must register a pointer to a Device Layer Event handling function whose function signature (parameter and return value types) match the types specified by this function pointer in order to receive event call backs from the Device Layer. The Device Layer will invoke this function with event relevant parameters. The description of the event handler function parameters is given here.

event - Type of event generated.

pData - This parameter should be type cast to an event specific pointer type based on the event that has occurred. Refer to the USB_DEVICE_EVENT enumeration description for more details.

context - Value identifying the context of the application that was registered along with the event handling function.