3.3.4.1 USB_HOST_AUDIO_V1_AttachEventHandlerSet Function

C

USB_HOST_AUDIO_V1_RESULT USB_HOST_AUDIO_V1_AttachEventHandlerSet(
    USB_HOST_AUDIO_V1_ATTACH_EVENT_HANDLER eventHandler, 
    uintptr_t context
);

Summary

This function will set an attach event handler. The attach event handler will be called when a Audio v1.0 Device has been attached or detached. The context will be returned in the event handler. This function should be called before the bus has been enabled.

Parameters

Parameters Description
eventHandler Pointer to the attach event handler.
context An application defined context that will be returned in the event handler.

Returns

  • USB_HOST_AUDIO_V1_RESULT_SUCCESS - If the attach event handler was registered successfully
  • USB_HOST_AUDIO_V1_RESULT_FAILURE - If the number of registered event handlers has exceeded USB_HOST_AUDIO_V1_ATTACH_LISTENERS_NUMBER

Remarks

This function should be called before the USB_HOST_BusEnable function is called.