earlephilhower / arduino-pico

Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
GNU Lesser General Public License v2.1
1.96k stars 406 forks source link

Add RP2040.memcpyDMA for DMA-managed memory copies #2324

Closed earlephilhower closed 1 month ago

earlephilhower commented 1 month ago

RP2040::memcpyDMA implements a DMA-controlled memory copy call identical in function to standard memcpy, but using an onboard DMA engine. For large memory transfers this can be significantly faster than using the CPU-based memcpy. Only 4-byte aligned source, destination, and counts are allowed. If any inputs are not 4-byte aligned, then standard memcpy will occur so it will behave correctly for any inputs.