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>PMICSetSpStateAsync</title>
9</head>
10
11<body>
12
13<h1>PMICSetSpStateAsync</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 PMICSetSpStateAsync(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>state</th>
32<td>ON/OFF state of the Wii Speak's signal processor.</td>
33  </tr>
34  <tr>
35<th>cb</th>
36<td>Callback function that will send notification of the execution results of this function.</td>
37  </tr>
38  <tr>
39<th>arg</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>PMIC_ERR_OK</th>
52<td>The function has been called normally.</td>
53  </tr>
54  <tr>
55<th>PMIC_ERR_INVALID_ARGUMENTS</th>
56<td>The correct argument was not passed.</td>
57  </tr>
58  <tr>
59<th>PMIC_ERR_INVALID_STATE</th>
60<td>The Wii Speak is not open.</td>
61  </tr>
62  <tr>
63<th>PMIC_ERR_BUSY</th>
64<td>Cannot register the command. Call the function again.</td>
65  </tr>
66  <tr>
67<th>PMIC_ERR_FATAL</th>
68<td>A fatal error has occurred.</td>
69  </tr>
70</TABLE>
71
72<H2>Description</H2>
73<p>Asynchronously sets the ON/OFF state of the Wii Speak signal processor.</p>
74
75<p>Specify the state of the signal processor in the <SPAN class="argument">state</SPAN> argument. To enable the signal processor, set <SPAN class="argument">state</SPAN> to <code>PMIC_SP_ON</code>. To disable the signal processor, set it to <code>PMIC_SP_OFF</code>. When the signal processor is disabled, the echo canceler is disabled so you can get raw data. The default state of the signal processor is <code>PMIC_SP_ON</code>.</p>
76
77<p>This function can be called when the Wii Speak is in the STOP state.</p>
78
79<p>One of the following is passed to <SPAN class="argument">result</SPAN>, the callback function's first argument.</p>
80
81<TABLE class="arguments" border="1" >
82  <tr>
83<th>PMIC_ERR_OK</th>
84<td>The signal processor state has been set successfully.</td>
85  </tr>
86  <tr>
87<th>PMIC_ERR_NO_DEVICE</th>
88<td>The Wii Speak has been unplugged.</td>
89  </tr>
90  <tr>
91<th>PMIC_ERR_INVALID_STATE</th>
92<td>The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)</td>
93  </tr>
94  <tr>
95<th>PMIC_ERR_USB_ERROR</th>
96<td>An error occurred in USB communications. Call the function again.</td>
97  </tr>
98  <tr>
99<th>PMIC_ERR_FATAL</th>
100<td>A fatal error has occurred.</td>
101  </tr>
102</TABLE>
103
104<H2>See Also</H2>
105
106<H2>Revision History</H2>
107<p>
1082009/06/11 Revised <B>Description</B>.<br>2008/10/24 Added <B>Description</B>.<br>2008/07/04 Revised the description of <code>PMIC_ERR_INVALID_STATE</code>.<br>2008/04/24 Initial version.
109</p>
110
111<hr><p>CONFIDENTIAL</p></body>
112
113</html>
114