Added carrier detect and auto-ack disable, and an example to use it

This commit is contained in:
maniacbug
2011-05-25 22:22:21 -07:00
parent f3369a552c
commit bee284f9c5
9 changed files with 955 additions and 1 deletions

View File

@@ -331,7 +331,7 @@ void RF24::startListening(void)
ce(HIGH);
// wait for the radio to come up (130us actually only needed)
delay(1);
delayMicroseconds(130);
}
/******************************************************************/
@@ -591,5 +591,22 @@ boolean RF24::isAckPayloadAvailable(void)
return result;
}
/******************************************************************/
void RF24::setAutoAck(bool enable)
{
if ( enable )
write_register(EN_AA, B111111);
else
write_register(EN_AA, 0);
}
/******************************************************************/
boolean RF24::testCarrier(void)
{
return ( read_register(CD) & 1 );
}
// vim:ai:cin:sts=2 sw=2 ft=cpp