We can use the Pico DMA to copy data "in the background" while the processor is doing some other work. One PicoDMA object represents a single DMA channel which is reserved the first time it is needed. You can release it explicity after you are done with the processing.
More...
#include <PicoDMA.h>
|
| PicoDMA () |
| Default constructor.
|
|
| ~PicoDMA () |
| Destructor: releases the DMA channel if necessary - if some processing is still going on, it is aborted.
|
|
void | abort () |
| aborts the copy
|
|
int | channel () |
| provides the used DMA channel - returns -1 if no channel has been set up so far
|
|
void | clearInterrupt () |
| You need to call this method in the completion handler.
|
|
void | copy (T *dst, T *src, int len, boolean start=true) |
| Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. The copying is done in the background. More...
|
|
void | copy (T *dst, T *src, int len, void(*completion_handler)(), bool startCopy=true) |
| Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. The copying is done in the background. More...
|
|
bool | isBusy () |
| checks if the copy is still in process
|
|
bool | releaseChannel (bool abortProcessing=false) |
| Releases the DMA channel and makes it available again.
|
|
bool | set (T *dst, T src, int len, boolean start=true) |
| Sets a destination array with a fixed value We support only data of the size of uint_8, uint16_t and uint_32_t. More...
|
|
void | set (T *dst, T src, int len, void(*completion_handler)(), bool startCopy=true) |
| Sets a destination array with a fixed value. More...
|
|
void | start () |
| starts the copy
|
|
void | wait () |
| a blocking wait for the copy to complete
|
|
|
void | setupChannel () |
| Provides the next available DMA channel.
|
|
dma_channel_transfer_size | transferSize () |
|
template<class T>
class pico_arduino::PicoDMA< T >
We can use the Pico DMA to copy data "in the background" while the processor is doing some other work. One PicoDMA object represents a single DMA channel which is reserved the first time it is needed. You can release it explicity after you are done with the processing.
◆ copy() [1/2]
Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. The copying is done in the background.
- Parameters
-
dst | copy destination |
src | copy source |
len | number of entries |
start | if true the copy starts immediatly - if set to thrue you need to call start() |
- Returns
- dma channel
◆ copy() [2/2]
template<class T >
void pico_arduino::PicoDMA< T >::copy |
( |
T * |
dst, |
|
|
T * |
src, |
|
|
int |
len, |
|
|
void(*)() |
completion_handler, |
|
|
bool |
startCopy = true |
|
) |
| |
|
inline |
Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. The copying is done in the background.
- Parameters
-
to | copy destination |
from | copy source |
len | number of entries |
completion_handler | interrupt handler which is executed when the copy terminates |
- Returns
- dma channel
◆ set() [1/2]
Sets a destination array with a fixed value We support only data of the size of uint_8, uint16_t and uint_32_t.
- Parameters
-
dst | destination |
src | value |
len | length of destination array |
start | if true we start immediatly |
- Returns
- dma channel
◆ set() [2/2]
template<class T >
void pico_arduino::PicoDMA< T >::set |
( |
T * |
dst, |
|
|
T |
src, |
|
|
int |
len, |
|
|
void(*)() |
completion_handler, |
|
|
bool |
startCopy = true |
|
) |
| |
|
inline |
Sets a destination array with a fixed value.
- Parameters
-
to | copy destination array |
from | source value |
len | length of array |
completion_handler | interrupt handler which is executed when the copy terminates |
- Returns
- dma channel
The documentation for this class was generated from the following file: