Skip to content
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

feat(DMA): implement DMA sniffing (partially) #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomods
Copy link
Contributor

@tomods tomods commented Jan 8, 2022

Implements (parts of) the RP2040 datasheet, chapter 2.5.5.2.

Currently, the code disobeys some settings in SNIFF_CTRL.
It just assumes OUT_INV = OUT_REV = SNIFF_BSWAP = 0; CALC = 0xf.
I.e., it can only do simple summation, no further checksumming.

Is the style OK? Would you be willing to merge this without the features mentioned above? I'm not really in the mood to add the other checksumming options...

Tested with a transfer size of 16 bits using the code you already know from #90 ;)
Just with the commented-out parts of RP2040ADC.py enabled. So you can easily test this in https://wokwi.com/arduino/projects/320232834674459219

Implements (parts of) the RP2040 datasheet, chapter 2.5.5.2.

Currently, the code disobeys some settings in SNIFF_CTRL.
It just assumes OUT_INV = OUT_REV = SNIFF_BSWAP = 0; CALC = 0xf.
I.e., it can only do simple summation, no further checksumming.
@urish
Copy link
Contributor

urish commented Jan 8, 2022

Thanks!

Would it be hard to support OUT_INV, OUT_REV, and SNIFF_BSWAP as well?

For the bit reversal part, we already have an implementation. You could move it to src/utils/bits.ts, sharing it between the PIO and DMA.

@tomods
Copy link
Contributor Author

tomods commented Jan 8, 2022

Nah, not hard at all. Will look into it when I have some more time

src/peripherals/dma.ts Outdated Show resolved Hide resolved
@urish
Copy link
Contributor

urish commented Feb 2, 2022

Guess you are busy nowadays?

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

Successfully merging this pull request may close these issues.

2 participants