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"><SPAN class="argument">type</SPAN></TD> 33<TD width="700">Sampling type as one of the <A href="MICSamplingType.html"><CODE>MICSamplingType</CODE></A> enumerated types.</TD> 34 </TR> 35 <TR> 36<TD><SPAN class="argument">buf</SPAN></TD> 37<TD>Pointer to the buffer where the sampling result is stored.</TD> 38 </TR> 39 <TR> 40<TD><SPAN class="argument">callback</SPAN></TD> 41<TD>Pointer to the callback function. This callback is called from inside the interrupt handler.</TD> 42 </TR> 43 <TR> 44<TD><SPAN class="argument">arg</SPAN></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 <A href="MICResult.html"><CODE>MICResult</CODE></A> enumerated type. If the asynchronous process started normally, returns <code>MIC_RESULT_SUCCESS</code>. If the process fails for some reason, returns some other value. 53</p> 54 55<H2>Description</H2> 56<P>Samples the microphone once asynchronously. Use the <A href="../pm/PM_SetAmp.html"><CODE>PM_SetAmp*</CODE></A> function to turn on the programmable gain amp before sampling.<BR>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 <SPAN class="argument">result</SPAN> argument. Where the input volume exceeds the minimum or maximum value, the output data will be clamped. You can use the <A href="../pm/PM_SetAmpGain.html"><CODE>PM_SetAmpGain*</CODE></A> 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> 57 58<H2>Note</H2> 59<P><FONT color=red>This function asynchronously writes values to the buffer specified by the <SPAN class="argument">buf</SPAN> argument. Do not attempt to use the buffer until you have confirmed the completion of asynchronous processes by the user callback function.</FONT></P> 60<P><FONT color=red>It has been confirmed that slight hardware noise is mixed with the microphone input on the TWL system. See <A href="./about_HardwareNoise.html">here</A> for a workaround.</FONT></P> 61 62<H2>See Also</H2> 63<P><A href="MIC_DoSampling.html"><CODE>MIC_DoSampling</CODE></A><BR> <A href="../pm/PM_SetAmpGain.html"><CODE>PM_SetAmpGain*</CODE></A></P> 64 65<H2>Revision History</H2> 66<P> 672009/06/25 Added description about using the <CODE>PM_SetAmp*</CODE> function.<br> 2005/06/27 Added text indicating that the callback is called from the interrupt handler.<br> 2005/01/11 Revised return value.<BR> 2004/08/10 Added description related to input volume.<BR> 2004/06/01 Initial version. 68</P> 69<hr><p>CONFIDENTIAL</p></body> 70</html> 71