1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<title>PMICGetSpStateAsync </title>
9</head>
10
11<body>
12
13<h1>PMICGetSpStateAsync</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/pmic.h&gt;
18
19// Signal processing state
20#define PMIC_SP_ON                   0x0000
21#define PMIC_SP_OFF                  0x0001
22
23typedef void (*PMICCallback)(PMIC_ERR result, void* arg);
24
25PMIC_ERR PMICGetSpStateAsync(u16* state, PMICCallback cb, void* arg);
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<TABLE class="arguments" border="1" >
30  <tr>
31<th><CODE>state</CODE></th>
32<td>Location to store the signal processor's ON/OFF state, received from the Wii Speak.</td>
33  </tr>
34  <tr>
35<th><CODE>cb</CODE></th>
36<td>Callback function that will send notification of the execution results of this function.</td>
37  </tr>
38  <tr>
39<th><CODE>arg</CODE></th>
40<td>Passed as the second argument of the callback function above.</td>
41  </tr>
42</TABLE>
43
44<h2>Return Values</h2>
45<p>
46Returns one of the following.
47</p>
48
49<TABLE class="arguments" border="1">
50  <tr>
51<th><CODE>PMIC_ERR_OK</CODE></th>
52<td>The function has been called normally.</td>
53  </tr>
54  <tr>
55<th><CODE>PMIC_ERR_INVALID_ARGUMENTS</CODE></th>
56<td>The correct argument was not passed.</td>
57  </tr>
58  <tr>
59<th><CODE>PMIC_ERR_INVALID_STATE</CODE></th>
60<td>The Wii Speak is not open.</td>
61  </tr>
62  <tr>
63<th><CODE>PMIC_ERR_BUSY</CODE></th>
64<td>Cannot register the command. Call the function again.</td>
65  </tr>
66  <tr>
67<th><CODE>PMIC_ERR_FATAL</CODE></th>
68<td>A fatal error has occurred.</td>
69  </tr>
70</TABLE>
71
72<H2>Description</H2>
73<p>Asynchronously gets the ON/OFF state of the Wii Speak signal processor.</p>
74
75<p>This function stores the obtained state of the signal processor at the address specified by the <SPAN class="argument">state</SPAN> argument. If the signal processor is enabled, this function stores <code>PMIC_SP_ON</code>. If the signal processor is disabled, the function stores <code>PMIC_SP_OFF</code>. When the signal processor is disabled, you can get raw data that has not undergone the echo-canceling process. The default state of the signal processor is <code>PMIC_SP_ON</code>.</p>
76
77<p>One of the following is passed to <SPAN class="argument">result</SPAN>, the callback function's first argument.</p>
78
79<TABLE class="arguments" border="1" >
80  <tr>
81<th>PMIC_ERR_OK</th>
82<td>The state of the signal processor has been obtained successfully.</td>
83  </tr>
84  <tr>
85<th>PMIC_ERR_NO_DEVICE</th>
86<td>The Wii Speak has been unplugged.</td>
87  </tr>
88  <tr>
89<th>PMIC_ERR_INVALID_STATE</th>
90<td>The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)</td>
91  </tr>
92  <tr>
93<th>PMIC_ERR_USB_ERROR</th>
94<td>An error occurred in USB communications. Call the function again.</td>
95  </tr>
96  <tr>
97<th>PMIC_ERR_FATAL</th>
98<td>A fatal error has occurred.</td>
99  </tr>
100</TABLE>
101
102<H2>See Also</H2>
103
104<H2>Revision History</H2>
105<p>
1062009/06/11 Revised <B>Description</B>.<br>2008/12/22 Standardized terminology.<br>2008/10/23 Revised <B>Description</B>.<br>2008/04/24 Initial version.
107</p>
108
109<hr><p>CONFIDENTIAL</p></body>
110
111</html>
112