MIC_StartLimitedSamplingAsync

Syntax

#include <twl/spi.h>
MICResult MIC_StartLimitedSamplingAsync(
            const MICAutoParam*    param,
            MICCallback            callback,
            void*                  arg );

Arguments

param Pointer to a MICAutoParam-type auto-sampling settings structure.
callback Pointer to the callback function. This callback is called from inside the interrupt handler.
arg Argument passed to the callback function.

Return Values

Returns the processing result as a MICResult enumerated type. Returns MIC_RESULT_SUCCESS if the asynchronous process started normally; returns some other value if the process failed.

Description

Asynchronously starts frequency-limited microphone auto-sampling. Use the PM_SetAmp* function to turn on the programmable gain amp before sampling.
This function issues a request to the ARM7 to start frequency-limited auto-sampling and then returns control to the caller without waiting for a response. You must use the result argument passed by the user callback function to get the ARM7 processing result. If this function fails, the asynchronous operation is not performed, and the user callback function is not called.
Where the input volume exceeds the minimum or maximum value, the output data is clamped.

Frequency-limited auto-sampling differs from normal auto-sampling in that the hardware does the actual sampling. As a result, stable sampling can be performed at precise cycles; also, with the CPU burden on the ARM7 relaxed, effects of sampling on wireless communications and other I/O are reduced. On the other hand, sampling cannot be performed at frequencies that are unsupported by the hardware. The following sampling frequencies can be specified for param->rate, but the frequencies that can be specified at a given time depend on the sound master frequency settings and thus are further limited to four of the following. A value of MIC_RESULT_ILLEGAL_PARAMETER is returned if one of the limited frequencies is not specified.

Sound Master Frequency
Settable Frequency
Description
32.73 kHz MIC_SAMPLING_RATE_32730 32.73 kHz (1/1 of the master frequency)
MIC_SAMPLING_RATE_16360 16.36 kHz (1/2 of the master frequency)
MIC_SAMPLING_RATE_10910 10.91 kHz (1/3 of the master frequency)
MIC_SAMPLING_RATE_8180 8.18 kHz (1/4 of the master frequency)
47.61kHz MIC_SAMPLING_RATE_47610 47.61 kHz (1/1 of the master frequency)
MIC_SAMPLING_RATE_23810 23.81 kHz (1/2 of the master frequency)
MIC_SAMPLING_RATE_15870 15.87 kHz (1/3 of the master frequency)
MIC_SAMPLING_RATE_11900 11.90 kHz (1/4 of the master frequency)

Note

Because frequency-limited auto-sampling cannot be performed on the NITRO platform or when the CODEC is running in CODEC-DS mode, this function will instead internally call the MIC_StartAutoSamplingAsync auto-sampling control function.

It has been confirmed that slight hardware noise is mixed with the microphone input on the TWL system. See here for a workaround.

See Also

MIC_StartLimitedSampling
MIC_StopLimitedSamplingAsync
MIC_AdjustLimitedSamplingAsync

Revision History

2009/06/25 Added description of using the PM_SetAmp* function.
2008/01/09 Added a note about the difference in behavior with CODEC mode.
2007/11/17 Initial version.


CONFIDENTIAL