pico-sdk
pico-sdk copied to clipboard
Add API access to DMA SNIFF_CTRL bits OUT_INV and OUT_REV
This came up in the discussion of raspberrypi/pico-feedback#247. AFAICT there is no API in the SDK for accessing these two bits in DMA's SNIFF_CTRL register, so they have to be set by hand in dma_hw.
It turns out that by using them, it is possible for the sniffer to generate a CRC32 value that matches the value returned by zlib's crc32() function, making it possible to automate data integrity checks after transferring data from a Pico to a host. So a convenience function in the SDK would be valuable.
How that was done is spelled out in the pico-feedback issue, and in a thread on the Pico/General forum:
https://forums.raspberrypi.com/viewtopic.php?t=336582