On a slightly different topic I have found sending a trigger and waiting for the status bit to go low is probably not the way to go.
Example:
writeReg(REG_XX, RF_ABCD); //trigger an event
while ((readReg(REG_XX) & (RF_ABCD_DONE))); //stay here while the busy bit is set
return (readReg(REG_XY); // now get the value
I have experienced cases where this doesn't work as expected. i.e. checking if the 'mode' is ready, reading the temp...
What happens is that after the trigger is sent it the next line immediately checks to see if it is busy, but the radio is slow(slower than 328p) and hasn't set the bit yet. It drops through and the reg is then read prematurely.
Using this seems to work:
writeReg(REG_XX, RF_ABCD); //trigger an event
while ((readReg(XX) & RF_READY) == 0); //wait until the radio catches up
while ((readReg(XX) & RF_READY) == 1); //stay here while it's busy
while ((readReg(XX) & RF_READY) == 0); //i'm sure it's done <<<< probly not neccessary
return (readReg(REG_XY); // now get the value
Also, I think it makes sense for your lib to block when changing modes until the 'mode ready' is valid. Just a suggestion.
john