你好。
我试图通过SAI输出24khz单声道pcm数据到wm8994编解码器。 16khz mono似乎工作正常,但默认情况下ST不支持24。我对codec和sai init的支持做了一些改动。现在我想知道还有什么需要改变。
作为基线,我让时钟配置器使用与48khz(44 vs 48 khz域)相同的时钟路径。来自sai透视图的插槽号和立体声模式也在SAI init中处理:
if(channels == 1){
haudio_out_sai.Init.MonoStereoMode = SAI_MONOMODE;
haudio_out_sai.Slo
tinit.SlotNumber = 2;
} else {
haudio_out_sai.Init.MonoStereoMode = SAI_STEREOMODE;
haudio_out_sai.SlotInit.SlotNumber = 4;
在wm8994.c中 - > init函数我根据cirrius wm8994规范(v.4.5)将24khz选择添加到输出路径。
案例AUDIO_FREQUENCY_24K:
/ * AIF1采样率= 24.000(KHz),比率= 256 * /
counter + = CODEC_IO_Write(DeviceAddr,0x210,0x0053);
break; CubeMX不提供将SAI配置为24khz模式的选项。是否有一些限制或者这只是被遗漏了?在启用24Khz模式时还有其他我应该考虑的事项吗?
#
STM32f769i迪斯科-AUDIO-WM8994
以上来自于谷歌翻译
以下为原文
Hi.
I'm trying to output 24khz mono pcm data over SAI to wm8994 codec. 16khz mono seems to work OK, but 24 is not supported by ST by default. I've made some changes for the support to codec and sai init. Now I wonder what else needs to be changed.
As baseline I've let the clock configurators use same clock paths as 48khz (44 vs 48 khz domains). Slot number and stereo mode from sai perspective is also handled in SAI init:
if (channels == 1) {
haudio_out_sai.Init.MonoStereoMode = SAI_MONOMODE;
haudio_out_sai.SlotInit.SlotNumber = 2;
}else {
haudio_out_sai.Init.MonoStereoMode = SAI_STEREOMODE;
haudio_out_sai.SlotInit.SlotNumber = 4;
}in wm8994.c -> init function I added 24khz selection to output path according to cirrius wm8994 spec (v.4.5).
case AUDIO_FREQUENCY_24K:
/* AIF1 Sample Rate = 24.000 (KHz), ratio=256 */
counter += CODEC_IO_Write(DeviceAddr, 0x210, 0x0053);
break;CubeMX doesn't give the option to configure the SAI into 24khz mode. Is there some limitation or is this just left out? is there any other things I should consider when enabling the 24Khz mode?
#stm32f769i-disco-audio-wm8994