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
Solved! Go to Solution.
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.
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.