#include <cafe/mic.h> int MICGetStatus(mic_handle_t h_mic, mic_status_t* p_status);
|h_mic||Handle returned from
|p_status||Pointer to a structure of type
A value of
MIC_ERROR_NONE (zero) indicates success and any other value indicates the type of error that was encountered.
This function is used to query the present status of the ring buffer. It shows the number of samples available in the ring buffer and the index to the samples in the ring buffer. In a DMA based, zero copy playback design, it is necessary to flush the data cache as indicated by the read index and the number of available samples.
The read index into the ring buffer is an
unsigned integer indexing an array of type
Any ring buffer wraparound logic must be implemented by the caller.
Using AX, an application can construct a ring buffer in multiples of playback chunks and be properly aligned for DMA. That will simplify the ring buffer and cache management logic. The SDK provided demo application uses this logic.
Separate, bitwise flags indicate connection status and whether the DRC microphone library is open.
The status flag
MIC_STATUS_FLAG_CONNECTED and the return value
MIC_ERROR_NOT_INIT are a reliable way
to poll whether the DRC is still connected to the console. As soon as DRC and console become disconnected,
the DRC microphone library is uninitialized. That leads to
MIC_ERROR_NOT_INIT being returned.
An application needs to call
MICSetDataConsumed to indicate how many samples are being processed.
The processing performed in
MICGetStatus is lightweight and calling this function
from a timing sensitive thread, such as the AX callback, can be performed.
|Background||Do not call this function from the background.|
|Interrupt handler||Do not call this function from any interrupt handler.|
|Exception handler||Do not call this function from any exception handler.|
2013/05/08 Automated cleanup pass.
2012/08/03 Cleanup Pass.
2012/06/08 Update to match SDK 2.06.
2011/10/27 Initial version.