2017-07-26 12:58 AM
Hi Communities,
can any body please explain me, how works exactly the function HAL_SAI_Transmit_DMA(). I am using STM32F746VGTX.
This is one example:
uint8_t TestArray[4] = {0x00,0xff,0x00,0x00};
HAL_SAI_Transmit_DMA(hsai, TestArray, 1);
my configuration of Sai for the transmitter:
hsai_BlockA1.Instance = SAI1_Block_A;
hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX;hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS;hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE;hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_FULL;hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_8K;hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE;hsai_BlockA1.Init.MonoStereoMode = SAI_STEREOMODE;hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING;hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED;if (HAL_SAI_InitProtocol(&hsai_BlockA1, SAI_PCM_LONG, SAI_PROTOCOL_DATASIZE_16BIT, 2) != HAL_OK){Thank you for your help!
#sai-hal_sai_transmit_dma2017-08-01 09:09 AM
Hi
Tran.Hung.005
,In master TX mode, enabling the audio block immediately generates the bit clock for the external slaves even if there is no data in the FIFO, However FS signal generation is conditioned by the presence of data in the FIFO.
After the FIFO receives the first data to transmit, this data is output to external slaves.
In case no data to transmit in the FIFO, 0 values are then sent in the audio frame with an underrun flag generation.
You may refer to the reference manual
in sectionSerial audio interface (SAI)Best Regards
Imen