Skip to content

RP2 DMA Class #10704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed

RP2 DMA Class #10704

wants to merge 11 commits into from

Conversation

markb139
Copy link

@markb139 markb139 commented Feb 9, 2023

Hi,
Hope I haven't caused chaos trying to create this PR.
I've written a DMA class for the RP2040 microcontroller.
The class handles 3 scenarios at present

  1. write from a buffer to a peripheral
  2. 
read to a buffer from a peripheral
  3. 
copy one buffer to another


Transfers can happen at full bus speed or be paced by a DREQ channel.

This code includes a DMA timer class for pacing transfers at a fixed rate - see example code.


The methods can be given an optional handler for callback when a transfer completes when an IRQ is raised. Which IRQ is raised defaults to IRQ0, but can be passed in with the irq parameter.

Regards

Mark

Signed-off-by: mark <mark.burton@pinpoint-software.com>
add abort.
check busy.
cleanup

Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: mark <mark.burton@pinpoint-software.com>
Signed-off-by: Mark Burton <mark.burton@pinpoint-software.com>
Signed-off-by: Mark Burton <mark.burton@pinpoint-software.com>
@samskiter
Copy link

Would be amazing to see this merged!

@markb139
Copy link
Author

markb139 commented Oct 2, 2023

Hi,
I've been away from the Micropython world and the RP2040 over the summer.
I plan to update my project that makes use of the DMA code.

Looks like I have a couple of merge conflicts to fix

Regards

@samskiter
Copy link

I've

Hi, I've been away from the Micropython world and the RP2040 over the summer. I plan to update my project that makes use of the DMA code.

Looks like I have a couple of merge conflicts to fix

Regards

Might have you sorted there... markb139#1

@samskiter
Copy link

Just to let you know there's issues with the documentation and the stubs

Josverl/micropython-stubs#727

@samskiter
Copy link

@markb139 just FYI, there's a competing PR: #7641 can you evaluate and compare?

@markb139
Copy link
Author

markb139 commented Nov 3, 2023

I'll take a look.
I'm currently Pi-less as my Pi's are doing other things and my Pi5 hasn't arrived :)

@dpgeorge
Copy link
Member

Thanks for the contribution, but I'll close this in favour of the implementation made in #7641 (which is now merged).

@dpgeorge dpgeorge closed this Dec 22, 2023
@markb139
Copy link
Author

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants