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>PMICInit</title> 9</head> 10 11<body> 12 13<h1>PMICInit</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction"> 17#include <revolution/pmic.h> 18 19// Working area size on MEM2 that the PMIC library uses 20#define PMIC_MEM2_WORK 17408 // 17 KB 21 22#define PMIC_READ_BUFFER_MSEC (48) // 48 msec 23#define PMIC_READ_BUFFER_SAMPLES (PMIC_READ_BUFFER_MSEC * 16) // @16 kHz, @mono 24#define PMIC_READ_BUFFER_SIZE (PMIC_READ_BUFFER_SAMPLES * sizeof(s16)) // @s16 25 26PMIC_ERR PMICInit(void* mem2); 27</pre></dd></dl> 28 29<h2>Arguments</h2> 30<TABLE class="arguments" border="1" > 31 <tr> 32<th>mem2</th> 33<td>Starting address of the work region allocated in MEM2 for the PMIC library. (The size of this region is <CODE>PMIC_MEM2_WORK</CODE> bytes.)</td> 34 </tr> 35</TABLE> 36 37<h2>Return Values</h2> 38<p> 39Returns one of the following. 40</p> 41 42<TABLE class="arguments" border="1" > 43 <tr> 44<th>PMIC_ERR_OK</th> 45<td>The library has been initialized normally.</td> 46 </tr> 47 <tr> 48<th>PMIC_ERR_INVALID_ARGUMENTS</th> 49<td>The correct argument was not passed.</td> 50 </tr> 51 <tr> 52<th>PMIC_ERR_BUSY</th> 53<td>The state is in transition. Call the function again.</td> 54 </tr> 55 <tr> 56<th>PMIC_ERR_FATAL</th> 57<td>A fatal error has occurred.</td> 58 </tr> 59</TABLE> 60 61<H2>Description</H2> 62<p>Initializes the PMIC library. This function must be called once before using any other PMIC functions.</p> 63 64<p>When this function initializes the PMIC library, the library allocates a buffer for 48 ms of audio data obtained from the Wii Speak (or approximately 70 ms at 16 kHz or 11 kHz, or 96 ms at 8 kHz) in the region specified by the <SPAN class="argument">mem2</SPAN> argument. Applications must then call the <code>PMICRead</code> function at intervals less than 48 ms (at 16 kHz) to keep audio data from being overwritten in this buffer.</p> 65 66<p>Initialize the library with the <code>PMICInitEx</code> function if you want to increase the interval for calling the <code>PMICRead</code> function to longer than 48 ms.</p> 67 68<p>After calling this function, be sure to call the <code>PMICProbe</code> function once before calling the <code>PMICOpen(Async)</code> functions.</p> 69 70<H2>See Also</H2> 71<p> 72<a href="PMICInitEx.html"><CODE>PMICInitEx</CODE></a><BR> <a href="PMICProbe.html"><CODE>PMICProbe</CODE></a><BR> <a href="PMICOpen.html"><CODE>PMICOpen</CODE></a><BR> <a href="PMICOpenAsync.html"><CODE>PMICOpenAsync</CODE></a><BR> <a href="PMICRead.html"><CODE>PMICRead</CODE></a> 73</p> 74 75<H2>Revision History</H2> 76<p> 772009/06/01 Added description related to calling <code>PMICProbe</code>.<br>2008/10/21 Changed the size of work memory.<br>2008/09/25 Changed the size of work memory.<br>2008/03/04 Changed the function reference format.<br>2008/01/25 Initial version. 78</p> 79 80<hr><p>CONFIDENTIAL</p></body> 81 82</html> 83