你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

dfsdm 麦克风录音

[复制链接]
lei67 提问时间:2021-11-7 22:16 / 未解决

在使用dfsdm单个麦克风录音出现录音重复(同一个数据包会出现两次,丢掉的数据报就是那个重复的。),可以使用一个麦克风吗,帮忙看下配置是不是正确。

//回调函数如下

void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef hdfsdm_filter)

  • { uint16_t i=0; for(i = 0; i > 8), -32768, 32767); f_write(file,(uint8_t)PlayBuff,(PCM_LEN),(UINT)&bw);//写入文件 sumer=sumer+(PCM_LEN); led_toggle(LED_R); }

void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter) { uint16_t i=0; for(i = (PCM_LEN/2); i > 8), -32768, 32767);

f_write(file,(uint8_t)PlayBuff,(PCM_LEN),(UINT)&bw);//写入文件 sumer=sumer+(PCM_LEN); led_toggle(LED_B); }

//这是的DFSDM单声道设置

__HAL_DFSDM_CHANNEL_RESET_HANDLE_STATE(&DfsdmLeftChannelHandle); DfsdmLeftChannelHandle.Instance = DFSDM1_Channel1; DfsdmLeftChannelHandle.Init.OutputClock.Activation = ENABLE; DfsdmLeftChannelHandle.Init.OutputClock.Selection = DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO; DfsdmLeftChannelHandle.Init.OutputClock.Divider = 11; / 11.294MHz/11 = 1.026MHz / DfsdmLeftChannelHandle.Init.Input.Multiplexer = DFSDM_CHANNEL_EXTERNAL_INPUTS; DfsdmLeftChannelHandle.Init.Input.DataPacking = DFSDM_CHANNEL_STANDARD_MODE; / N.U. / DfsdmLeftChannelHandle.Init.Input.Pins = DFSDM_CHANNEL_SAME_CHANNEL_PINS; DfsdmLeftChannelHandle.Init.SerialInterface.Type = DFSDM_CHANNEL_SPI_RISING; DfsdmLeftChannelHandle.Init.SerialInterface.SpiClock = DFSDM_CHANNEL_SPI_CLOCK_INTERNAL; DfsdmLeftChannelHandle.Init.Awd.FilterOrder = DFSDM_CHANNEL_FASTSINC_ORDER; / N.U. / DfsdmLeftChannelHandle.Init.Awd.Oversampling = 10; / N.U. / DfsdmLeftChannelHandle.Init.Offset = 0; DfsdmLeftChannelHandle.Init.RightBitShift = 2; if(HAL_OK != HAL_DFSDM_ChannelInit(&DfsdmLeftChannelHandle)) { Error_Handler(); }

/ Initialize filter 0 (left channel) / __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(&DfsdmLeftFilterHandle); DfsdmLeftFilterHandle.Instance = DFSDM1_Filter0; DfsdmLeftFilterHandle.Init.RegularParam.Trigger = DFSDM_FILTER_SW_TRIGGER; DfsdmLeftFilterHandle.Init.RegularParam.FastMode = ENABLE; DfsdmLeftFilterHandle.Init.RegularParam.DmaMode = ENABLE; DfsdmLeftFilterHandle.Init.InjectedParam.Trigger = DFSDM_FILTER_SW_TRIGGER; / N.U. / DfsdmLeftFilterHandle.Init.InjectedParam.ScanMode = ENABLE; / N.U. / DfsdmLeftFilterHandle.Init.InjectedParam.DmaMode = DISABLE; / N.U. / DfsdmLeftFilterHandle.Init.InjectedParam.ExtTrigger = DFSDM_FILTER_EXT_TRIG_TIM1_TRGO; / N.U. / DfsdmLeftFilterHandle.Init.InjectedParam.ExtTriggerEdge = DFSDM_FILTER_EXT_TRIG_RISING_EDGE; / N.U. / DfsdmLeftFilterHandle.Init.FilterParam.SincOrder = DFSDM_FILTER_SINC3_ORDER; DfsdmLeftFilterHandle.Init.FilterParam.Oversampling = 128; / 11.294MHz/(1164) = 8KHz */ DfsdmLeftFilterHandle.Init.FilterParam.IntOversampling = 1; if(HAL_OK != HAL_DFSDM_FilterInit(&DfsdmLeftFilterHandle)) { Error_Handler(); }

收藏 评论0 发布时间:2021-11-7 22:16

举报

0个回答

所属标签

相似问题

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32Cube扩展软件包
意法半导体边缘AI套件
ST - 理想汽车豪华SUV案例
ST意法半导体智能家居案例
STM32 ARM Cortex 32位微控制器
关注我们
st-img 微信公众号
st-img 手机版