modules: nordic: Allow separate nRF 802.15.4 radio driver build

So far, nRF 802.15.4 radio driver build was dependent on the 802.15.4
subsystem in Zephyr. While this was a reasonable approach for samples,
it prevented the radio driver from being built as a standalone entity,
which could be useful in some applications (e. g. running core nRF
802.15.4 radio driver tests with Zephyr).

Resolve this, by providing a separate set of Kconfigs for the radio
driver, therefore allowing to build it as a separate entity. The 802154
subsystem simply enables the radio driver module in this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-01-16 18:01:15 +01:00 committed by Carles Cufí
commit 7e7f05546d
4 changed files with 54 additions and 47 deletions

View file

@ -6,7 +6,7 @@
menuconfig IEEE802154_NRF5 menuconfig IEEE802154_NRF5
bool "nRF52 series IEEE 802.15.4 Driver" bool "nRF52 series IEEE 802.15.4 Driver"
depends on NETWORKING && HAS_HW_NRF_RADIO_IEEE802154 depends on NETWORKING && HAS_HW_NRF_RADIO_IEEE802154
select HAS_NORDIC_DRIVERS select NRF_802154_RADIO_DRIVER
if IEEE802154_NRF5 if IEEE802154_NRF5
@ -31,42 +31,4 @@ config IEEE802154_NRF5_INIT_PRIO
Set the initialization priority number. Do not mess with it unless Set the initialization priority number. Do not mess with it unless
you know what you are doing. you know what you are doing.
choice IEEE802154_NRF5_CCA_MODE
prompt "nRF52 IEEE 802.15.4 CCA mode"
default IEEE802154_NRF5_CCA_MODE_ED
help
CCA mode
config IEEE802154_NRF5_CCA_MODE_ED
bool "Energy Above Threshold"
config IEEE802154_NRF5_CCA_MODE_CARRIER
bool "Carrier Seen"
config IEEE802154_NRF5_CCA_MODE_CARRIER_AND_ED
bool "Energy Above Threshold AND Carrier Seen"
config IEEE802154_NRF5_CCA_MODE_CARRIER_OR_ED
bool "Energy Above Threshold OR Carrier Seen"
endchoice
config IEEE802154_NRF5_CCA_ED_THRESHOLD
int "nRF52 IEEE 802.15.4 CCA Energy Detection threshold"
default 45
help
If energy detected in a given channel is above the value then the channel
is deemed busy. The unit is defined as per 802.15.4-2006 spec.
config IEEE802154_NRF5_CCA_CORR_THRESHOLD
int "nRF52 IEEE 802.15.4 CCA Correlator threshold"
default 45
config IEEE802154_NRF5_CCA_CORR_LIMIT
int "nRF52 IEEE 802.15.4 CCA Correlator limit"
default 2
help
Limit for occurrences above correlator threshold. When not equal to zero the
correlator based signal detect is enabled.
endif endif

View file

@ -3,6 +3,58 @@
config HAS_NORDIC_DRIVERS config HAS_NORDIC_DRIVERS
bool bool
default y if HAS_HW_NRF_RADIO_IEEE802154
menu "Nordic drivers"
depends on HAS_NORDIC_DRIVERS
menuconfig NRF_802154_RADIO_DRIVER
bool "Enable nRF IEEE 802.15.4 radio driver"
depends on HAS_HW_NRF_RADIO_IEEE802154
if NRF_802154_RADIO_DRIVER
choice NRF_802154_CCA_MODE
prompt "nRF IEEE 802.15.4 CCA mode"
default NRF_802154_CCA_MODE_ED
help
CCA mode
config NRF_802154_CCA_MODE_ED
bool "Energy Above Threshold"
config NRF_802154_CCA_MODE_CARRIER
bool "Carrier Seen"
config NRF_802154_CCA_MODE_CARRIER_AND_ED
bool "Energy Above Threshold AND Carrier Seen"
config NRF_802154_CCA_MODE_CARRIER_OR_ED
bool "Energy Above Threshold OR Carrier Seen"
endchoice
config NRF_802154_CCA_ED_THRESHOLD
int "nRF IEEE 802.15.4 CCA Energy Detection threshold"
default 45
help
If energy detected in a given channel is above the value then the
channel is deemed busy. The unit is defined as per 802.15.4-2006 spec.
config NRF_802154_CCA_CORR_THRESHOLD
int "nRF IEEE 802.15.4 CCA Correlator threshold"
default 45
config NRF_802154_CCA_CORR_LIMIT
int "nRF IEEE 802.15.4 CCA Correlator limit"
default 2
help
Limit for occurrences above correlator threshold. When not equal to
zero the correlator based signal detect is enabled.
endif # NRF_802154_RADIO_DRIVER
endmenu
config HAS_NRFX config HAS_NRFX
bool bool

View file

@ -428,13 +428,6 @@ CONFIG_NET_DEBUG_L2_IEEE802154_DISPLAY_PACKET_TX=y
#CONFIG_SOC_SERIES_NRF52X=y #CONFIG_SOC_SERIES_NRF52X=y
#CONFIG_HAS_NORDIC_DRIVERS=y #CONFIG_HAS_NORDIC_DRIVERS=y
#CONFIG_IEEE802154_NRF5_CCA_CORR_LIMIT=1
#CONFIG_IEEE802154_NRF5_CCA_CORR_THRESHOLD=1
#CONFIG_IEEE802154_NRF5_CCA_ED_THRESHOLD=2
#CONFIG_IEEE802154_NRF5_CCA_MODE_CARRIER_AND_ED=y
#CONFIG_IEEE802154_NRF5_CCA_MODE_CARRIER_OR_ED=y
#CONFIG_IEEE802154_NRF5_CCA_MODE_CARRIER=y
#CONFIG_IEEE802154_NRF5_CCA_MODE_ED=y
#CONFIG_IEEE802154_NRF5_DRV_NAME="NRF5" #CONFIG_IEEE802154_NRF5_DRV_NAME="NRF5"
#CONFIG_IEEE802154_NRF5_INIT_PRIO=90 #CONFIG_IEEE802154_NRF5_INIT_PRIO=90
#CONFIG_IEEE802154_NRF5=n #CONFIG_IEEE802154_NRF5=n

View file

@ -47,7 +47,7 @@ manifest:
revision: a12d92816a53a521d79cefcf5c38b9dc8a4fed6e revision: a12d92816a53a521d79cefcf5c38b9dc8a4fed6e
path: modules/hal/cypress path: modules/hal/cypress
- name: hal_nordic - name: hal_nordic
revision: a1f24a4ee9774fe96390f2c6473b490c88b01ef6 revision: 72a785c1f3c25bc98cb5eb90914d19718b6ae4ee
path: modules/hal/nordic path: modules/hal/nordic
- name: hal_openisa - name: hal_openisa
revision: 9bfbe35aad79fdf552dbdae47a894e26be7c022c revision: 9bfbe35aad79fdf552dbdae47a894e26be7c022c