Commit graph

1238 commits

Author SHA1 Message Date
jgromes
87c1d04b42 [CC1101] Added PHY startReceive (#700) 2023-03-26 22:17:55 +02:00
G4lile0
04e24ab9d1 [SX1278] New getInstRSSI to get current RSSI 2023-03-24 20:30:06 +01:00
jgromes
9dae818033 [SX126x] Explicitly enabled CRC (#706) 2023-03-23 19:07:04 +01:00
jgromes
c3de8b9099 [SX127x] Explicitly enabled CRC (#706) 2023-03-23 19:06:43 +01:00
jgromes
48d49aabba Merge branch 'master' of https://github.com/jgromes/RadioLib 2023-03-22 22:13:32 +01:00
jgromes
8bbcc908f5 [SX126x] Fixed frequency error calculation (#706) 2023-03-22 22:12:28 +01:00
Davide Lasagna
b7e12f5c71 fix for #705 2023-03-21 19:56:21 +00:00
jgromes
cd4575ebb0 [SX126x] Fixed chip id (#707) 2023-03-21 18:18:17 +01:00
jgromes
dc2eb523a9 [SX126x] Cleanup whitespaces 2023-03-20 21:59:07 +01:00
jgromes
cfe6128656 [SX126x] Added frequency error reading 2023-03-18 10:56:00 +01:00
jgromes
482b962f79 [CC1101] Added missing standby overload 2023-03-12 15:03:16 +01:00
jgromes
a4df77b76e [Si443x] Added missing standby overload 2023-03-12 15:02:23 +01:00
jgromes
874886b4cd [RF69] Added missing standby overload 2023-03-12 15:02:08 +01:00
jgromes
45826fb00d [nRF24] Added missing standby overload 2023-03-12 15:01:50 +01:00
jgromes
8ace6350cf [SX127x] Added missing standby for PhysicalLayer (#695) 2023-03-12 14:50:14 +01:00
jgromes
00bb31cb2e [SX126x] Added patch binary license 2023-03-11 22:52:14 +01:00
jgromes
0818230a7c [SX126x] Fixed incorrect variable names 2023-03-11 20:57:32 +01:00
jgromes
97ab0d357a [SX126x] Added spectral scan 2023-03-11 20:09:03 +01:00
jgromes
ed4fc84a70 [SX126x] Fixed calibration order (#689) (CI_BUILD_ALL) 2023-03-05 19:30:20 +01:00
jgromes
823c0ff82c [SX126x] Added missing XTAL check 2023-03-05 19:28:21 +01:00
jgromes
5ba6f41230 [MOD] Convert end of RF switch mode to macro (https://github.com/jgromes/RadioLib/actions/runs/4337180408) 2023-03-05 19:16:37 +01:00
jgromes
8392cea011 [SX126x] Added more LBT/scan registers (CI_FORCE_UNCRUST) 2023-03-05 18:08:14 +01:00
jgromes
007d9ac2cb [SX126x] Set SX1262 to accept SX1261 device string (#683) 2023-03-05 16:42:48 +01:00
jgromes
7a8cadc639 [SX126x] Added more verbose calibration result check (#689) 2023-03-05 16:40:45 +01:00
jgromes
721962cacd [SX126x] Fixed bug in getDeviceErrors 2023-03-05 16:39:50 +01:00
jgromes
8bf15941c7 [SX126x] Added option to control XTAL/TCXO via member variable 2023-03-05 16:38:28 +01:00
GUVWAF
edc8877adb [SX128x] Add irqFlags and irqMask to startReceive 2023-02-26 13:34:22 +01:00
GUVWAF
f59bf4750c [SX126x] Add irqFlags and irqMask parameters to receive methods 2023-02-26 13:33:30 +01:00
jgromes
00998b5185 [MOD] Fixed incorrect default TCXO voltage 2023-02-25 13:47:54 +01:00
jgromes
3596f0f55b [SX126x] Removed WIP FHSS method 2023-02-25 13:25:16 +01:00
jgromes
bd258380c8 [SX126x] Implemeted device type string check 2023-02-25 13:16:21 +01:00
jgromes
547a522826 [SX126x] Added undocumented registers 2023-02-25 13:14:11 +01:00
jgromes
02d6062f09 [SX126x] Fixed forgotten SPI write command 2023-02-19 17:11:36 +01:00
jgromes
60bd3d6440 [SX128x] Use Module stream read/write 2023-02-19 17:07:00 +01:00
jgromes
95083e32b1 [SX126x] Use module stream read/write 2023-02-19 17:02:51 +01:00
jgromes
7d286e32bc [SX128x] Use Module SPI stream 2023-02-19 16:23:08 +01:00
jgromes
299e5de3c4 [SX126x] Use Module SPI tream 2023-02-19 16:16:16 +01:00
jgromes
dc050df8d9 [SX126x] Added support for AFSK transmission 2023-02-11 14:11:44 +01:00
Matthijs Kooijman
4c712c1f2c [MOD] Remove constexpr usage
This was introduced when STM32WL support was added. Using constexpr for
the END_OF_MODE_TABLE constant allows it to be initialized in the class
declaration, but this needs C++11. This moves the initialization out of
the class declaration to the .cpp file, which does not need constexpr.
It also lets STM32WLx::END_OF_MODE_TABLE define its value directly
(instead of aliasing Module::END_OF_MODE_TABLE) to prevent reduce
runtime overhead (see below).

The downside of this change is that the value of the END_OF_MODE_TABLE
is no longer visible in other compilation units and thus cannot be
inlined into the rfswitch_table (if used).

For example, on STM32, this means that instead of having a pre-cooked
rfswitch_table that lives in the .rodata section (so can be read
directly from flash), the table lives in RAM and is initialized at
runtime (the actual modes and pins are copied from flash to RAM by the
standard startup loop that copies all of the .data section, and the
END_OF_MODE_TABLE value is copied by a bit of new generated code). This
means a little more runtime overhead, but the cost is mostly in RAM size
(80 bytes for the SMT32WL sketches, 16 per mode plus 16 for the
END_OF_MODE_TABLE).

In a first attempt at this commit, STM32WLx::END_OF_MODE_TABLE was still
initialized using the Module::END_OF_MODE_TABLE value, but since the
latter is also not available at compiletime, this meant initialization
of the former also needed to happen at runtime, adding even more code
overhead (and possibly leading to ordering issues as well). To avoid
this, the STM32WLx::END_OF_MODE_TABLE initialization now just duplicates
that of Module::END_OF_MODE_TABLE.

On AVR, the impact is not so much: Since AVR cannot address flash
directly, the table was already copied from flash to RAM at startup, so
the extra RAM usage is just 4 bytes because END_OF_MODE_TABLE is now
also present in RAM, to be copied into rfswitch_table at startup.

Options for avoiding this overhead (not implemented in this commit)
could be (in no particular order):

1. Use a macro instead of a constant. Downside is that these cannot be
   scoped inside the Module/STM32WLx classes like now, so this requires
   changes to sketches that use a rfswitch_table (and reduced scoping
   and using macros adds more opportunity for conflicts and weird
   errors).
2. Apply the change in this commit only when C++11 is not available.
   Downside is that the initialization value of these constants must be
   duplicated in the .h and .cpp file for C++ and older versions
   respectively.
3. Let sketches just use `{Module::MODE_END_OF_TABLE, {}}` explicitly
   instead of `Module::END_OF_MODE_TABLE`. Downside of this is that this
   requires sketches to be modified and that it lets the sketch encode
   more of the table structure, potentially making future API changes
   harder (but it probably does not really matter in practice).
4. Turn END_OF_MODE_TABLE into a static method, which *can* then be
   defined in the class declaration and inlined. The method can then be
   conditionally marked as constexpr, which allows C++11 compilers to
   completely resolve the rfswitch_table value at compiletime, producing
   a binary identical to before this commit. When constexpr is omitted
   (e.g. on older compilers), some runtime overhead is added (pretty
   much the same as the result from this commit).  Downside is that
   sketches must be modified, and the `END_OF_MODE_TABLE` "constant"
   must now be called, e.g.  `END_OF_MODE_TABLE()` which might be a bit
   unexpected syntax.
2023-02-03 12:42:49 +01:00
Andrew Moroz
5f3fb5fa0d sx126x-rx-gain-persist: add ability to persist Rx gain setting when calling SX126x::setRxBoostedGainMode 2023-01-28 18:09:39 -05:00
jgromes
18ff62890a [SX127x] Fixed packet length not proagating correctly (#666) 2023-01-18 22:00:26 +01:00
jgromes
91d42ebf0e [SX127x] Set minimum bit rate to 0.5 kbps (#665) 2023-01-18 18:58:52 +01:00
jgromes
0a0f6979dd [RF69] Set minimum bit rate to 0.5 kbps 2023-01-18 18:58:26 +01:00
Andrew Moroz
35ed685c8a andrew-moroz/sx126x-rx-boosted-gain: Add method to support SX126x Rx Boosted Gain mode 2023-01-16 16:37:14 -05:00
jgromes
5b96340332 [CC1101] Fixed setPromiscuousMode(true) always failing 2023-01-14 23:20:27 +01:00
Matthijs Kooijman
3e2810cfbb [STM32WLx] Make reading IRQ flag more reliable
Now that clearIrqStatus also clears the pending flag, reading the IRQ
flag no longer has to, making this more reliable.
2023-01-10 18:09:55 +01:00
Matthijs Kooijman
cd138dd6c7 [STM32WLx] Apply PA clamp workaround for HP only
This modifies SX1262::begin and beginFSK to call setOutputPower after
applying the workaround, so that can undo the workaround if needed.
2023-01-10 18:09:55 +01:00
Matthijs Kooijman
9252cf53d3 [STM32WLx] Implement setDio1Action / interrupts
Because this interrupt is not connected to a GPIO or even the EXTI unit,
but directly to the MCU NVIC, the regular attachInterrupt flow cannot be
used.

Instead, this lets STM32WLx override the setDio1Action() and
clearDio1Action() methods to register the radio IRQ directly. Note that
it would have been nicer to implement this by overriding attachInterrupt
in STM32WLx_Module, but that is never called for virtual pins (because
the STM32Duino digitalPinToInterrupt() macro does not work for virtual
pins).

In addition, because the NVIC is level-sensitive and the code expects
edge-sensitive interrupts (for GPIO, the EXTI module in front of the
NVIC makes the interrupts edge-sensitive), this adds some additional
handling around the user-registered interrupt callback. To prevent the
ISR from triggering over and over again (and also to not require SPI
transactions in the ISR to clear the IRQ flags inside the radio), the
interrupt is disabled in the NVIC whenever it is trigered. Then,
whenever the IRQ flags *are* cleared in the radio, the IRQ is enabled in
the NVIC again. This requires making the SX126x::clearIrqStatus() method
virtual so STM32WLx can override it.
2023-01-10 18:09:55 +01:00
Matthijs Kooijman
5e47d94418 [STM32WLx] Add module for STM32WL MCUs with integrated radio (#588)
This is a nearly complete implementation, except that the Dio1 interrupt
is not yet supported (this will be added in a subsequent commit to
simplify review).

This fixes #588.
2023-01-10 18:09:55 +01:00
Matthijs Kooijman
da6c3f6a6b [SX126x] Allow subclasses to change the TX mode used
This prepares for adding a STM32WLx subclass later.
2023-01-09 10:26:28 +01:00