New P variant feature support with corresponding defines. RF_DR is now broken into two bits to support P variant and is now obsolete. RF_DR is now RF_DR_HIGH and RF_DR_LOW; with RF_DR_HIGH corresponding to the original RF_DR bit. Data rate can now select 250kbs mode on supporting hardware.

Its now possible to both get and set the current PA level. LNA is obsolete in P variant.

CD is obsoleted in P variant. Can now check both CD and RDP levels. Will follow through in the future to determine if there is any real difference. Aside from dBm floor and slight changes in internal behavior, they appear identical in interface and function.

Fixes a bug in openReadingPipe which was excluding the 5th pipline. We have 6-pipelines, 0-5, so excluding the 5th (<5) would only allow for four active pipelines.
This commit is contained in:
Greg Copeland
2011-06-21 10:26:16 -05:00
parent 26c45e85a9
commit 1a37c1cd0f
3 changed files with 131 additions and 11 deletions

34
RF24.h
View File

@@ -11,7 +11,8 @@
#include <inttypes.h>
typedef enum { RF24_1MBPS = 0, RF24_2MBPS } rf24_datarate_e;
typedef enum { RF24_PA_MIN = 0,RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX, RF24_PA_ERROR } rf24_pa_dbm_e ;
typedef enum { RF24_1MBPS = 0, RF24_2MBPS, RF24_250KBPS } rf24_datarate_e;
typedef enum { RF24_CRC_8 = 0, RF24_CRC_16 } rf24_crclength_e;
/**
@@ -423,10 +424,39 @@ public:
*/
boolean testCarrier(void);
/**
* Test whether a signal (carrier or otherwise) greater than
* or equal to -64dBm is present on the channel. Valid only
* on nRF24L01P (+) hardware. On nRF24L01, use testCarrier().
*
* Useful to check for interference on the current channel and
* channel hopping strategies.
*
* @return true if signal => -64dBm, false if not
*/
boolean testRPD(void);
/**
* Set Power Amplifier (PA) level to one of four levels.
* Relative mnemonics have been used to allow for future PA level
* changes. According to 6.5 of the nRF24L01+ specification sheet,
* they translate to: RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm,
* RF24_PA_MED=-6dBM, and RF24_PA_HIGH=0dBm.
*
* @param Desired PA level.
*/
void setPALevel( rf24_pa_dbm_e level ) ;
/**
* Fetches the current PA level. See setPALevel for
* return value definitions.
*/
rf24_pa_dbm_e getPALevel( void ) ;
/**
* Set the transmission data rate
*
* @param speed RF24_1MBPS for 1Mbps or RF24_2MBPS for 2Mbps
* @param speed RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
*/
void setDataRate(rf24_datarate_e speed);