Timer triggered SPI read with circular DMA

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: Timer triggered SPI read with circular DMA

Post by faisal »

Giovanni wrote:Consistency is always a good thing, reworking things not necessarily as good, especially if one is trying to close a release.

Giovanni


Understood, and agreed. Any idea on a time frame for release :) ?

Giovanni wrote:The stream will be enabled by the spiXXX() transfer call, what you can do is to change (or disable) the TX DMA trigger by changing the dmatx field of the SPIDriver structure, you can make the DMA be triggered by a timer instead of SPI or you may write the SPI DR register in the PWM callback.


I don't understand how they can be disabled, as a call is made to the DMA configuration macros which dereference the dmatx and dmarx pointers - so there is nothing safe to set them to. If you add a check for NULL, you can ignore the calls to the dma configuration macros. That would work and be the most flexible. How about that?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Timer triggered SPI read with circular DMA

Post by Giovanni »

Sorry, I meant the "txdmamode" field, there you can change the DMA trigger channel to a timer channel (or nothing and then do direct writes the the SPI DR register).

Giovanni
Post Reply