EFM32 Gecko Software Documentation  efm32g-doc-5.1.2
mic.c 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.c.

#include "em_device.h"
#include "em_adc.h"
#include "em_emu.h"
#include "em_cmu.h"
#include "em_prs.h"
#include "em_letimer.h"
#include "dmadrv.h"
#include "thunderboard/util.h"
#include "thunderboard/board.h"
#include "thunderboard/mic.h"
#include <math.h>

Go to the source code of this file.

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...