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