nRF24L01 driver

Dependents:   Nucleo_IOT1 wireless

Files at this revision

API Documentation at this revision

Comitter:
ianmcc
Date:
Wed Sep 14 14:43:13 2016 +0000
Parent:
5:bb28775120e7
Commit message:
bug fixes

Changed in this revision

nRF24L01P.cpp Show annotated file Show diff for this revision Revisions of this file
nRF24L01P.h Show annotated file Show diff for this revision Revisions of this file
nRF24L01P_PTX.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r bb28775120e7 -r 952996e3abdb nRF24L01P.cpp
--- a/nRF24L01P.cpp	Tue Sep 13 13:21:59 2016 +0000
+++ b/nRF24L01P.cpp	Wed Sep 14 14:43:13 2016 +0000
@@ -100,9 +100,9 @@
    else if (Rate == 1000)
       r = 0x00;
    else if (Rate == 2000)
-      r = 0x04;
+      r = 0x08;
    char c = this->read_register(NRF24L01P_RF_SETUP);
-   this->write_register(NRF24L01P_RF_SETUP, (c & 0xDB) | r);
+   this->write_register(NRF24L01P_RF_SETUP, (c & 0xD7) | r);
 }
 
 void
diff -r bb28775120e7 -r 952996e3abdb nRF24L01P.h
--- a/nRF24L01P.h	Tue Sep 13 13:21:59 2016 +0000
+++ b/nRF24L01P.h	Wed Sep 14 14:43:13 2016 +0000
@@ -54,7 +54,7 @@
       bool received_power_detector();
 
       // set the transmit power in dB.  Valid values are 0, -6, -12, -18
-      // DEFAULT: 0
+      // DEFAULT: 0dB
       void set_tx_power(int Power);
 
  
diff -r bb28775120e7 -r 952996e3abdb nRF24L01P_PTX.cpp
--- a/nRF24L01P_PTX.cpp	Tue Sep 13 13:21:59 2016 +0000
+++ b/nRF24L01P_PTX.cpp	Wed Sep 14 14:43:13 2016 +0000
@@ -117,7 +117,7 @@
    Status = STATUS_TRANSMITTING;
    CE = 1;
    wait_us(Thce_us);
-   CE = 0;
+   //CE = 0;
    // wait until the packet is transmitted (or some error)
    while (Status == STATUS_TRANSMITTING)
    {
@@ -135,7 +135,7 @@
          Device.clear_max_rt();
       }
    }
-
+   CE=0;
    if (Status == STATUS_PACKET_OK)
    {
       Status = STATUS_STANDBY;