RADIO nRF24L01

Fork of nRF24L01P by Pablo Rodriguez

Revision:
1:d6b43a63580a
Parent:
0:8d55f1f49a33
--- 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;