support for auto ACK and retransmissions added
Dependents: JNP3_IOT_6_RADIO_ECHO_FIXED nRF24L01P_NET_GW nRF24L01P_NET_SENSOR Kubus ... more
Fork of nRF24L01P by
Diff: nRF24L01P.cpp
- Revision:
- 2:3012f09dfcc2
- Parent:
- 1:781a7eef8610
- Child:
- 3:3f6bf32d36c2
- Child:
- 4:d1c0020f1c87
diff -r 781a7eef8610 -r 3012f09dfcc2 nRF24L01P.cpp --- a/nRF24L01P.cpp Tue Nov 15 15:47:58 2016 +0000 +++ b/nRF24L01P.cpp Wed Jan 04 10:58:27 2017 +0000 @@ -190,8 +190,22 @@ wait_us(_NRF24L01P_TIMING_Tundef2pd_us); // Wait for Power-on reset setRegister(_NRF24L01P_REG_CONFIG, 0); // Power Down + + // Wait until the nRF24L01+ powers down + wait_us( _NRF24L01P_TIMING_Tpd2stby_us ); // This *may* not be necessary (no timing is shown in the Datasheet), but just to be safe setRegister(_NRF24L01P_REG_STATUS, _NRF24L01P_STATUS_MAX_RT|_NRF24L01P_STATUS_TX_DS|_NRF24L01P_STATUS_RX_DR); // Clear any pending interrupts + + //flush FIFO + nCS_ = 0; + spi_.write(_NRF24L01P_SPI_CMD_FLUSH_TX); + nCS_ = 1; + wait_us( _NRF24L01P_TIMING_Tpece2csn_us ); + nCS_ = 0; + spi_.write(_NRF24L01P_SPI_CMD_FLUSH_RX); + nCS_ = 1; + wait_us( _NRF24L01P_TIMING_Tpece2csn_us ); + // // Setup default configuration