# MIC_AdjustAutoSamplingAsync

## Syntax

  `#include <nitro/spi.h>`

      MICResult MIC_AdjustAutoSamplingAsync(
                u32             rate,
                MICCallback     callback,
                void*           arg );

## Arguments

rate | The sampling rate. Directly specifies ARM7 CPU timer cycles. Can also be selected from the `MICSamplingRate` enumerated type.
callback | Specifies the pointer to the callback function. This callback is called from within the interrupt handler.
arg | Specifies the 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 starts normally, and some other value if the process fails for some reason.

## Description

Asynchronously adjusts the sampling rate of the microphone's auto-sampling.
This function issues a request to the ARM7 to adjust auto-sampling and 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. This is only valid when auto-sampling has already begun. The CPU timer cycle is updated when the ARM7 receives the request, not earlier.

This function will return `MIC_RESULT_INVALID_COMMAND` when the CODEC is running in CODEC-TWL mode, because auto-sampling cannot be run at an arbitrary frequency in CODEC-TWL mode.

## See Also

`MIC_AdjustAutoSampling`, `MIC_StartAutoSamplingAsync`, `MIC_StopAutoSamplingAsync`

## Revision History

2008/01/09 Revised a description of differences in behavior due to the CODEC mode.
2007/11/17 Added a description of operations on the TWL platform.
2005/06/27 Added supplementary information stating that the callback is invoked from the interrupt handler.
2005/01/11 Initial version.

CONFIDENTIAL