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_SetI2SFrequency</title> 6 <link rel="stylesheet" href="../../css/nitro.css" type="text/css"> 7 </HEAD> 8 <BODY> 9 <H1>SNDEX_SetI2SFrequency <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 <twl/snd.h></CODE></DD> 14 <DD><PRE><CODE>SNDEXResult SNDEX_SetI2SFrequency( <A href="SNDEXFrequency.html">SNDEXFrequency</A> freq );</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 an <A href="SNDEXFrequency.html"><CODE>SNDEXFrequency</CODE></A> enumerated type.</TD> 23 </TR> 24 </TBODY> 25 </TABLE> 26 27 <H2>Return Values</H2> 28 <TABLE> 29 <TBODY> 30 <TR> 31 <TH width="25%"><CODE>SNDEX_RESULT_SUCCESS</CODE></TH> 32 <TD width="75%">The whole series of operations completed successfully.</TD> 33 </TR> 34 <TR> 35 <TH width="25%"><CODE>SNDEX_RESULT_ILLEGAL_STATE</CODE></TH> 36 <TD width="75%">This function has been called on the NITRO platform or from an exception handler; when the codec is running in CODEC-DS mode; when forced audio output has been configured for the speaker; or when frequency-limited microphone auto-sampling is running.</TD> 37 </TR> 38 <TR> 39 <TH width="25%"><CODE>SNDEX_RESULT_INVALID_PARAM</CODE></TH> 40 <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> 41 </TR> 42 <TR> 43 <TH width="25%"><CODE>SNDEX_RESULT_BEFORE_INIT</CODE></TH> 44 <TD width="75%">Extended sound features have not been initialized by the <A href="SNDEX_Init.html"><CODE>SNDEX_Init</CODE></A> function.</TD> 45 </TR> 46 <TR> 47 <TH width="25%"><CODE>SNDEX_RESULT_EXCLUSIVE</CODE></TH> 48 <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. This is also returned when a mutex error occurred in the ARM7. When this is the case, the situation may improve on a retry because the error is dependent on the progress of processing in ARM7.<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> 49 </TR> 50 <TR> 51 <TH width="25%"><CODE>SNDEX_RESULT_PXI_SEND_ERROR</CODE></TH> 52 <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> 53 </TR> 54 <TR> 55 <TH width="25%"><CODE>SNDEX_RESULT_FATAL_ERROR</CODE></TH> 56 <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. 57 </TD> 58 </TR> 59 </TBODY> 60 </TABLE> 61 62 <H2>Description</H2> 63 <P> 64 Synchronously changes the I2S operating frequency. The I2S operating frequency is set to <CODE>SNDEX_FREQUENCY_32730</CODE> by default. 65 </P> 66 <P> 67 This function calls the <A href="SNDEX_SetI2SFrequencyAsync.html"><CODE>SNDEX_SetI2SFrequencyAsync</CODE></A> function internally and stops its own calling thread until asynchronous processing has completed. This function expects to be called from a thread, so it fails if it is called from an exception handler. Note that this function continues to block internally if PXI receive interrupts are prohibited, because PXI receive interrupts are used to detect the processing's completion. 68 </P> 69 70 <H2>Notes</H2> 71 <P> 72 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> 73 </P> 74 75 <H2>See Also</H2> 76 <P> 77 <A href="SNDEX_SetI2SFrequencyAsync.html"><CODE>SNDEX_SetI2SFrequencyAsync</CODE></A><BR> <A href="SNDEX_GetI2SFrequency.html"><CODE>SNDEX_GetI2SFrequency</CODE></A><BR> <A href="../../spi/mic/MIC_StopLimitedSampling.html"><CODE>MIC_StopLimitedSampling</CODE></A><BR> <A href="../../spi/mic/MIC_StopAutoSampling.html"><CODE>MIC_StopAutoSampling</CODE></A><BR> <A href="../../spi/tp/TP_RequestAutoSamplingStop.html"><CODE>TP_RequestAutoSamplingStop</CODE></A> 78 </P> 79 80 <H2>Revision History</H2> 81 <P> 822008/11/07 Added mention that <CODE>SNDEX_RESULT_EXCLUSIVE</CODE> is returned during processing of shutter sound playback.<BR> 2008/02/15 Initial version. 83 </P> 84 <hr><p>CONFIDENTIAL</p></body> 85</HTML> 86