Il y avait des problèmes dans la libraire...
Dependencies: ST_FREQUENCY_DIVIDER ST_I2S USBDEVICE
Fork of X_NUCLEO_CCA02M1 by
Diff: Middlewares/OpenPDM2PCM/OpenPDMFilter.h
- Revision:
- 2:9f389fd8fb2e
- Child:
- 15:17bdadc6aa9c
diff -r 245f83276546 -r 9f389fd8fb2e Middlewares/OpenPDM2PCM/OpenPDMFilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Middlewares/OpenPDM2PCM/OpenPDMFilter.h Fri Apr 21 10:33:08 2017 +0200 @@ -0,0 +1,84 @@ +/** + ****************************************************************************** + * @file OpenPDMFilter.h + * @author CL + * @version V1.0.0 + * @date 9-September-2015 + * @brief Header file for Open PDM audio software decoding Library. + * This Library is used to decode and reconstruct the audio signal + * produced by ST MEMS microphone (MP45Dxxx, MP34Dxxx). + ****************************************************************************** + * @attention + * + * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2> + * + * Licensed under MCD-ST Image SW License Agreement V2, (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.st.com/software_license_agreement_image_v2 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ + +#ifndef __OPENPDMFILTER_H +#define __OPENPDMFILTER_H + +#ifdef __cplusplus + extern "C" { +#endif + + +/* Includes ------------------------------------------------------------------*/ + +#include <stdint.h> + + +/* Definitions ---------------------------------------------------------------*/ + +#define HTONS(A) ((((uint16_t)(A) & 0xff00) >> 8) | \ + (((uint16_t)(A) & 0x00ff) << 8)) + + +/* Types ---------------------------------------------------------------------*/ + +typedef struct { + /* Public */ + uint16_t Fs; + float LP_HZ; + float HP_HZ; + uint16_t In_MicChannels; + uint16_t Out_MicChannels; + uint16_t Decimation; + uint16_t SincN; + /* Private */ + uint32_t Coef[5]; + uint16_t FilterLen; + int64_t OldOut, OldIn, OldZ; + uint16_t LP_ALFA; + uint16_t HP_ALFA; + uint16_t bit[5]; + uint16_t byte; +} TPDMFilter_InitStruct; + + +/* Exported functions ------------------------------------------------------- */ + +void Open_PDM_Filter_Init(TPDMFilter_InitStruct *init_struct); +void Open_PDM_Filter(uint8_t* data, uint16_t* data_out, uint16_t mic_gain, TPDMFilter_InitStruct *init_struct); + +#ifdef __cplusplus +} +#endif + +#endif // __OPENPDMFILTER_H + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/