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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>MIC_DoSamplingAsync</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">MIC_DoSamplingAsync <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></h1> 15 16<h2>Syntax</h2> 17 18<dl> 19 <dd> 20<CODE>#include <nitro/spi.h></CODE><BR> 21 <PRE><CODE><A href="MICResult.html">MICResult</A> MIC_DoSamplingAsync( 22 <A href="MICSamplingType.html">MICSamplingType</A> type, 23 void* buf, 24 <A href="MICCallback.html">MICCallback</A> callback, 25 void* arg );</CODE></PRE> 26 </dd> 27 28</dl><h2>Arguments</h2> 29<TABLE border="1" width="100%"> 30 <TBODY> 31 <TR> 32 <TD width="300"><em><strong><font face="Courier New">type</font></strong></em></TD> 33 <TD width="700">Sampling type as one of the <CODE><A href="MICSamplingType.html">MICSamplingType</A></CODE> enumerated types.</TD> 34 </TR> 35 <TR> 36 <TD><em><strong><font face="Courier New">buf</font></strong></em></TD> 37 <TD>Pointer to the buffer where the sampling result is stored.</TD> 38 </TR> 39 <TR> 40 <TD><em><strong><font face="Courier New">callback</font></strong></em></TD> 41 <TD>Pointer to the callback function. This callback is called from within the interrupt handler.</TD> 42 </TR> 43 <TR> 44 <TD><em><strong><font face="Courier New">arg</font></strong></em></TD> 45 <TD>Argument to pass to the callback function.</TD> 46 </TR> 47 </TBODY> 48</TABLE> 49 50<h2>Return Values</h2> 51<p> 52 Returns the processing result as a <CODE><A href="MICResult.html">MICResult</A></CODE> enumerated type. 53 If the asynchronous process started normally, returns <code>MIC_RESULT_SUCCESS</code>. If the process fails for some reason, returns some other value. 54</p> 55 56<H2>Description</H2> 57<P>Samples the microphone once asynchronously. This function issues a request to ARM7 to execute sampling and returns to the invoking program without waiting for a response from the ARM7 processor. To get the result from the processor, you must use the <em><strong><code>result</code></strong></em> argument. Where the input volume exceeds the minimum or maximum value, the output data will be clamped. You can use the <CODE><A href="../pm/PM_SetAmpGain.html">PM_SetAmpGain*</A></CODE> functions in advance to adjust the input volume that can be sampled. If this function fails, no operation is performed and no user callback function is called.</P> 58 59<H2>Note</H2> 60<P><FONT color=red>This function asynchronously writes values to the buffer specified by the <em><strong><code>buf</code></strong></em> argument. Do not attempt to use the buffer until you have confirmed the completion of asynchronous processes by the user callback function.</FONT></P> 61<P><FONT color=red>It has been confirmed that slight hardware noise is mixed with the microphone input on the TWL console. See <A href="./about_HardwareNoise.html">here</A> for a workaround.</FONT></P> 62 63<H2>See Also</H2> 64<P><CODE><A href="MIC_DoSampling.html">MIC_DoSampling</A>, <A href="../pm/PM_SetAmpGain.html">PM_SetAmpGain*</A></CODE></P> 65 66<H2>Revision History</H2> 67<P> 68 692005/06/27 Added statement about callbacks being called from the interrupt handler.<br>2005/01/11 Revised return values.<BR>2004/08/10 Added the description relating to the input volume.<BR>2004/06/01 Initial version. 70</P> 71<hr><p>CONFIDENTIAL</p></body> 72</html> 73