HIDOpenAsync

Syntax

#include <revolution/hid.h>
HIDError HIDOpenAsync (
            void            *mem,
            HIDSetupHandler hsh,
            u32 user
            );

Arguments

void *mem The memory region allocated for the HID library. This buffer must be HID_MEM_SIZE bytes in size and allocated with 32-byte alignment from MEM2. During a debug build, the HIDOpenAsync function performs ASSERTMSG to warn of this requirement.
HIDSetupHandler hsh The pointer to the HIDSetupHandler user callback function. The HIDOpenAsync function calls this callback function to report the end of initialization and the result. During a debug build, ASSERTMSG will be performed if HIDSetupHandler is invalid.
u32 user User-defined parameter. This variable is passed to the HIDSetupHandler callback function defined by the user.

Return Values

HID_ERROR_OK The function has been called successfully. The result is reported asynchronously by the user-defined HIDSetupHandler callback function.
HID_ERROR_ALREADY_OPEN The HID library is already open.
HID_ERROR_FIRMWARE_MALFUNCTION The HID library has received an error from the firmware.
HID_ERROR_BUSY The HID library is busy. The user can try again later.

Description

Opens and initializes the HID library for use at run time. The user can use the HID API functions during the time between the call to HIDOpenAsync and the call to HIDCloseAsync.

See Also

HIDCloseAsync
HIDSetupHandler
HIDError

Revision History

2008/09/24 Initial version.



CONFIDENTIAL