usb_event_handler_t

Syntax

#include <cafe/usb_mic.h>

typedef struct {
    unsigned long int   host;
    unsigned long int   port;
    unsigned long int   vid;
    unsigned long int   pid;
    usb_mic_handle_t    h_inst;
} usb_event_data_t;

typedef enum {
    usb_uac_attach,
    usb_uac_detach,
    usb_uac_error
} usb_event_type_t;

typedef void (*usb_event_handler_t)(void* pcx, usb_event_type_t type,
                                    usb_event_data_t* p_event_data, int error);

Parameters

pcx Pointer to an application provided context that is the first argument in USBMICInit. It can be NULL.
type An enumerated value of type usb_event_type_t, as defined above.
p_event_data A pointer to a structure of type usb_event_data_t, as defined above.
error The error code associated with this invocation of the event handler.

usb_event_data_t Elements

host USB host controller index UAC device is attached to.
port Port on USB host controller UAC device is attached to.
vid Vendor ID (in USB sense) of UAC device.
pid Product ID (in USB sense) of UAC device.
h_inst Device instance handle issued by the UAC stack. This handle must be used for all references to this UAC device instance. This handle is of type usb_mic_handle_t.

usb_event_type_t Elements

usb_uac_attach Used to indicate that a UAC device has been attached.
usb_uac_detach Used to indicate that a UAC device has been removed.
usb_uac_error Used to indicate that an error has occurred. The error variable contains the error code.

Return Values

None.

Description

The event handler is called in response to the events enumerated in usb_event_type_t. It is permitted to call other USB Microphone APIs from within the event handler.

This event handler will be called for all events of all UAC devices.

Do Not Call From

None.

See Also

USBMICInit
usb_mic_handle_t

Revision History

2013/05/08 Automated cleanup pass.
2012/08/03 Cleanup Pass
2012/07/09 Update for SDK2.06
2012/01/06 Initial version.


CONFIDENTIAL