nRF24L01 driver
Dependents: Nucleo_IOT1 wireless
Diff: nRF24L01P.cpp
- Revision:
- 4:8f612189af31
- Parent:
- 3:39e8335cce5d
- Child:
- 6:952996e3abdb
--- a/nRF24L01P.cpp Fri Sep 02 15:51:22 2016 +0000 +++ b/nRF24L01P.cpp Sat Sep 03 12:24:04 2016 +0000 @@ -274,6 +274,15 @@ void nRF24L01P::set_retransmit_delay(int Delay) { + char c = this->read_register(NRF24L01P_SETUP_RETR); + this->write_register(NRF24L01P_SETUP_RETR, (c & 0x0f) | ((Delay & 0x0f) << 4)); +} + +void +nRF24L01P::set_retransmit_attempts(int Attempts) +{ + char c = this->read_register(NRF24L01P_SETUP_RETR); + this->write_register(NRF24L01P_SETUP_RETR, (c & 0xf0) | (Attempts & 0x0f)); } bool