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>PMICSetGainAsync</title> 9</head> 10 11<body> 12 13<h1>PMICSetGainAsync</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction"> 17#include <revolution/pmic.h> 18 19// Mic(ADC) Gain 20#define PMIC_GAIN_00dB 0x0000 21#define PMIC_GAIN_15dB 0x0001 22#define PMIC_GAIN_30dB 0x0002 23#define PMIC_GAIN_36dB 0x0003 24 25typedef void (*PMICCallback)(PMIC_ERR result, void* arg); 26 27PMIC_ERR PMICSetGainAsync(u16 gain, PMICCallback cb, void* arg); 28</pre></dd></dl> 29 30<h2>Arguments</h2> 31<TABLE class="arguments" border="1" > 32 <tr> 33<th>gain</th> 34<td>Gain of 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 sets the gain of the Wii Speak.</p> 76 77<p>The gain is specified in the <SPAN class="argument">gain</SPAN> argument. You can set a gain of +0 dB, +15 dB, +30 dB, or +36 dB. Specify <code>PMIC_GAIN_00dB</code> for a gain of +0 dB, <code>PMIC_GAIN_15dB</code> for a gain of +15 dB, <code>PMIC_GAIN_30dB</code> for a gain of +30 dB, or <code>PMIC_GAIN_36dB</code> for a gain of +36 dB. The Wii Speak default gain setting is +36 dB.</p> 78 79<p>This function can be called when the Wii Speak is in the STOP state.</p> 80 81<p>One of the following is passed to <SPAN class="argument">result</SPAN>, the callback function's first argument.</p> 82 83<TABLE class="arguments" border="1" > 84 <tr> 85<th>PMIC_ERR_OK</th> 86<td>The gain has been set successfully.</td> 87 </tr> 88 <tr> 89<th>PMIC_ERR_NO_DEVICE</th> 90<td>The Wii Speak has been unplugged.</td> 91 </tr> 92 <tr> 93<th>PMIC_ERR_INVALID_STATE</th> 94<td>The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)</td> 95 </tr> 96 <tr> 97<th>PMIC_ERR_USB_ERROR</th> 98<td>An error occurred in USB communications. Call the function again.</td> 99 </tr> 100 <tr> 101<th>PMIC_ERR_FATAL</th> 102<td>A fatal error has occurred.</td> 103 </tr> 104</TABLE> 105 106<H2>See Also</H2> 107 108<H2>Revision History</H2> 109<p> 1102008/10/24 Added <B>Description</B>.<br> 2008/10/23 Revised <B>Description</B>.<br>2008/06/09 Initial version. 111</p> 112<hr><p>CONFIDENTIAL</p></body> 113</html>