espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.34k stars 7.21k forks source link

SPI Master additional transaction flag to disable DMA temporaly. (IDFGH-7018) #8636

Open Maksons opened 2 years ago

Maksons commented 2 years ago

Problem related: When SPI host initialized with DMA channel it apply limitations (problem) for transactions:

Solution: Implementing additional transaction flag like "SPI_TRANS_DONT_DMA" which will forse ignoring of SPI bus dma_enabled flag and will perform non dma transaction.

I do small modification to SPI master driver and SPI hal to check and it works for me, but maybe I miss something or thre is other existing options ?? Should I place PullRequest with mentioned changes or ?

I use SPI Master for J-Tag where are mixed random length transactions like 1,3,15 bits which do not work with DMA and long transactions for 1kbyte where only DMA transaction could be used. There is same need for display driver where control transaction is 9 bits or 18 bits and color transfers are long and are n*16bit long. And some driver need FULL_DUPLEX transaction mixing with long transactions.

Would like to hear comments.

ginkgm commented 2 years ago

This idea is interesting. TBH I haven't tried to use both modes alternately, so there may be hidden risks...

Will need some time to have more complete test