almusil / rfm69

A generic rust driver to support RFM69 family wireless chips.
Apache License 2.0
9 stars 9 forks source link

Large packets #18

Closed rkreis closed 3 years ago

rkreis commented 3 years ago

It would be nice to send larger packets than the FIFO. As far as I understand, we could use RegFifoThresh and read out the FIFO while still receiving a packet. Have you already tried anything like that, @almusil? Otherwise I'll give it a try.

almusil commented 3 years ago

Hi, to be honest I haven't really needed to send/receive packets that are larger than FIFO. Anyway it might be possible to allow that by exposing the read and write publicly as was suggested in #16. That might be minimalistic approach but if you want to dive into some proper support for this lib I don't have anything against that.

rkreis commented 3 years ago

I can't see one option that's clearly the best. If you have a quick and low-latency SPI link, you can probably read the FIFO byte by byte and poll the IRQ register inbetween to see if it's (not) empty. In other cases, writing bigger blocks and using the FIFO threshold interrupt would seem more appropriate, but that's complicated because you need to choose a sensible value, and maybe only the application can do that. Once my hardware arrives, I can do some more practical testing, and maybe follow up with a PR.