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>PMICOpen</title> 9</head> 10 11<body> 12 13<h1>PMICOpen</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction"> 17#include <revolution/pmic.h> 18 19PMIC_ERR PMICOpen(void); 20</pre></dd></dl> 21 22<h2>Arguments</h2> 23<p>None.</p> 24 25<h2>Return Values</h2> 26<p> 27Returns one of the following. 28</p> 29 30<TABLE class="arguments" border="1" > 31 <tr> 32<th><CODE>PMIC_ERR_OK</CODE></th> 33<td>The Wii Speak has been opened successfully.</td> 34 </tr> 35 <tr> 36<th><CODE>PMIC_ERR_NO_DEVICE</CODE></th> 37<td>The Wii Speak has been unplugged.</td> 38 </tr> 39 <tr> 40<th><CODE>PMIC_ERR_INVALID_STATE</CODE></th> 41<td>Either the PMIC library is not initialized, or the Wii Speak cable is not inserted in the USB port.</td> 42 </tr> 43 <tr> 44<th><CODE>PMIC_ERR_BUSY</CODE></th> 45<td>The state is in transition. Call the function again.</td> 46 </tr> 47 <tr> 48<th><CODE>PMIC_ERR_USB_ERROR</CODE></th> 49<td>An error occurred in USB communications. Call the function again.</td> 50 </tr> 51 <tr> 52<th><CODE>PMIC_ERR_FATAL</CODE></th> 53<td>A fatal error has occurred.</td> 54 </tr> 55</TABLE> 56 57<H2>Description</H2> 58<p>Opens the Wii Speak synchronously.</p> 59 60<p>If the Wii Speak is successfully opened, its microphone transitions to the stopped state. You can set operating parameters, start the microphone, and perform various other operations on the Wii Speak while the microphone is stopped.</p> 61 62<p>The library prepares to recognize the Wii Speak by calling the <CODE>PMICProbe</CODE> function first after calling the <CODE>PMICInit</CODE> function. Therefore, after calling the <code>PMICInit</code> function, always call the <code>PMICProbe</code> function once before calling this function.</p> 63 64<p>Also, even if the Wii Speak is connected, if you call this function before the library recognizes the Wii Speak and <code>PMIC_ERR_OK</code> is returned for the <code>PMICProbe</code> function, this function returns <code>PMIC_ERR_INVALID_STATE</code> (in rare cases, <code>PMIC_ERR_BUSY</code>). In such cases, call this function after waiting a while until the <code>PMIC_ERR_OK</code> value is returned for the <code>PMICProbe</code> function.</p> 65 66<p>This function cannot be called in an interrupt handler or alarm callback.</p> 67 68<p>After the Wii Speak is opened, the error notification callback registered by the <code>PMICRegisterErrorCallback</code> function is enabled.</p> 69 70<p><B>Note: Do not quit an application while the Wii Speak is still open. Always call the <code>PMICCloseAsync</code> or <code>PMICClose</code> function to close the Wii Speak before exiting an application.</B></p> 71 72<p> 73 74<H2>See Also</H2> 75<p> 76<a href="PMICInit.html"><CODE>PMICInit</CODE></a><BR> <a href="PMICProbe.html"><CODE>PMICProbe</CODE></a><BR> <a href="PMICRegisterErrorCallback.html"><CODE>PMICRegisterErrorCallback</CODE></a><BR> <a href="PMICCloseAsync.html"><CODE>PMICCloseAsync</CODE></a><BR> <a href="PMICClose.html"><CODE>PMICClose</CODE></a> 77</p> 78 79<H2>Revision History</H2> 80<p> 812009/06/17 Revised description related to calling the <code>PMICProbe</code> function.<br>2009/06/01 Added description related to calling <code>PMICProbe</code>.<br>2008/12/22 Changed the error codes.<BR>2008/11/04 Added <B>Description</B>.<br>2008/10/24 Revised <B>Description</B>.<br>2008/10/23 Revised <B>Return Values</B>.<br>2008/10/22 Added note.<br>2008/09/25 Added <B>Return Values</B>.<br>2008/03/04 Changed the function reference format.<br>2008/01/25 Initial version. 82</p> 83 84<hr><p>CONFIDENTIAL</p></body> 85 86</html> 87