rt-thread/bsp/stm32/stm32f469-st-disco/board/CubeMX_Config/Src/pdm2pcm.c

86 lines
2.5 KiB
C

/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : pdm2pcm.c
* Description : This file provides code for the configuration
* of the pdm2pcm instances.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "pdm2pcm.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* Global variables ---------------------------------------------------------*/
PDM_Filter_Handler_t PDM1_filter_handler;
PDM_Filter_Config_t PDM1_filter_config;
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* PDM2PCM init function */
void MX_PDM2PCM_Init(void)
{
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/**
*/
PDM1_filter_handler.bit_order = PDM_FILTER_BIT_ORDER_LSB;
PDM1_filter_handler.endianness = PDM_FILTER_ENDIANNESS_BE;
PDM1_filter_handler.high_pass_tap = 2104533974;
PDM1_filter_handler.in_ptr_channels = 2;
PDM1_filter_handler.out_ptr_channels = 2;
PDM_Filter_Init(&PDM1_filter_handler);
PDM1_filter_config.decimation_factor = PDM_FILTER_DEC_FACTOR_64;
PDM1_filter_config.output_samples_number = 16;
PDM1_filter_config.mic_gain = 0;
PDM_Filter_setConfig(&PDM1_filter_handler, &PDM1_filter_config);
/* USER CODE BEGIN 3 */
/* USER CODE END 3 */
}
/* USER CODE BEGIN 4 */
/* process function */
uint8_t MX_PDM2PCM_Process(uint16_t *PDMBuf, uint16_t *PCMBuf)
{
/*
uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t * PDMBuf, uint16_t * PCMBuf)
Converts audio format from PDM to PCM.
Parameters:
PDMBuf : Pointer to PDM buffer data
PCMBuf : Pointer to PCM buffer data
Return values:
AUDIO_OK in case of success, AUDIO_ERROR otherwise
*/
/* this example return the default status AUDIO_ERROR */
return (uint8_t) 1;
}
/* USER CODE END 4 */
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/