From adee2713044462990e752e429044b3963758bc68 Mon Sep 17 00:00:00 2001 From: Felix Rusu Date: Tue, 20 Jul 2021 13:58:25 -0400 Subject: [PATCH] add set300KBPS() --- RFM69.cpp | 15 +++++++++++++++ RFM69.h | 1 + 2 files changed, 16 insertions(+) diff --git a/RFM69.cpp b/RFM69.cpp index 418f7e1..26c3a1d 100644 --- a/RFM69.cpp +++ b/RFM69.cpp @@ -888,6 +888,21 @@ void RFM69::rcCalibration() while ((readReg(REG_OSC1) & RF_OSC1_RCCAL_DONE) == 0x00); } +//=================================================================================================================== +// radio300KBPS() - switch radio to max bitrate +//=================================================================================================================== +void RFM69::set300KBPS() { + writeReg(0x03, 0x00); //REG_BITRATEMSB: 300kbps (0x006B, see DS p20) + writeReg(0x04, 0x6B); //REG_BITRATELSB: 300kbps (0x006B, see DS p20) + writeReg(0x19, 0x40); //REG_RXBW: 500kHz + writeReg(0x1A, 0x80); //REG_AFCBW: 500kHz + writeReg(0x05, 0x13); //REG_FDEVMSB: 300khz (0x1333) + writeReg(0x06, 0x33); //REG_FDEVLSB: 300khz (0x1333) + writeReg(0x29, 240); //set REG_RSSITHRESH to -120dBm + writeReg(0x37, 0b10010000); //DC=WHITENING, CRCAUTOOFF=0 + // ** DC: 00 none, 01 manchester, 10, whitening +} + // ListenMode sleep/timer - see ListenModeSleep example for proper usage! void RFM69::listenModeSleep(uint16_t millisInterval) { diff --git a/RFM69.h b/RFM69.h index 3e6d50d..711a5c0 100644 --- a/RFM69.h +++ b/RFM69.h @@ -224,6 +224,7 @@ class RFM69 { void sleep(); uint8_t readTemperature(uint8_t calFactor=0); // get CMOS temperature (8bit) void rcCalibration(); // calibrate the internal RC oscillator for use in wide temperature variations - see datasheet section [4.3.5. RC Timer Accuracy] + void set300KBPS(); // allow hacking registers by making these public uint8_t readReg(uint8_t addr);