1<html> 2 3<head> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 7<title>HIDOpenAsync</title> 8</head> 9 10<body> 11 12<h1>HIDOpenAsync</h1> 13 14<h2>Syntax</h2> 15 16<dl> 17<dd> 18<pre><code>#include <revolution/hid.h></code></pre> 19</dd> 20<dd> 21<pre><code>HIDError HIDOpenAsync ( 22 void *mem, 23 HIDSetupHandler hsh, 24 u32 user 25 ); 26</code></pre> 27</dd> 28</dl> 29 30<h2>Arguments</h2> 31 32<TABLE border="1" cellpadding="3" cellspacing="0.1"> 33 34<tr> 35<TD bgcolor="#ffffe8" width="120"><code><em><strong>void *mem</strong></em></code></TD> 36<TD width="520"> 37The memory region allocated for the HID library. This buffer must be <code>HID_MEM_SIZE</code> bytes in size and allocated with 32-byte alignment from MEM2. During a debug build, the <code>HIDOpenAsync</code> function performs <code>ASSERTMSG</code> to warn of this requirement. 38 39</TD> 40</tr> 41 42<tr> 43<TD bgcolor="#ffffe8" width="120"><code><em><strong>HIDSetupHandler hsh</strong></em></code></TD> 44<TD width="520"> 45The pointer to the <code>HIDSetupHandler</code> user callback function. The <CODE>HIDOpenAsync</CODE> function calls this callback function to report the end of initialization and the result. During a debug build, <code>ASSERTMSG</code> will be performed if <code>HIDSetupHandler</code> is invalid. 46 47</TD> 48</tr> 49 50<tr> 51<TD bgcolor="#ffffe8" width="120"><code><em><strong>u32 user</strong></em></code></TD> 52<TD width="520"> 53User-defined parameter. This variable is passed to the <code>HIDSetupHandler</code> callback function defined by the user. 54</TD> 55</tr> 56 57 58</TABLE> 59 60<h2>Return Values</h2> 61 62 63<TABLE border="1" cellpadding="3" cellspacing="0.1"> 64 65<tr> 66<TD width="120" bgcolor="#ffffe8"><code><em><strong>HID_ERROR_OK</strong></em></code></TD> 67<TD width="520"> 68The function has been called successfully. The result is reported asynchronously by the user-defined <code>HIDSetupHandler</code> callback function. 69</TD> 70</tr> 71 72<tr> 73<TD width="120" bgcolor="#ffffe8"><code><em><strong>HID_ERROR_ALREADY_OPEN</strong></em></code></TD> 74<TD width="520"> 75The HID library is already open. 76</TD> 77</tr> 78 79<tr> 80<TD width="120" bgcolor="#ffffe8"><code><em><strong>HID_ERROR_FIRMWARE_MALFUNCTION</strong></em></code></TD> 81<TD width="520"> 82The HID library has received an error from the firmware. 83</TD> 84</tr> 85 86<tr> 87<TD width="120" bgcolor="#ffffe8"><code><em><strong>HID_ERROR_BUSY</strong></em></code></TD> 88<TD width="520"> 89The HID library is busy. 90</TD> 91</tr> 92 93</TABLE> 94 95<h2>Description</h2> 96 97<p>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 <code>HIDOpenAsync</code> and the call to <code>HIDCloseAsync</code>. 98 99<h2>See Also</h2> 100<p><a href="HIDCloseAsync.html">HIDCloseAsync</a><BR><a href="HIDSetupHandler.html">HIDSetupHandler</a><BR><a href="HIDError.html">HIDError</a> 101 102<h2>Revision History</h2> 103 104<P>2008/09/24 Initial version.</p> 105 106<hr> 107 108<hr><p>CONFIDENTIAL</p></body> 109</HTML>