SAI_TxSetBitClockRate parameter questions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SAI_TxSetBitClockRate parameter questions

ソリューションへジャンプ
686件の閲覧回数
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 解決策
659件の閲覧回数
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 返信
660件の閲覧回数
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 件の賞賛
返信