Code Monkey home page Code Monkey logo

rp2040-dma's Introduction

Note: As of December 2023, I would recommend anyone wanting to make use of the RP2040 DMA controller using MicroPython to update to v1.22.0 (or later). The rp2.DMA class is now part of the release and achieves a lot of the functionality that the library in this repository was written for.

For historical interest, however...

RP2040 DMA

Micropython library for the RP2040 DMA controller.

To run the examples, copy the 'dma.py' file onto the RP2040 device first.

Examples

Ex01_DMASimpleArrayCopy.py - Just copies bytes from one array to another using DMA.

Ex02_DMAtoPIOtoLED.py - Creates a simple PIO to shift bits from the PIO FIFO to the onboard LED (pico board - pin 25). DMA is used to copy data from a bytearray to the PIO output buffer at a rate determined by the PIO clock.

Ex03_DMAUsingChainTo.py - Same PIO as Ex02 but uses two DMA controllers with separate buffers configured using the chain_to field to work in 'ping-pong' mode. Each DMA controller automatically triggers the other at the end of its buffer to enable continuous transmission.

Ex04_DMAtoPIOtoI2S.py - Uses the ping-pong configuration from Ex03 to stream a 1 kHz sine wave test tone audio to a PIO I2S output.

Ex05_ADCandI2S.py - Uses an MCP3202 ADC to input an audio stream and outputs as an I2S stream. Viper-compliant signal processing code can be added to the processBuffer() function.

Ex05a_ADCandI2S.py - Same as Ex05_ADCandI2S.py but the I2S format is a non-standard variant in terms of the alignment of the LR clock.

rp2040-dma's People

Contributors

drtimcollins avatar josverl avatar

Stargazers

Paweł Wodnicki avatar  avatar  avatar  avatar  avatar AcDing avatar audioman avatar

Watchers

audioman avatar  avatar

rp2040-dma's Issues

Add a license

Thank you very much for making this little helper, it saved me a lot of time and makes the DMA interface more accessible.

However it would be nice to have a (preferably free/open/libre/whatever) license associated with this repository to give people the possibility to use this in their own projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.