Nrf24 on raspberry piabout 1 minute read
NRF24, Raspberry PI & event handling, part 2
After some discussion with @mvidner, I went the easy way and did not use threads, as only one pin needs to be polled.
The process of getting these 'user space IRQs' working boils down to:
connecting the nRF's pin 8 to a free gpioX pin on the raspberry pi. I used GPIO7 (pin 4 on the BCM). The GPIO pin numbering can be pretty confusing, by the way.
Echoing "falling" into
The code does this via helpers in gpio.c.
Whenever an IRQ is triggered, the card writes into it's STATUS register info about the event and its origin. The library reads it and updates a radio 'status' struct accordingly. User callback can check this struct and can act based on that, so there's no need to fiddle with the low level stuff. Afterwards, the status is reset.
I still have to get batteries and boxes for all the nodes, but otherwise, it looks like this project is almost finished. The sketch for reporting the node data is here. Together with the libnrf24 library and the picasso framework, they should form a complete solution.
So now onto the Arduino roguelike thing, yay!