EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
mic.h File Reference

Detailed Description

Driver for the SPV1840LR5H-B MEMS Microphone.

Version
5.1.1

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

This file is licensed under the Silicon Labs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file mic.h.

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "mic_config.h"

Go to the source code of this file.

Macros

#define MIC_ADC_ACQ_TIME   MIC_CONFIG_ADC_ACQ_TIME
 
#define MIC_ADC_CLOCK_FREQ   MIC_CONFIG_ADC_CLOCK_FREQ
 
#define MIC_OK   0
 

Functions

void MIC_deInit (void)
 Powers down the MEMS microphone stops the ADC and frees up the DMA channel. More...
 
float MIC_getMean (void)
 Calculates the average value of the samples in the buffer. More...
 
uint16_t * MIC_getSampleBuffer (void)
 Gets the sample buffer. More...
 
float MIC_getSoundLevel (float *var)
 Calculates the sound level. More...
 
uint32_t MIC_init (uint32_t fs, uint16_t *buffer, size_t len)
 Initializes MEMS microphone and sets up the DMA, ADC and clocking. More...
 
bool MIC_isBusy (void)
 Checks if the microphone is in use. More...
 
void MIC_start (uint32_t nSamples)
 Starts taking samples using DMA from the microphone. More...