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
  • I understand double buffer is necessary but why the driver must have every block data to be fixed size? If I wrote the driver I would return actual filled data length and the remain size of data from data_handler to the driver. The driver should stop automatically when finished last data. I also would like a status check function for main context to check whether the all data finished.

Reply
  • I understand double buffer is necessary but why the driver must have every block data to be fixed size? If I wrote the driver I would return actual filled data length and the remain size of data from data_handler to the driver. The driver should stop automatically when finished last data. I also would like a status check function for main context to check whether the all data finished.

Children
No Data
Related