#include <nitro/spi.h>
typedef struct
{
MICSamplingType type;
void* buffer;
u32 size;
u32 rate;
BOOL loop_enable;
MICCallback full_callback;
void* full_arg;
} MICAutoParam;
type | Sampling type of the MICSamplingType enumerator type |
buffer | Specifies a pointer to the buffer that stores the sampling result. Because ARM7 writes the sampling result directly to this buffer, this buffer needs to be 32-byte cache-aligned. |
size | Size of the buffer storing the sampling result |
rate | The sampling rate. Directly specifies the CPU timer rate of the ARM7. You can also select a rate from MICSamplingRate enumerator type. |
loop_enable | Flag for looping buffer during continuous sampling |
full_callback | Pointer to callback function called when buffer is full |
full_arg | Argument to pass to callback function called when buffer is full |
This structure shows the settings for microphone auto-sampling. When TRUE
is specified for the loop_enable
flag, continuous sampling continues when the buffer becomes full by returning the sampling-data storage-position to the start of the buffer. Continuous sampling will proceed until the function that stops auto-sampling is called. When FALSE
is set for the loop_enable
flag, microphone sampling will stop automatically when the buffer becomes full. Regardless of the setting of the loop_enable
flag, the function specified by full_callback
will be called when the buffer becomes full.
The buffer that will store the sampling results should have an address with 32-byte alignment and be a size that is a multiple of 32. This is because when the sampling results are read, the cache of the target area gets destroyed.
MIC_StartAutoSampling, MIC_StartAutoSamplingAsync, MIC_StopAutoSampling, MIC_StopAutoSamplingAsync
09/17/2004 Added description about the buffer member alignment
06/01/2004 Initial version