GrumpyOldPizza wrote:victor_pv wrote:Thanks, I have been having a look at both the Arduino and your implementation. Are you using the STM drivers for the lowest level? or you wrote your own?
I'll see if this coming week I have some time to read how the i2s peripheral works in the F1 and start writing.
I'll have to ask you some things about the DMA callback functions, but I will when I get to start working on that.
On a side note, I think a similar way of managing the callback should work for the SPI DMA transfers in the F1 core, currently we block instead of using callbacks.
Own driver layer. See https://github.com/GrumpyOldPizza/ardui ... 4xx/Source
The STM32L4 core does use DMA callbacks like this for SPI as well. Actually exposed via the SPI class interface:
Code: Select all
bool SPIClass::transfer(const void *txBuffer, void *rxBuffer, size_t count, void(*callback)(void));
Difference is that there is a per call callback, so you can thread throu a sequence of callbacks. For I2S you really just need a "refill" callback.
OK, I have started writing the i2s library for the F1. I read the SAMD version and yours. At first I was going to use the doublebuffer library from the SAMD, to take all that out of the library code, but at the end I decided to use yours as a base, and keep that part. Do you mind that if I reuse your code for managing the buffers, pointers to the buffers etc?
All the stuff managing the peripheral, setting up the DMA, etc, is all different, but managing the double buffers is what's copied from yours, including the variable names.
BTW, I am impressed with your core. I don't know how much time and effort you put on it, and how experienced you are, but looks like you put quite some thought to it, I wish I was even close...