Open tomods opened 2 years ago
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.
Nah, not hard at all. Will look into it when I have some more time
Guess you are busy nowadays?
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 https://github.com/wokwi/rp2040js/pull/90 ;) Just with the commented-out parts of RP2040ADC.py enabled. So you can easily test this in https://wokwi.com/arduino/projects/320232834674459219