SAI_TxSetBitClockRate parameter questions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SAI_TxSetBitClockRate parameter questions

Jump to solution
652 Views
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 Kudos
Reply
1 Solution
625 Views
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.

 

View solution in original post

0 Kudos
Reply
1 Reply
626 Views
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 Kudos
Reply