Commit graph

95 commits

Author SHA1 Message Date
jgromes
bcd8a05cd4 [SX128x] Added interface for interrupt-driven CAD (#1085) 2024-05-05 12:42:03 +01:00
StevenCellist
1b2b8bd67b
[LoRaWAN] Improve PHY behaviour, update beginABP, bugfixes (#1080)
* [LoRaWAN] Add getter for ToA, prevent MAC queue overflow

* [LoRaWAN] Permute arguments to beginABP

* Implement & split off checkOutputPower

* [LoRaWAN] Configure physical layer on each up/downlink

* [LoRaWAN] Remove unnecessary dynamic array

* [LoRaWAN] Improve downlink handling

* Resolve return-warnings in checkOutputPower()

* [LoRaWAN] Improve buffer definition

* [LoRaWAN] Prevent requesting repeated MAC commands

* Update keywords.txt

* [CC1101] Resolve unused variable warning

* [CC1101] Update checkOutputPower

* [SX1278] Fix variable assignment

* Update keywords.txt

* [CC1101] Added checkOutputPower override for PHY compatibility

* [LR11x0] Added checkOutputPower override for PHY compatibility

* [SX127x] Added checkOutputPower override for PHY compatibility

---------

Co-authored-by: jgromes <jan.gromes@gmail.com>
2024-05-01 13:35:22 +02:00
Elizabeth Myers
205031550b
Use RadioLibTime_t (aka unsigned long) when dealing with millis() and micros() (#1075)
* Use unsigned long when dealing with millis() and micros().

Although sizeof(uint32_t) == sizeof(unsigned long) on Arduino, this is
not the case on 64-bit Linux, where sizeof(unsigned long) ==
sizeof(uint64_t).

Most timestamp arithmetic and comparisons have been left alone, to
reduce code churn. This is fine, as uint32_t is perfectly wide to store
most timestamp deltas this library will deal with, and C will promote
the integer rather than do a narrowing conversion. The real problem
arises with narrowing conversions being done by assuming timestamps are
32-bit.

No functional changes intended for platforms where sizeof(uint32_t) ==
sizeof(unsigned long) (so most 8/16/32-bit platforms).

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

* Change most timestamps to use RadioLibTime_t.

This makes it obvious what is and isn't a timestamp.

Not everything has been converted; anything dealing with protocol and
chip-level timestamps has been left alone on purpose, to make it clear
that these functions do require 32-bit timestamps.

No functional changes intended on platforms where sizeof(uint32_t) ==
sizeof(unsigned long).

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

* Use uint32_t internally in getTimeOnAir.

We need to not overflow the integers with the shifts and
multiplications, so this is correct behaviour.

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>

---------

Signed-off-by: Elizabeth Myers <elizabeth.jennifer.myers@gmail.com>
2024-04-25 21:50:58 +02:00
jgromes
c9d8c601df [Mod] Use enum for bit widths 2024-04-07 17:34:31 +01:00
Jan Gromeš
4fa0656ddd
[MOD] SPI configuration interface rework (#1057)
* [MOD] Rework SPI config interface

* [CC1101] Rework SPI config interface

* [nRF24] Rework SPI config interface

* [SX126x] Rework SPI config interface

* [SX128x] Rework SPI config interface

* Fix missing moved debug info

* [MOD] Fix signed warnings
2024-04-07 17:05:07 +02:00
jgromes
8098bea254 [SX128x] Use millis for timeouts 2024-03-29 08:35:29 +01:00
jgromes
4ee17cc168 Debugging rework 2024-03-10 11:07:23 +01:00
jgromes
948088c1e1 [SX128x] Moved setHeaderType to private methods 2024-01-12 19:49:17 +01:00
jgromes
b5d931ec79 [SX128x] Cleanup private/protected members 2024-01-12 19:45:41 +01:00
S5NC
14a2238ca6
Update SX128x.h 2023-11-30 12:18:13 +00:00
jgromes
827aac5938 [SX128x] Reworked macro configuration system 2023-11-27 21:15:07 +01:00
chemary
ddcce424c8
Incorrectly checking sx1280 command status (#843) 2023-10-11 07:20:11 +02:00
jgromes
d1e3691c32 Added notes about getPacketLength (#214) 2023-07-15 19:40:07 +02:00
jgromes
8fd0a67a78 Typo fixes 2023-07-15 19:13:16 +02:00
jgromes
3359907fa5 [SX128x] Fixed getStatus (#779) 2023-06-27 17:35:50 +02:00
jgromes
36530b00fc [SX128x] Fixed blocking receive 2023-06-24 19:23:26 +02:00
jgromes
1f6acc8347 [SX128x] Implemented generic IRQ actions 2023-06-21 22:23:43 +02:00
jgromes
1597e8d754 [SX128x] Fixed default parameters 2023-05-28 22:32:06 +02:00
jgromes
f936d53639 [SX128x] Added default startReceive method 2023-05-28 22:19:03 +02:00
jgromes
c93d6eff65 [SX128x] Fixed long prints 2023-05-21 18:26:16 +02:00
jgromes
efbec6b9d1 Added custom min/max/abs macros 2023-05-16 17:13:43 +01:00
jgromes
c451765602 [SX128x] Added force wakeup to standby 2023-05-02 21:04:49 +02:00
jgromes
84ebdddcaf [SX128x] Wakeup device on standby() call 2023-05-02 18:58:59 +02:00
jgromes
7f4ff61504 [SX128x] Fixed unused variable 2023-04-29 22:51:44 +02:00
jgromes
76c654c0c1 [SX128x] General reformatting 2023-04-23 22:05:18 +02:00
Jan Gromeš
b76b819b12
Merge pull request #730 from Mesteery/new-hal
Improve hardware abstraction layer
2023-04-22 16:26:31 +02:00
jgromes
21f2ef6836 [SX128x] Fixed IQ inversion 2023-04-17 19:12:42 +02:00
Mestery
9a68a3c901 use uint32 instead of uint8 for pin type 2023-04-16 21:39:00 +02:00
Mestery
ec3d4eaf20 Improve hardware abstraction layer 2023-04-12 23:16:18 +02:00
Mestery
220b4dad7f
use printf in both build 2023-04-10 09:13:58 +00:00
jgromes
9d3a2bb72f [SX128x] Added IQ inversion (#724) 2023-04-08 21:45:15 +02:00
jgromes
45c5859338 [SX128x] Fixed packet length in implicit mode (#716) 2023-03-31 22:02:58 +02:00
jgromes
ee7c1e7604 [SX128x] Added PHY startReceive (#700) 2023-03-26 22:20:19 +02:00
Davide Lasagna
b7e12f5c71 fix for #705 2023-03-21 19:56:21 +00:00
GUVWAF
edc8877adb [SX128x] Add irqFlags and irqMask to startReceive 2023-02-26 13:34:22 +01:00
jgromes
60bd3d6440 [SX128x] Use Module stream read/write 2023-02-19 17:07:00 +01:00
jgromes
7d286e32bc [SX128x] Use Module SPI stream 2023-02-19 16:23:08 +01:00
Matthijs Kooijman
52ec165643 Update radios to use new setRfSwitchState
This removes the compatibility wrapper and applies the following
replacements:

    sed -i 's/setRfSwitchState(LOW, LOW)/setRfSwitchState(Module::MODE_IDLE)/' src/modules/*/*.cpp
    sed -i 's/setRfSwitchState(HIGH, LOW)/setRfSwitchState(Module::MODE_RX)/' src/modules/*/*.cpp
    sed -i 's/setRfSwitchState(LOW, HIGH)/setRfSwitchState(Module::MODE_TX)/' src/modules/*/*.cpp
2023-01-09 10:26:28 +01:00
Matthijs Kooijman
3779faf600 Add setRfSwitchTable() wrapper methods
This gives all radios that use an rfswitch (i.e. have
a setRfSwitchPins() wrapper already) a wrapper method for
setRfSwitchTable() too. This wrapper just calls the same method on
Module, to make it easier for sketches to use it.
2023-01-09 10:26:27 +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
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
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
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
4667c26448 [SX128x] Removed slowdown macro (#158) 2022-11-13 22:12:34 +01:00
jgromes
fc3a85abf9 [SX128x] Added post-transaction error checking 2022-10-01 22:54:36 +02:00
jgromes
e5fe82f334 [SX128x] Fixed setBitRate compatibility with PhysicalLayer 2022-10-01 15:16:01 +02:00
jgromes
0b5cd51828 [SX128x] Added finishTransmit 2022-09-18 16:15:07 +02:00
jgromes
da0993a6ed Added RADIOLIB_EXCLUDE_DIRECT_RECEIVE exclusion macro (#557) 2022-08-15 19:19:59 +02:00