RADIO nRF24L01

Fork of nRF24L01P by Pablo Rodriguez

Files at this revision

API Documentation at this revision

Comitter:
fytanlulu
Date:
Mon Jul 04 01:41:56 2016 +0000
Parent:
0:8d55f1f49a33
Commit message:
AD5254???nRF??????????

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
diff -r 8d55f1f49a33 -r d6b43a63580a nRF24L01P.cpp
--- a/nRF24L01P.cpp	Thu Apr 21 23:14:43 2011 +0000
+++ b/nRF24L01P.cpp	Mon Jul 04 01:41:56 2016 +0000
@@ -36,7 +36,8 @@
  * Includes
  */
 #include "nRF24L01P.h"
-
+#define DEBUG
+//#define address nRF_Address
 /**
  * Defines
  *
@@ -201,7 +202,7 @@
     setRfOutputPower();
     setAirDataRate();
     setCrcWidth();
-    setTxAddress();
+    setTxAddress(0xffffffffffULL,5);
     setRxAddress();
     disableAutoAcknowledge();
     disableAutoRetransmit();
@@ -643,6 +644,9 @@
 void nRF24L01P::setTxAddress(unsigned long msb_address, unsigned long lsb_address, int width) {
 
     unsigned long long address = ( ( (unsigned long long) msb_address ) << 32 ) | ( ( (unsigned long long) lsb_address ) << 0 );
+#ifdef DEBUG
+    printf("0x%05x\n",address);
+#endif
 
     setTxAddress(address, width);
 
@@ -652,7 +656,11 @@
 void nRF24L01P::setTxAddress(unsigned long long address, int width) {
 
     int setupAw = getRegister(_NRF24L01P_REG_SETUP_AW) & ~_NRF24L01P_SETUP_AW_AW_MASK;
-
+#ifdef DEBUG
+    printf("0x%x\n",setupAw);
+#endif    
+    
+    
     switch ( width ) {
 
         case 3:
@@ -676,6 +684,10 @@
     setRegister(_NRF24L01P_REG_SETUP_AW, setupAw);
 
     int cn = (_NRF24L01P_SPI_CMD_WR_REG | (_NRF24L01P_REG_TX_ADDR & _NRF24L01P_REG_ADDRESS_MASK));
+#ifdef DEBUG
+    printf("0X%x\n",cn);
+    printf("0X%ullx\n",address);
+#endif
 
     nCS_ = 0;
 
diff -r 8d55f1f49a33 -r d6b43a63580a nRF24L01P.h
--- a/nRF24L01P.h	Thu Apr 21 23:14:43 2011 +0000
+++ b/nRF24L01P.h	Mon Jul 04 01:41:56 2016 +0000
@@ -178,7 +178,7 @@
      * Note that the address width is shared with the Receive pipes,
      *  so a change to that address width affect transmissions.
      */
-    void setTxAddress(unsigned long long address = DEFAULT_NRF24L01P_ADDRESS, int width = DEFAULT_NRF24L01P_ADDRESS_WIDTH);
+    void setTxAddress(unsigned long long address , int width );
 
     void setTxAddress(unsigned long msb_address, unsigned long lsb_address, int width);