add set300KBPS()

This commit is contained in:
Felix Rusu 2021-07-20 13:58:25 -04:00
parent b7ee0b32b0
commit adee271304
2 changed files with 16 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);