The driver API now distinguishes between operational UP/DOWN states as
required by Zephyr's network API and receiver on/off states as an
internal driver state for improved standard conformance.
This change closes the gap between the driver API requirements and the
implementation in this respect.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Replaces the mutex by a semaphore for ISR readiness as requested by the
driver API specification.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Restructuring and renaming of driver-internal functions for improved
readability and maintainability:
- distinguish between externally exposed API methods
(cc13xx_cc26xx_sub_* prefix) and internal helper methods
(drv_* prefix).
- extract a few functions to reduce complexity and improve re-use
Also removes unnecessary initial runtime blanking of static (.bss) data
in the newly introduced extracted buffer initialization functions.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Based on the 'Technical Reference Manual' for CC13x2/CC26x2 SimpleLink
MCU family, the device contains factory pre-programmed 64-bit IEEE MAC
address for 802.15.4 radio inside two FCFG 32-bit registers:
1. MAC_15_4_0: first 32-bit of the 64-bit IEEE MAC address
2. MAC_15_4_1: last 32-bit of the 64-bit IEEE MAC address
The way current version of the driver setups the address results in
incorrect bytes order (the address is reversed):
uart:~$ ieee802154 get_ext_addr
Extended address: AF:03:B7:25:00:4B:12:00
This fixes the problem in both drivers (also in the Sub-GHz version)
which results in use of proper EUI-64 address:
uart:~$ ieee802154 get_ext_addr
Extended address: 00:12:4B:00:25:B7:03:AF
IEEE MAC address was confirmed with UniFlash, nRF Sniffer for 802.15.4
and IEEE OUI database (00:12:4B is one of registered OUI for Texas
Instruments).
To prevent confusion in future, short notice about bytes order for
'mac' field in driver's data structures was also included.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
The CMD_CLEAR_RX and CMD_SET_TX_POWER commands are declared and
initialized but not used anywhere. They are therefore removed to reduce
RAM/flash footprint.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The CC13xx/CC26xx Sub-GHz driver header file defined several constants
that were not used in the driver.
Other constants could be replaced with generic constants which were
introduced in the prior commit.
This change removes and/or replaces redundant definitions.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The RSSI value in net_pkt (net_pkt_cb_ieee802154.rssi) was used
inconsistently across drivers. Some drivers did cast a signed dBm value
directly to net_pkt's unsigned byte value. Others were assigning the
negative value of the signed dBm value and again others were offsetting
and stretching the signed dBm value linearly onto the full unsigned byte
range.
This change standardizes net_pkt's rssi attribute to represent RSSI on
the RX path as an unsigned integer ranging from 0 (–174 dBm) to 254 (80
dBm) and lets 255 represent an "unknown RSSI" (IEEE 802.15.4-2020,
section 6.16.2.8). On the TX path the rssi attribute will always be
zero. Out-of-range values will be truncated to max/min values.
The change also introduces conversion functions to and from signed dBm
values and introduces these consistently to all existing call sites. The
"unknown RSSI" value is represented as INT16_MIN in this case.
In some cases drivers had to be changed to calculate dBm values from
internal hardware specific representations.
The conversion functions are fully covered by unit tests.
Fixes: #58494
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Enhance IEEE802154 Sub-GHz driver to support CC13x2P's internal power
amplifier (20dBm) for TX.
Note: requires board-specific antenna switching for it to work
properly.
Signed-off-by: Stancu Florin <niflostancu@gmail.com>
This change applies the newly introduced consistent MTU definition to
all IEEE 802.15.4 radio drivers.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This change adds IEEE802154_RAW_MODE support for the
cc1352r.
This allows using the cc1352r 2.4 GHz radio and Sub Ghz
radio as a transceiver (PHY) instead of using L2 networking.
Signed-off-by: Erik Larson <erik@statropy.com>
This change adds IEEE 802.15.4g (Sub GHz) support for the
cc1352r.
The 2.4 GHz radio and the Sub GHz radio are capable of
operating simultaneously.
Fixes#26315
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>