This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I know I2S transfer finished using SDK's I2S driver

When using SDK v13's I2S driver, the data to send is filled via data_handler callback. How do I fill last block data? Assume i2s buffer size is 2000, then every 1000 words sent I have to prepare the next new block data. But what if last block was not just 1000 words, which may actually be 300 bytes. For this case what should I do? should I still fill the rest 700 words?

And more, after I filled last block data in data_handler callback, when do I stop I2S? I filled last block data but I don't know when it finished and when to stop I2S.

Please help.

Parents
  • Thanks very much Jorgen. However, your solution looks too complex for me, I have no confidence to make it work.

    Hi endnode, thank you very much too! Your method looks most feasible for me. I already did like this. The bad things is that I don't know the actual time that the I2S transfer finished. To safely stop I2S, I have to fill silence data for one more block and wait for data_handler called. thus I need fill the remaining 700 words of last block and additional 1 more block with silence data. Is that correct?

    I have to say, this driver is not well designed compared to STM32's HAL driver, which is far more easier to use...I had spend two days on this, I just want to send a simple sound to the audio DAC via I2S.

Reply
  • Thanks very much Jorgen. However, your solution looks too complex for me, I have no confidence to make it work.

    Hi endnode, thank you very much too! Your method looks most feasible for me. I already did like this. The bad things is that I don't know the actual time that the I2S transfer finished. To safely stop I2S, I have to fill silence data for one more block and wait for data_handler called. thus I need fill the remaining 700 words of last block and additional 1 more block with silence data. Is that correct?

    I have to say, this driver is not well designed compared to STM32's HAL driver, which is far more easier to use...I had spend two days on this, I just want to send a simple sound to the audio DAC via I2S.

Children
No Data
Related