SAI_TxSetBitClockRate parameter questions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SAI_TxSetBitClockRate parameter questions

跳至解决方案
654 次查看
davenadler
Senior Contributor I

I'm trying to set up SAI (send only, as master).
But I'm confused by the SAI_TxSetBitClockRate parameters, documented as:

 

/*!
 * brief Transmitter bit clock rate configurations.
 *
 * param base SAI base pointer.
 * param sourceClockHz, bit clock source frequency.
 * param sampleRate audio data sample rate.
 * param bitWidth, audio data bitWidth.
 * param channelNumbers, audio channel numbers.
 */
void SAI_TxSetBitClockRate(
    I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers)

 

1) What is uint32_t channelNumbers?
In the code this seems to be used as numberOfChannels (ie 2 for stereo):

 

uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers;

 

2) What is uint32_t sourceClockHz?
Is this just the module's clock input, as generated by the clock tool, ie

 

#define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT              63529411UL

 

Thanks in advance,
Best Regards, Dave

 

 

0 项奖励
回复
1 解答
627 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @davenadler ,

Thanks for your interest in NXP MIMXRT series!

1) What is uint32_t channelNumbers?
In the code this seems to be used as numberOfChannels (ie 2 for stereo):

>> Yes, you are right.

2) What is uint32_t sourceClockHz?
Is this just the module's clock input, as generated by the clock tool, ie

>> Yes. It is the clock frequency of the SAI peripheral. It is used to configure the appropriate BCLK.

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
628 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @davenadler ,

Thanks for your interest in NXP MIMXRT series!

1) What is uint32_t channelNumbers?
In the code this seems to be used as numberOfChannels (ie 2 for stereo):

>> Yes, you are right.

2) What is uint32_t sourceClockHz?
Is this just the module's clock input, as generated by the clock tool, ie

>> Yes. It is the clock frequency of the SAI peripheral. It is used to configure the appropriate BCLK.

 

0 项奖励
回复