Timer triggered SPI read with circular DMA

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

Re: Timer triggered SPI read with circular DMA

Postby faisal » Fri Jan 12, 2018 5:10 pm

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: 11019
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 354 times
Been thanked: 298 times
Contact:

Re: Timer triggered SPI read with circular DMA

Postby Giovanni » Fri Jan 12, 2018 5:18 pm

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


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 1 guest