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>PMICGetFreqAsync</title>
9</head>
10
11<body>
12
13<h1>PMICGetFreqAsync</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/pmic.h&gt;
18
19// Sampling Frequency
20#define PMIC_FREQ_8KHZ               0x0000
21#define PMIC_FREQ_11KHZ              0x0001
22#define PMIC_FREQ_RESERVED           0x0002
23#define PMIC_FREQ_16KHZ              0x0003
24
25typedef void (*PMICCallback)(PMIC_ERR result, void* arg);
26
27PMIC_ERR PMICGetFreqAsync(u16* freq, PMICCallback cb, void* arg);
28</pre></dd></dl>
29
30<h2>Arguments</h2>
31<TABLE class="arguments" border="1" >
32  <tr>
33<th>freq</th>
34<td>Location for storing the sampling frequency of the audio data received from the Wii Speak.</td>
35  </tr>
36  <tr>
37<th>cb</th>
38<td>Callback function that will send notification of the execution results of this function.</td>
39  </tr>
40  <tr>
41<th>arg</th>
42<td>Passed as the second argument of the callback function above.</td>
43  </tr>
44</TABLE>
45
46<h2>Return Values</h2>
47<p>
48Returns one of the following.
49</p>
50
51<TABLE class="arguments" border="1">
52  <tr>
53<th>PMIC_ERR_OK</th>
54<td>The function has been called normally.</td>
55  </tr>
56  <tr>
57<th>PMIC_ERR_INVALID_ARGUMENTS</th>
58<td>The correct argument was not passed.</td>
59  </tr>
60  <tr>
61<th>PMIC_ERR_INVALID_STATE</th>
62<td>The Wii Speak is not open.</td>
63  </tr>
64  <tr>
65<th>PMIC_ERR_BUSY</th>
66<td>Cannot register the command. Call the function again.</td>
67  </tr>
68  <tr>
69<th>PMIC_ERR_FATAL</th>
70<td>A fatal error has occurred.</td>
71  </tr>
72</TABLE>
73
74<H2>Description</H2>
75<p>Asynchronously gets the sampling frequency of the audio data received from the Wii Speak.</p>
76
77<p>This function stores the obtained sampling frequency at the address specified by the <SPAN class="argument">freq</SPAN> argument. The function stores <code>PMIC_FREQ_8KHZ</code> for a sampling frequency of 8000 Hz; <code>PMIC_FREQ_11KHZ</code> for a sampling frequency of 11,025 Hz; or <code>PMIC_FREQ_16KHZ</code> for a sampling frequency of 16,000 Hz. The default sampling frequency is <code>PMIC_FREQ_16KHZ</code>.</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 sampling frequency has been successfully obtained.</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>
1082008/10/23 Revised <B>Description</B>.<br>2008/04/18 Initial version.
109</p>
110<hr><p>CONFIDENTIAL</p></body>
111</html>