代码如下:
#include "sph0644.h"
#include "pdm_filter.h"
#define INTERNEL_BUFF_SIZE 64
#define PCM_OUT_SIZE 16
PDMFilter_InitStruct Filter;
u16 PDM_Output_Buffer[PCM_OUT_SIZE];
u16 *pAudioRecBuf;
u16 InternalBuffer[INTERNEL_BUFF_SIZE];
u16 InternalBufferSize = 0;
static void Sph0644_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_AHB1PeriphClockCmd(SPI_SCK_GPIO_CLK|SPI_MOSI_GPIO_CLK, ENABLE);//ʹÄÜÍâÉèGPIOB,GPIOCʱÖÓ
GPIO_InitStructure.GPIO_Pin = SPI_SCK_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//¸´Óù¦ÄÜ
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍì
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ</