DMA Library?

johnnyfp

Well-known member
I think I remember seeing mention a DMA Library in the works for the Teensy 3.1. Is that still on track for a release?
 
Yeah thanks. That what I needed. I'm sure my next question will be along in a bit about how to get it working with a mid sampling SPI type bus aka a tlc5947 protocol communicator. But for now, I will start experimenting :)
 
How to release() a channel temporarily

Already done, but so far the only documentation is comments in the header.

https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.h

Hi Paul

thanks for this great lib!

Any particular reason, why release() is not public?

If I understand the code correctly it already handles everything fine for repeated begin() and release() pairs; with channel == 16 signaling the "released" state.

My code/circuit uses up many DMA channels so I would like to create a "pause()" function where I can temporarily release the DMA channels for allocation by other tasks. Then reacquire them later. I see the destructor calls release() but I'm trying to avoid the heap.

However I've seen the operator overloads and I suspect you had another scheme in mind to allocate and reallocate DMA channels. How?

Thanks a lot,
--Markk
 
The idea was the object owns a physical DMA channel for as long as it exists. So in that scheme, you'd need to use the heap to acquire and release DMA channels.
 
How many channels will you need simultaneously? You can create your own DMA channel management on top which owns the channel in terms of the DMA channel library.
 
The way this was intended to work involves multiple DMASettings objects, where you can share the DMAChannel object by its direct name or by pointer or by c++ reference. Just assign the DMASettings to the shared DMAChannel object to make it do your bidding. It's up to you to somehow arbitrate among whatever uses are sharing the DMAChannel, so each user doesn't try to assign its own DMASettings while the channel is actively moving data or awaiting triggers.
 
It's up to you to somehow arbitrate among whatever uses are sharing the DMAChannel, so each user doesn't try to assign its own DMASettings while the channel is actively moving data or awaiting triggers.

Good to know, thank you. Will wrap my head around it ;-)

_Markk
 
Back
Top