1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3	<HEAD>
4		<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5		<title>SNDEX_SetI2SFrequencyAsync</title>
6		<link rel="stylesheet" href="../../css/nitro.css" type="text/css">
7	</HEAD>
8	<BODY>
9		<H1>SNDEX_SetI2SFrequencyAsync <IMG src="../../image/TWL.gif" width="24" height="12" border="0" align=middle></H1>
10
11		<H2>Syntax</H2>
12		<DL>
13			<DD><CODE>#include &lt;twl/snd.h&gt;</CODE></DD>
14			<DD><PRE><CODE>SNDEXResult SNDEX_SetI2SFrequencyAsync( <A href="SNDEXFrequency.html">SNDEXFrequency</A> freq, <A href="SNDEXCallback.html">SNDEXCallback</A> callback, void* arg );</CODE></PRE></DD>
15		</DL>
16
17		<H2>Arguments</H2>
18		<TABLE>
19			<TBODY>
20				<TR>
21					<TH width="25%"><SPAN class="argument">freq</SPAN></TH>
22					<TD width="75%">I2S operating frequency as a <A href="SNDEXFrequency.html"><CODE>SNDEXFrequency</CODE></A> enumerated type.</TD>
23				</TR>
24				<TR>
25					<TH width="25%"><SPAN class="argument">callback</SPAN></TH>
26					<TD width="75%"><A href="SNDEXCallback.html"><CODE>SNDEXCallback</CODE></A>-type function that is notified when the asynchronous process has completed. The asynchronous process runs even if <CODE>NULL</CODE> is specified here, but you are no longer able to detect that it has completed.</TD>
27				</TR>
28				<TR>
29					<TH width="25%"><SPAN class="argument">arg</SPAN></TH>
30					<TD width="75%">Argument to pass to the function specified in <SPAN class="argument">callback</SPAN>.</TD>
31				</TR>
32			</TBODY>
33		</TABLE>
34
35		<H2>Return Values</H2>
36		<H3>Function Return Values</H3>
37		<TABLE>
38			<TBODY>
39				<TR>
40					<TH width="25%"><CODE>SNDEX_RESULT_SUCCESS</CODE></TH>
41					<TD width="75%">Asynchronous processing started successfully. The asynchronous processing results are passed as an argument to the function registered in <SPAN class="argument">callback</SPAN>.</TD>
42				</TR>
43				<TR>
44					<TH width="25%"><CODE>SNDEX_RESULT_ILLEGAL_STATE</CODE></TH>
45					<TD width="75%">Returned when this function is called on the NITRO platform or when the codec is running in CODEC-DS mode.</TD>
46				</TR>
47				<TR>
48					<TH width="25%"><CODE>SNDEX_RESULT_INVALID_PARAM</CODE></TH>
49					<TD width="75%">The value specified for <SPAN class="argument">freq</SPAN> is not included in the <A href="SNDEXFrequency.html">standard values</A>.</TD>
50				</TR>
51				<TR>
52					<TH width="25%"><CODE>SNDEX_RESULT_BEFORE_INIT</CODE></TH>
53					<TD width="75%">Extended sound features have not been initialized by the <A href="SNDEX_Init.html"><CODE>SNDEX_Init</CODE></A> function.</TD>
54				</TR>
55				<TR>
56					<TH width="25%"><CODE>SNDEX_RESULT_EXCLUSIVE</CODE></TH>
57					<TD width="75%">Processing for other extended sound features is running. Note that mutexes are used for each of the extended sound features, so they cannot be used simultaneously.<BR>As mentioned in the <A href="./doc/aboutSNDEX.html">SNDEX Library Overview</A>, the error also returns during processing of shutter sound playback.</TD>
58				</TR>
59				<TR>
60					<TH width="25%"><CODE>SNDEX_RESULT_PXI_SEND_ERROR</CODE></TH>
61					<TD width="75%">A PXI command failed to be sent to the ARM7. This error occurs when the PXI send queue for the ARM7 has filled up or when the hardware has detected an error. As a result, the state may improve when a retry is made.</TD>
62				</TR>
63			</TBODY>
64		</TABLE>
65		<H3>Asynchronous Process Results</H3>
66		<TABLE>
67			<TBODY>
68				<TR>
69					<TH width="25%"><CODE>SNDEX_RESULT_SUCCESS</CODE></TH>
70					<TD width="75%">The whole series of operations completed successfully.</TD>
71				</TR>
72				<TR>
73					<TH width="25%"><CODE>SNDEX_RESULT_ILLEGAL_STATE</CODE></TH>
74					<TD width="75%">The codec is running in CODEC-DS mode; forced audio output is configured for the speaker; or frequency-limited microphone auto-sampling is running.</TD>
75				</TR>
76				<TR>
77					<TH width="25%"><CODE>SNDEX_RESULT_EXCLUSIVE</CODE></TH>
78					<TD width="75%">A mutex error occurred in the ARM7. This error depends upon the progress of ARM7 processing, so conditions may improve when a retry is made.</TD>
79				</TR>
80				<TR>
81					<TH width="25%"><CODE>SNDEX_RESULT_FATAL_ERROR</CODE></TH>
82					<TD width="75%">This error should not ordinarily occur. This may occur when an illegal PXI command was sent directly, ignoring library state management; when the ARM7 component and the extended sound feature library have different versions; when library state management has fallen into an abnormal state due to memory corruption; or when other such conditions arise. There is no way to recover from this at run time.
83					</TD>
84				</TR>
85			</TBODY>
86		</TABLE>
87
88		<H2>Description</H2>
89		<P>
90			Asynchronously changes the I2S operating frequency. The I2S operating frequency is set to <CODE>SNDEX_FREQUENCY_32730</CODE> by default.
91		</P>
92		<P>
93			If this function does not return a value of <CODE>SNDEX_RESULT_SUCCESS</CODE>, the asynchronous processing and callback do not run. Also note that a PXI receive interrupt sends notification when the asynchronous processing is complete, so callbacks do not occur if PXI receive interrupts are prohibited.
94		</P>
95
96		<H2>Notes</H2>
97		<P>
98			Changing to the I2S operating frequency also entails change synchronization of the communications clock with respect to CPU-external devices. Sound output features and CODEC-related features are all affected as a result.<FONT color="red">Switch the frequency only after stopping all of the following: audio output from the CPU and DSP, touch panel input sampling, microphone input sampling, and microphone input sampling from the DSP.</FONT>
99		</P>
100
101		<H2>See Also</H2>
102		<P>
103			<A href="SNDEX_SetI2SFrequency.html"><CODE>SNDEX_SetI2SFrequency</CODE></A><BR> <A href="SNDEX_GetI2SFrequencyAsync.html"><CODE>SNDEX_GetI2SFrequencyAsync</CODE></A><BR> <A href="../../spi/mic/MIC_StopLimitedSamplingAsync.html"><CODE>MIC_StopLimitedSamplingAsync</CODE></A><BR> <A href="../../spi/mic/MIC_StopAutoSamplingAsync.html"><CODE>MIC_StopAutoSamplingAsync</CODE></A><BR> <A href="../../spi/tp/TP_RequestAutoSamplingStopAsync.html"><CODE>TP_RequestAutoSamplingStopAsync</CODE></A>
104		</P>
105
106		<H2>Revision History</H2>
107		<P>
1082008/11/07 Added mention that <CODE>SNDEX_RESULT_EXCLUSIVE</CODE> is returned during processing of shutter sound playback.<BR> 2008/11/06 Corrected <B>Asynchronous Process Results</B> (<CODE>SNDEX_RESULT_EXCLUSIVE</CODE>) in <B>Return Values</B>.<BR> 2008/02/15 Initial version.
109		</P>
110	<hr><p>CONFIDENTIAL</p></body>
111</HTML>
112