Commit graph

144 commits

Author SHA1 Message Date
jgromes
4088db2cf2 [MOD] Fix issues reported by new cppcheck 2025-01-17 20:00:26 +01:00
CrispyAlice2
680e88c739
Fix frequency issue on SX127x (#1368) (#1369)
* Fix frequency issue on SX127x (#1368)

* Add force option to SPIsetRegValue

* Fix indent
2025-01-03 19:11:29 +01:00
jgromes
29ede2c354 [MOD] Optimize SPI register writing 2024-11-10 17:43:28 +01:00
jgromes
334b5fd499 [MOD] Added flag to distinguish DIO and GPIO pins 2024-10-27 19:23:35 +00:00
Jan Gromeš
9e7c0129e6
[HAL] HALs in src (#1281)
* [HAL] Move HALs to src

* [CI] Temporarily drop unofficial STM32 (package down)

* [LR11x0] Fix ambiguous call

* [CI] Return Maple mini back to build matrix
2024-10-20 19:14:33 +02:00
jgromes
4a155b1922 [Utils] Move generally useful methods to utils 2024-10-20 14:22:23 +01:00
Jan Gromeš
00699ce225
[LR11x0] GNSS support (#1275)
* [LR11x0] Added WIP GNSS control

* [LR11x0] Added almanac update

* [LR11x0] Added almanac update example

* [LR11x0] Add missing memory deallocation

* [LR11x0] Fix underflow in delay until subframe

* [LR11x0] Remove pin mapping from example

* [LR11x0] Finish rework of the GNSS API

* [LR11x0] Added position and satellite examples

* [LR11x0] Fix result member in example

* Added LR11x0 GNSS keywords

* [LR11x0] Fix typo in macro name

* [LR11x0] Print scan failed in example

* [LR11x0] Added GNSS abort
2024-10-18 16:50:36 +02:00
jgromes
141bdd0998 [MOD] Make hexdump format match xxd 2024-08-09 21:25:39 +02:00
jgromes
f78b3ccc97 [MOD] Increase maximum number of RF switch pins to 5 2024-05-26 16:36:42 +02:00
jgromes
ffbcdd0d57 [MOD] Move SPI timeout to SPI config struct 2024-05-19 13:55:22 +02:00
jgromes
26fb617062 [MOD] Make cmd pointer const 2024-05-05 19:47:09 +01:00
jgromes
6fe581aea7 Fix minor format warnings 2024-05-03 20:54:18 +01:00
jgromes
7209690bf6 [Mod] Fixed hexdump not escaping format specifiers 2024-05-01 19:12:22 +01:00
jgromes
809025eba6 [Mod] Fix issues from cppcheck scan 2024-05-01 15:51:01 +01: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
e7da14421d [Mod] Fix SPI command byte order 2024-04-14 20:22:16 +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
Jan Gromeš
cfc425970c
[LoRaWAN] Resolve warnings, fix bugs for fixed bands (#1021)
* [LoRaWAN] Resolve warnings

* [LoRaWAN] Fixed bands: improve initial datarate, fix CFList bug

* [LoRaWAN] Improve MAC debug output formatting

* Fix hexdump debug level

* Remove unnecessary error, add new ones to keywords

* [LoRaWAN] Discard useless check

---------

Co-authored-by: StevenCellist <steven@boonstoppel.nu>
2024-03-18 16:39:55 +01:00
jgromes
4ee17cc168 Debugging rework 2024-03-10 11:07:23 +01:00
jgromes
a2e2003001 Reworked macro configuration system 2023-11-27 19:38:10 +01:00
Jonathan Bennett
f4938ea585
Check for RADIOLIB_SPI_PARANOID = 1 rather than just defined (#883)
* Update BuildOpt.h to set RADIOLIB_SPI_PARANOID to 1 by default

* Update Module.cpp to check for RADIOLIB_SPI_PARANOID set to 1
2023-11-27 18:45:18 +01:00
jgromes
392708f8b5 [MOD] Make regdump and hexdump only available in debug 2023-09-12 17:13:07 +02:00
jgromes
8c63f93820 [MOD] Skip SPI status parsing for single-byte commands 2023-08-12 18:36:12 +02:00
jgromes
bfe2c0829a [MOD] Moved debug info to runtime 2023-08-12 18:35:48 +02:00
jgromes
3e5c0d59c7 [MOD] Moved CS pin toggling inside SPI transaction block 2023-08-12 18:35:08 +02:00
Alistair Francis
e88cf386d6 Module: Get status from first byte after the command
Instead of getting the status from the very first byte in the input
buffer, which will be what we read when we send the first byte. Let's
instead get the status from the first byte after the command. This
provides a more accurate status value.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
2023-06-28 20:43:28 +10:00
Alistair Francis
445bc01450 modules: Don't read excess status data
The SX126x get status command returns a single status byte. The status
byte is automatically read in the `Module::SPItransferStream()` function
when we increment buffLen (see
https://github.com/jgromes/RadioLib/blob/master/src/Module.cpp#L259).

By setting numBytes we incorrectly end up reading 2 bytes. Instead set
numBytes to zero so we only read the single status byte.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
2023-06-27 21:29:02 +10:00
jgromes
a01b02fae2 [MOD] Rework for buffered SPI (#776) 2023-06-26 19:36:45 +02:00
Kevin Walton
f63d228d0b
Bug in waitForMicroseconds prevTimingLen in V6.0.0
In Module::waitForMicroseconds if RADIOLIB_INTERRUPT_TIMING is defined the variable prevTimingLen has been incorrectly upated in v6.0.0 introducing a bug that stops compilation.

Fix: renamed _prevTimingLen to prevTimingLen to match other updates
2023-06-01 21:51:57 +01:00
jgromes
642f1bb157 [MOD] Added missing newlines 2023-05-21 18:24:31 +02:00
jgromes
6d54ea65db [MOD] Added option to use SX126x without GPIO 2023-05-18 20:49:37 +01:00
jgromes
03d2a9bf26 [MOD] Added common reflect method 2023-05-12 20:55:51 +02:00
jgromes
2eff7a358f [MOD] Removed redundant NSS pull 2023-04-30 22:11:05 +02:00
jgromes
044b4789b2 [MOD] Decreased default SPI timeout to 1000 ms 2023-04-24 18:25:42 +02:00
jgromes
a22a4df88f [MOD] Added debug message when BUSY pin times out 2023-04-24 18:25:09 +02:00
jgromes
61f6da0cb2 [MOD] Added missing stdarg include for some platforms 2023-04-22 20:19:36 +02:00
jgromes
9749083573 [MOD] Use compact Doxygen and stop using reserved format 2023-04-22 18:50:12 +02:00
jgromes
09c3ac4f6b [HAL] Formatting cleanup, added doxygen comments 2023-04-22 18:11:00 +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
45e9fd44bb
nitpick 2023-04-12 18:44:12 +02:00
Mestery
27575b8c49
Remove RADIOLIB_DEBUG_PRINT_BIN 2023-04-12 18:43:43 +02:00
Mestery
09fc9290bb
Undefine RADIOLIB_DEBUG_PRINT_BIN macro after use 2023-04-12 16:50:05 +02:00
Mestery
17ae017f89
address changes 2023-04-10 14:51:07 +02:00
Mestery
220b4dad7f
use printf in both build 2023-04-10 09:13:58 +00:00
jgromes
390b425b39 [MOD] Fixed default Arduino callbacks for SPI (#725) 2023-04-10 11:11:17 +02:00
jgromes
f59a69f5c4 [MOD] Removed references to Arduino SPI callbacks (#725) 2023-04-10 09:06:40 +02:00
jgromes
9d36ae4bee [MOD] Fixed SPI callbacks on non-Arduino platforms (#725) 2023-04-09 22:37:36 +02:00
jgromes
0210e10a24 [MOD] Fixed swapped NSS/BUSY order (#716) 2023-03-30 23:17:34 +02:00