Skip to content

Commit a0af38a

Browse files
tekka007fallberg
authored andcommitted
RFM69: Updates and optimizations (#1049)
* RFM69: Updates and optimizations * RFM69: Updates and optimizations
1 parent 0bc3ac9 commit a0af38a

File tree

5 files changed

+461
-821
lines changed

5 files changed

+461
-821
lines changed

MyConfig.h

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@
572572

573573
/**
574574
* @def MY_RADIO_RFM69
575-
* @brief Define this to use RFM69 based radios for sensor network communication.
575+
* @brief Define this to use %RFM69 based radios for sensor network communication.
576576
*/
577577
//#define MY_RADIO_RFM69
578578

@@ -641,15 +641,15 @@
641641

642642
/**
643643
* @def MY_RFM69_ATC_TARGET_RSSI_DBM
644-
* @brief Target RSSI level (in dBm) for RFM69 ATC mode.
644+
* @brief Target RSSI level (in dBm) for %RFM69 ATC mode.
645645
*/
646646
#ifndef MY_RFM69_ATC_TARGET_RSSI_DBM
647647
#define MY_RFM69_ATC_TARGET_RSSI_DBM (-80)
648648
#endif
649649

650650
/**
651651
* @def MY_RFM69_ATC_MODE_DISABLED
652-
* @brief Define to disable ATC mode of RFM69 driver.
652+
* @brief Define to disable ATC mode of %RFM69 driver.
653653
*/
654654
//#define MY_RFM69_ATC_MODE_DISABLED
655655

@@ -668,7 +668,7 @@
668668

669669
/**
670670
* @def MY_RFM69_NETWORKID
671-
* @brief RFM69 Network ID. Use the same for all nodes that will talk to each other.
671+
* @brief %RFM69 Network ID. Use the same for all nodes that will talk to each other.
672672
*/
673673
#ifndef MY_RFM69_NETWORKID
674674
#define MY_RFM69_NETWORKID (100)
@@ -682,6 +682,7 @@
682682

683683
#ifdef MY_RF69_RESET
684684
// legacy, older board files
685+
// not enabled now: #warning MY_RF69_RESET is depreciated, please use MY_RFM69_RST_PIN instead.
685686
#define MY_RFM69_RST_PIN MY_RF69_RESET
686687
#endif
687688

@@ -693,11 +694,12 @@
693694

694695
/**
695696
* @def MY_RFM69_IRQ_PIN
696-
* @brief Define this to use the %RFM69 IRQ pin (optional).
697+
* @brief Define this to override the default %RFM69 IRQ pin assignment.
697698
*/
698699
#ifndef MY_RFM69_IRQ_PIN
699700
#ifdef MY_RF69_IRQ_PIN
700701
// legacy, older board files
702+
// not enabled now: #warning MY_RF69_IRQ_PIN is depreciated, please use MY_RFM69_IRQ_PIN instead.
701703
#define MY_RFM69_IRQ_PIN MY_RF69_IRQ_PIN
702704
#else
703705
#define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN
@@ -711,19 +713,21 @@
711713
#ifndef MY_RFM69_IRQ_NUM
712714
#ifdef MY_RF69_IRQ_NUM
713715
// legacy, older board files
716+
// not enabled now: #warning MY_RF69_IRQ_NUM is depreciated, please use MY_RFM69_IRQ_NUM instead.
714717
#define MY_RFM69_IRQ_NUM MY_RF69_IRQ_NUM
715718
#else
716-
#define MY_RFM69_IRQ_NUM DEFAULT_RFM69_IRQ_NUM
719+
#define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
717720
#endif
718721
#endif
719722

720723
/**
721724
* @def MY_RFM69_CS_PIN
722-
* @brief RFM69 SPI chip select pin.
725+
* @brief %RFM69 SPI chip select pin.
723726
*/
724727
#ifndef MY_RFM69_CS_PIN
725728
#ifdef MY_RF69_SPI_CS
726729
// legacy, older board files
730+
// not enabled now: #warning MY_RF69_SPI_CS is depreciated, please use MY_RFM69_CS_PIN instead.
727731
#define MY_RFM69_CS_PIN MY_RF69_SPI_CS
728732
#else
729733
#define MY_RFM69_CS_PIN DEFAULT_RFM69_CS_PIN
@@ -764,29 +768,29 @@
764768
#define MY_RFM69_DEFAULT_LISTEN_IDLE_US (1*1000000ul)
765769
#endif
766770

767-
#if !defined(MY_RFM69_BITRATE_MSB) && !defined(MY_RFM69_BITRATE_LSB)
768771
/**
769-
* @def MY_RFM69_BITRATE_MSB
770-
* @brief %RFM69 bit rate (most significant bits)
772+
* @def MY_RFM69_MODEM_CONFIGURATION
773+
* @brief %RFM69 modem configuration, default is %RFM69_FSK_BR55_5_FD50
771774
*
772-
* Bitrate between the transmitter and the receiver must be better than 6.5.
773-
* Refer to RFM69registers_old.h (L.153) or RFM69registers_new.h (L.154) for settings or
774-
* http://www.semtech.com/apps/filedown/down.php?file=sx1231.pdf
775-
* @note RFM69_FOSC(Hz)/MSB_LSBVALUE = Bitrate in kbits
775+
* | Configuration | Modulation (xxx) | Bit rate | FD | RXBW | Additional settings
776+
* |-------------------------|------------------|----------|--------|----------|---------------------------
777+
* | RFM69_xxx_BR2_FD5 | FSK/GFSK/OOK | 2000 | 5000 | 111_24_4 | Whitening
778+
* | RFM69_xxx_BR2_4_FD4_8 | FSK/GFSK/OOK | 2400 | 4800 | 111_24_4 | Whitening
779+
* | RFM69_xxx_BR4_8_FD9_6 | FSK/GFSK/OOK | 4800 | 9600 | 111_24_4 | Whitening
780+
* | RFM69_xxx_BR9_6_FD19_2 | FSK/GFSK/OOK | 9600 | 19200 | 111_24_4 | Whitening
781+
* | RFM69_xxx_BR19_2_FD38_4 | FSK/GFSK/OOK | 19200 | 38400 | 111_24_3 | Whitening
782+
* | RFM69_xxx_BR38_4_FD76_8 | FSK/GFSK/OOK | 38400 | 76800 | 111_24_2 | Whitening
783+
* | RFM69_xxx_BR55_5_FD50 | FSK/GFSK/OOK | 55555 | 50000 | 111_16_2 | Whitening
784+
* | RFM69_xxx_BR57_6_FD120 | FSK/GFSK/OOK | 57600 | 120000 | 111_16_1 | Whitening
785+
* | RFM69_xxx_BR125_FD125 | FSK/GFSK/OOK | 125000 | 125000 | 010_16_2 | Whitening
786+
* | RFM69_xxx_BR250_FD250 | FSK/GFSK/OOK | 250000 | 250000 | 111_16_0 | Whitening
776787
*
777-
*/
778-
#define MY_RFM69_BITRATE_MSB (RFM69_BITRATEMSB_55555)
779-
/**
780-
* @def MY_RFM69_BITRATE_LSB
781-
* @brief %RFM69 bit rate (least significant bits)
788+
* https://www.semtech.com/uploads/documents/sx1231.pdf
782789
*
783-
* Bitrate between the transmitter and the receiver must be better than 6.5.
784-
* Refer to RFM69registers_old.h (L.153) or RFM69registers_new.h (L.154) for settings or
785-
* http://www.semtech.com/apps/filedown/down.php?file=sx1231.pdf
786-
* @note RFM69_FOSC(Hz)/MSB_LSBVALUE = Bitrate in kbits
787790
*/
788-
#define MY_RFM69_BITRATE_LSB (RFM69_BITRATELSB_55555)
789-
#endif
791+
//#define MY_RFM69_MODEM_CONFIGURATION (RFM69_FSK_BR55_5_FD50)
792+
793+
790794
/** @}*/ // End of RFM69SettingGrpPub group
791795

792796
/**
@@ -2073,6 +2077,7 @@
20732077
#define MY_IS_RFM69HW
20742078
#define MY_RFM69_NEW_DRIVER
20752079
#define MY_RFM69_POWER_PIN
2080+
#define MY_RFM69_MODEM_CONFIGURATION
20762081
#define MY_RFM69_ENABLE_ENCRYPTION
20772082
#define MY_RFM69_ATC_MODE_DISABLED
20782083
#define MY_RFM69_MAX_POWER_LEVEL_DBM

0 commit comments

Comments
 (0)