Commit graph

1842 commits

Author SHA1 Message Date
Matthijs Kooijman
83ff964b66 [MOD] Generalize rfswitch pin handling
This defines operation modes (IDLE, RX and TX) and allows defining up to
to three pins to be controlled. For each mode a value can be specified
for each pin a table.

Compared to the previous handling, this:
 - Allows up to three pins instead of only two.
 - Gives more control over output pin values (e.g. to simply change
   polarity or support more complex control logic).

In addition, the modes are treated as opaque by the Module code,
allowing radio classes to define their own modes if needed.

Some notes regarding the implementation:
 - The number of pins is limited at three, since most boards seem to need
   only two pins and only the Nucleo STM32WL55 board needs three. If
   more pins are needed in the future, the setRfSwitchTable()
   can be overloaded to accept either a 3-element or e.g. 4-element pins
   array, to allow new and old code to work as-is.

   Note that there is a RFSWITCH_MAX_PINS constant defined, but it is
   not recommended for sketches to use this constant when defining
   a rfswitch pins array, to prevent issues when this value is ever
   increased and such an array gets extra zero elements (that will be
   interpreted as pin 0).

   Note that this is not a problem for the RfSwitchMode_t values array,
   since any extra values in there will only be used if a valid pin was
   set in the pins array.

 - The pins array is passed by reference, so the compiler complains if
   the array passed is not the expected size. Since a reference to an
   array without a length is not supported (at least not by the gcc
   7 used by the AVR core - gcc 10 for STM32 seems to accept it), the
   table array is passed as a pointer instead (but because arrays and
   pointers are reasonably interchangeable, the caller does not see the
   difference).

 - The existing setRfSwitchPins() method is still supported as before.
   Internally it creates a table with the right values and pins and
   passes those to setRfSwitchTable.

 - For easier review, this commit does not modify all calls to
   setRfSwitchState() in all radio modules yet, but has a compatibility
   wrapper to delay this change until the next commit. Similarly, the
   setRfSwitchTable() method is now defined on Module only, a wrapper
   for it will be defined in all radios that already have the
   setRfSwitchPins() wrapper in another commit.

 - To allow future radios to define any number of modes, the modes table
   does not have a fixed length, but instead is terminated by a special
   value. This is a bit fragile (if the terminator is omitted, the code
   will read past the end of the array), but rather flexible. One
   alternative to this approach would be to make setRfSwitchTable
   a template that deduces the array size from a template argument and
   then stores the size explicitly, but using templates probably reduces
   code clarity.
2023-01-09 09:46:39 +01:00
Matthijs Kooijman
90b28d7722 Remove duplicated setRfSwitchPins documentation
All radios that support RfSwitch define this method that simply forwards
to the `Module::setRfSwitchPins()` method. Previously, all these methods
duplicated the documentation as well, but this uses the doxygen \copydoc
to remove this duplication.
2023-01-09 09:46:31 +01:00
jgromes
139a68dfd4 [EXT] Added support for external radios (646) 2023-01-08 15:12:49 +01:00
jgromes
02de83f941 [PHY] Made virtual overloads non-pure 2023-01-08 15:10:48 +01:00
jgromes
27c1eb715a Removed remaining enable interrupt (#657) 2023-01-07 22:31:20 +01:00
jgromes
6666060d52 Removed unnecessary interrupt enable (#657) 2023-01-07 22:21:16 +01:00
jgromes
0cd9dd2983 [SX126x] Added note about allowed OCP range (#654) 2023-01-04 10:22:06 +01:00
jgromes
3a34594b5b [SX126x] Fixed incorrect OCP step in documentation (#654) 2023-01-03 20:20:58 +01:00
jgromes
a0884bf120 [SX128x] Added option to set custom ranging calibration (#293) 2023-01-01 18:31:03 +01:00
jgromes
088207df4c [SX1280] Only check ranging address on slave 2023-01-01 18:03:48 +01:00
jgromes
395844922c [Stream] Cleaned up transmit example 2022-12-22 18:19:54 +01:00
jgromes
8b8c6614aa Added VS code to gitignore 2022-12-22 18:18:55 +01:00
jgromes
0144faf02a [RF69] Fixed stream mode (#651) 2022-12-22 18:18:16 +01:00
jgromes
18fefc0ca9 [SX127x] Removed unnecessary volatile 2022-12-22 18:17:41 +01:00
Jan Gromeš
8d02fda5a1
Merge pull request #651 from notsleep196/master
[SX127x] Fix FSK Stream mode TX and RX
2022-12-22 17:33:26 +01:00
jgromes
607ae1035c [Pager] Fixed inversion logic (#641) 2022-12-22 16:19:10 +01:00
jgromes
81c5504260 [PHY] Added debug direct mode output 2022-12-22 16:18:50 +01:00
Mitrokhin Anton
e073da15da Fix FSK Stream mode TX and RX 2022-12-22 12:21:01 +07:00
Jan Gromeš
674f25faa4
Merge pull request #648 from matthijskooijman/sx126x-fixes
[SX126x] Fix comments & Dio2 for FSK
2022-12-21 10:37:57 +01:00
Matthijs Kooijman
dfbe6934bb [SX126x] Set DIO2 to RF switch by default for FSK too
In commit a1f94d9f ([SX126x] Set DIO2 to RF switch by default), this was
changed for LoRa modulation in begin(), but since this is really
a board-specific attribute, independent of the modulation used, there is
no reason to have a different default for FSK (so this was probably just
forgotten).
2022-12-20 23:33:02 +01:00
Matthijs Kooijman
47163f4398 [SX126x] Make begin parameter docs consistent
This:
 - Updates syncWord comments after changing it from uint16_t to uint8_t
   in commit 55aff74a ([SX126x] Changed pin mapping, added reset,
   changed LoRa sync word to 1B).
 - Adds missing useRegulatorLDO comments forgoten in commit ea85a663
   ([SX126x] Pass useRegulatorLDO to SX1262/SX1261/SX1268).
 - Makes useRegulatorLDO comments the same in all places (using the more
   explicit version).
 - Fixes a typo in the doxygen \parma -> \param command.
2022-12-20 23:33:02 +01:00
jgromes
132c2b3b82 Fixed inversion logic and inverted frame sync word (#641) 2022-12-15 17:37:41 +01:00
jgromes
c1674fba82 Added unofficial RP2040 to list of supported platforms (CI_BUILD_ALL) 2022-12-14 22:42:07 +01:00
jgromes
947ff48df6 Added support for unofficial Raspberry Pi Pico core (#643) 2022-12-14 22:37:25 +01:00
jgromes
f66a31c4f4 [CI] Removed old skip patterns 2022-12-14 22:35:02 +01:00
jgromes
60b73d5ccd [Pager] Implemented inversion for receive (#641) 2022-12-12 21:07:35 +01:00
Jan Gromeš
b57e7275fd
Merge pull request #632 from caveman99/master
SX128x: Access getIrqStatus() without Godmode
2022-12-06 07:58:24 +01:00
Thomas Göttgens
0aa59f6abc Fix coding style 2022-12-06 07:53:14 +01:00
Thomas Göttgens
08de95e15e Access getIrqStatus() without Godmode and change the flag setting like SX126x handles it. 2022-12-05 11:17:59 +01:00
jgromes
aa8330cf57 [Si443x] Added GFSK with BT 0.5 (#625) 2022-12-04 10:19:42 +01:00
Jan Gromeš
ac5f719633
Merge pull request #631 from rfquack/master
[RF69] Missing 1000.0 multipler in
2022-12-04 10:09:55 +01:00
Federico Maggi
7b4c27b702
[RF69] Missing 1000.0 multipler in 2022-12-04 00:21:22 +01:00
Jan Gromeš
e054172f7a
Merge pull request #627 from rfquack/master
[RF69/CC1101] Fixed corner case in `setPromiscuousMode(false)`
2022-12-01 18:22:37 +01:00
Jan Gromeš
73752ec88a
Merge pull request #629 from IhorNehrutsa/excludes
Fix RADIOLIB_EXCLUDE_APRS, RADIOLIB_EXCLUDE_PAGER
2022-12-01 18:20:39 +01:00
Ihor Nehrutsa
9abb3fd396 Update Pager.cpp 2022-12-01 17:47:42 +02:00
Ihor Nehrutsa
ee32b3d82a Update APRS.cpp 2022-12-01 17:47:34 +02:00
Federico Maggi
09669eeb26
[CC1101] Fix setPromiscuousMode(false) bug
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-12-01 13:32:47 +01:00
Federico Maggi
894e912252
[RF69] Fixed setPromiscuousMode(false) corner case
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-12-01 13:24:42 +01:00
jgromes
7295e9731e [Pager] Fixed default example pins 2022-11-27 20:47:18 +01:00
jgromes
f51229ef9a [Pager] Added option to invert frequencies (#7) 2022-11-27 20:47:01 +01:00
Jan Gromeš
b9a7116113
Merge pull request #623 from rfquack/master
No bound checks on frequency deviation if ~OOK
2022-11-27 18:36:29 +01:00
Federico Maggi
9422723bb7
[CC1101] Validate freq-dev unless special value 0
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-27 10:20:29 +01:00
Federico Maggi
befba28629
No bound checks on frequency deviation if ~FSK 2022-11-26 19:38:36 +01:00
Jan Gromeš
8c37da0720
Merge pull request #614 from rfquack/master
[RF69 & CC1101] Reworked cached parameters into getters
2022-11-21 16:14:05 +01:00
Federico Maggi
05217c095b
- Defined new RADIOLIB_ERR_NULL_POINTER
- all `begin()` now use macros for init values
- addressed other styling comments as per PR#612 review

Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-21 09:09:56 +01:00
Federico Maggi
1322796542
[RF69 & CC1101] Reworked cached parameters into getters
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-20 01:35:08 +01:00
jgromes
3fa34b433a Bump version to 5.5.0 2022-11-19 14:20:14 +01:00
jgromes
72ce5dfd93 Reworked macro reporting in debug mode 2022-11-19 14:19:57 +01:00
jgromes
328a3bfedc Merge branch 'master' of https://github.com/jgromes/RadioLib 2022-11-18 18:06:07 +01:00
jgromes
2f0dac1bb7 [SSTV] Added support for interrupt-based timing (#596) 2022-11-18 18:05:42 +01:00