Merge pull request #4 from dekay/master

A few more register definitions and a couple minor cleanups to RFM69.cpp
This commit is contained in:
LowPowerLab 2014-01-03 14:43:36 -08:00
commit 29efaf08cf
2 changed files with 10 additions and 3 deletions

View File

@ -57,7 +57,7 @@ bool RFM69::initialize(byte freqBand, byte nodeID, byte networkID)
//* 0x39 */ { REG_NODEADRS, nodeID }, //turned off because we're not using address filtering
/* 0x3C */ { REG_FIFOTHRESH, RF_FIFOTHRESH_TXSTART_FIFONOTEMPTY | RF_FIFOTHRESH_VALUE }, //TX on FIFO not empty
/* 0x3d */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, //RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent)
/* 0x6F */ { REG_TESTDAGC, RF_DAGC_CONTINUOUS }, // run DAGC continuously in RX mode
/* 0x6F */ { REG_TESTDAGC, RF_DAGC_IMPROVED_LOWBETA0 }, // run DAGC continuously in RX mode, recommended default for AfcLowBetaOn=0
{255, 0}
};
@ -73,6 +73,10 @@ bool RFM69::initialize(byte freqBand, byte nodeID, byte networkID)
for (byte i = 0; CONFIG[i][0] != 255; i++)
writeReg(CONFIG[i][0], CONFIG[i][1]);
// Encryption is persistent between resets and can trip you up during debugging.
// Disable it during initialization so we always start from a known state.
encrypt(0);
setHighPower(_isRFM69HW); //called regardless if it's a RFM69W or RFM69HW
setMode(RF69_MODE_STANDBY);
while ((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00); // Wait for ModeReady

View File

@ -93,6 +93,7 @@
#define REG_TESTPA1 0x5A //only present on RFM69HW/SX1231H
#define REG_TESTPA2 0x5C //only present on RFM69HW/SX1231H
#define REG_TESTDAGC 0x6F
#define REG_TESTAFC 0x71
//******************************************************
// RF69/SX1231 bit control definition
@ -1046,6 +1047,8 @@
#define RF_TEMP1_ADCLOWPOWER_ON 0x01 // Default
#define RF_TEMP1_ADCLOWPOWER_OFF 0x00
// RegTestDagc 0x6F: demodulator config and IO mode config
#define RF_DAGC_CONTINUOUS 0x20 // true = DAGC updated every two bits
// RegTestDagc
#define RF_DAGC_NORMAL 0x00 // Reset value
#define RF_DAGC_IMPROVED_LOWBETA1 0x20 //
#define RF_DAGC_IMPROVED_LOWBETA0 0x30 // Recommended default