Commit graph

135 commits

Author SHA1 Message Date
Oliver
61a4cae935
Method SetBitrateTolerance added for CC1101, Updated error handling (#1152)
* Update TypeDef.h

* Update CC1101.h

* Update CC1101.cpp

* Update CC1101.cpp

Update of error handling
2024-07-08 22:37:09 +02:00
Jack Hance
a8b6c38488
[CC1101] Fix getRSSI data source (#1121)
* [CC1101] Fix getRSSI data source

* [CC1101] Fix packet mode not resetting directModeEnabled bool
2024-06-12 17:46:10 +02:00
jgromes
45d3aac0d9 [CC1101] Fixed signed comparison warning 2024-05-26 08:55:38 +02:00
jgromes
214a566d9a [CC1101] Make frequency range check bounds inclusive 2024-05-26 08:43:02 +02:00
jgromes
e52fe99f03 [CC1101] Rework power check to not use constexpr 2024-05-20 19:56:47 +02:00
jgromes
2a776f4c09 [CC1101] Use 32-bit IRQ flags 2024-05-08 14:52:15 +02: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
ecfc18c35d [CC1101] Fix RSSI readout (#1077) 2024-04-25 20:03:06 +02: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
936a39ad98 [CC1101] Use millis for timeouts 2024-03-29 08:34:35 +01:00
Crsarmv7l
1fb5100413
[CC1101] 3 New CC1101 Functions (#1038)
* getFrequency implementation

* getFrequency Method

* Get bitrate method

* getBitRate

* CalcRxBandwidth() method

* CalcRxBandwidth();

* Fix Notes

* Changes for pull

* Changes for pull 2

* Update keywords.txt

* Revert to hopefully bring in current

* Fix ()

* Re add
2024-03-28 18:44:10 +01:00
jgromes
0ed586a840 [CC1101] Fixup tabs 2024-03-26 07:26:16 +01:00
Crsarmv7l
b3ed84a035
[CC1101] PQT = 0 in setPromiscuous (#1033)
* PQT = 0 in setPromiscuous

* Carriersense in promiscuous

* carriersense to promiscuous

* Fix explanation
2024-03-26 07:24:02 +01:00
jgromes
4ee17cc168 Debugging rework 2024-03-10 11:07:23 +01:00
Paul Lietar
ab41bcac00 [CC1101] Correctly wait for packet end on blocking receive.
When using a blocking receive, I was getting non-sensical packet length
and garbage data, whereas IRQ mode was working fine. This was happening
despite what looked like a workaround for this in the code which would
read the length twice.

I tracked it down to the receive function trying to read the data too
early, before the packet had even been received. The receive function
would wait for the GDO0 pin to become low, then assume the packet was
ready and read off the data.

However, the GD0 pin is set by the `startReceive` as inverted and,
according to the datasheet, in a mode which "asserts when sync word has
been received, and de-asserts at the end of the packet". In other words,
taking into account the inversion, GDO0 becomes low at the start of the
packet and high at the end of it.

Therefore the receive function would actually try to read the packet
data as soon as the packet had started, rather than wait until the end,
explaining the garbage data.

I suspect that with a slow MCU and a fast transmission rate, the
previous workaround of reading the length field twice may have delayed
the data read just enough to allow the packet to be fully received, but
this does not work in the general case.

This commit updates the logic by first waiting for a low signal,
followed by a high one. This is actually the exact same logic used in
the blocking transmit implementation, but inverted to account for the
INV flag set on GDO0. The commit also removes the past workaround, since
it should not be necessary anymore.
2024-01-13 17:18:23 +00:00
jgromes
30961964c5 [CC1101] Cleanup private/protected members 2024-01-12 20:35:10 +01:00
jgromes
6bac59ce08 [CC1101] Fixed direct transmit (#911) 2023-12-22 15:04:19 +01:00
jgromes
0c436e5ed8 [CC1101] Reworked macro configuration system 2023-11-27 19:39:24 +01:00
jgromes
455c3c8dd0 [CC1101] Fixed crash in blocking receive (#839) 2023-11-18 15:11:10 +01:00
jgromes
6247cb7e85 [CC1101] Fixed garbage data (#733) 2023-08-02 22:08:52 +02:00
jgromes
a01b02fae2 [MOD] Rework for buffered SPI (#776) 2023-06-26 19:36:45 +02:00
jgromes
a21fb9f136 [CC1101] Fixed direction from HAL 2023-06-21 22:13:44 +02:00
jgromes
8567c77641 [CC1101] Implemented generic actions 2023-06-21 22:07:24 +02:00
jgromes
efbec6b9d1 Added custom min/max/abs macros 2023-05-16 17:13:43 +01:00
jgromes
3df9cb27ff [CC1101] Fixed non-Hal functions 2023-04-30 11:26:53 +02:00
jgromes
bda6e220b6 [CC1101] Fixed variable shadowing 2023-04-23 22:03:12 +02:00
jgromes
c62bb74f9d [CC1101] Fixed shadowed variable name 2023-04-23 19:40:56 +02:00
jgromes
cab358ff09 [CC1101] Fixed axtra brace 2023-04-23 09:57:50 +02:00
jgromes
5c6628b6eb [CC1101] General reformatting 2023-04-23 09:47:42 +02:00
Mestery
f20cc978a7 update interrupt action mode type 2023-04-16 21:45:39 +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
Mestery
67e4dd4815
fix delayMicroseconds 2023-04-10 09:13:58 +00:00
Mestery
2a45f71384
fix undef digitalread 2023-04-10 09:13:57 +00:00
jgromes
cdbb827091 [CC1101] Removed references to Arduino SPI callbacks (#725) 2023-04-10 09:06:08 +02:00
jgromes
87c1d04b42 [CC1101] Added PHY startReceive (#700) 2023-03-26 22:17:55 +02:00
jgromes
482b962f79 [CC1101] Added missing standby overload 2023-03-12 15:03:16 +01:00
jgromes
5b96340332 [CC1101] Fixed setPromiscuousMode(true) always failing 2023-01-14 23:20:27 +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
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
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
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
6eeee45968 [CC1101] Use GDO2 for transmit interrupt (#357) 2022-10-09 19:21:39 +02:00
jgromes
ae64ec1911 [CC1101] Fixed incorrect GPIO NC check logic 2022-10-09 19:14:07 +02:00
jgromes
9dff4e709e [CC1101] Added finishTransmit 2022-09-18 16:12:03 +02:00