hideakitai / ESP32DMASPI

SPI library for ESP32 which use DMA buffer to send/receive transactions
MIT License
170 stars 36 forks source link

is master write blocking until all buffer sent? #3

Closed mark-hahn closed 3 years ago

mark-hahn commented 3 years ago

Is master write blocking until all buffer sent? Isn't the point of dma to be able to use it in background while doing other things?

hideakitai commented 3 years ago

@mark-hahn Hi, you can use non-blocking send by queue()

mark-hahn commented 3 years ago

Thanks -- I missed that.

On Wed, Jun 2, 2021 at 7:09 PM Hideaki Tai @.***> wrote:

@mark-hahn https://github.com/mark-hahn Hi, you can use non-blocking send by queue()

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hideakitai/ESP32DMASPI/issues/3#issuecomment-853505516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGGDP5VRJQNSSYOBTWDEQ3TQ3P7PANCNFSM457SUFZA .

hideakitai commented 3 years ago

Maybe I should improve README and examples.

brahma-dev commented 2 years ago

@hideakitai It seems like queue() only works if I yield() at some point. I am very new to this so probably doing something wrong.

hideakitai commented 2 years ago

@brahma-dev @mark-hahn Ah, sorry for that. You should wait until the transaction ends when using transfer() or queue() + yield(). No API can complete transactions asynchronously (in the background).

See the official API reference for more details. https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/spi_master.html#api-reference-spi-master