rf12_sleep()
This function can put the radio module to sleep and wake it up again. In sleep mode, the radio will draw only one or two microamps of current.
This function can also be used as low-power watchdog, by putting the radio to sleep and having it raise an interrupt between about 30 milliseconds and 4 seconds later.
#include <RF12.h>
#include <Ports.h> // needed to avoid a linker error :(
#define RF12_SLEEP 0
#define RF12_WAKEUP -1
void rf12_sleep(byte value);
Parameters
value
If RF12SLEEP (0), put the radio to sleep - no scheduled wakeup. If RF12WAKEUP (-1), wake the radio up so that the next call to rf12_recvDone() can restore normal reception. If value is in the range 1 .. 127, then the radio will go to sleep and generate an interrupt approximately 32*value miliiseconds later (this "watchdog" mode does not appear to be 100% reliable, though).