Skip to content

Commit

Permalink
ext: Integrate Nordic's 802.15.4 radio driver into Zephyr
Browse files Browse the repository at this point in the history
This patch includes the new files in the build and refactors the
Kconfig and Kbuild files in ext/hal/nordic to acommodate for the presence of
the radio driver.

Change-Id: Ifeda1f6d51916c7096be3c09ef7db6ca59c87728
Signed-off-by: Wojciech Bober <[email protected]>
  • Loading branch information
wbober authored and jukkar committed Feb 22, 2017
1 parent 16a9a50 commit 37b3e9f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 33 deletions.
1 change: 1 addition & 0 deletions ext/hal/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj-$(CONFIG_QMSI_BUILTIN) += qmsi/
obj-$(CONFIG_HAS_STM32CUBE) += st/stm32cube/
obj-$(CONFIG_HAS_CC3200SDK) += ti/cc3200sdk/
obj-$(CONFIG_HAS_NORDIC_HAL) += nordic/
obj-$(CONFIG_HAS_NORDIC_DRIVERS) += nordic/drivers/
6 changes: 5 additions & 1 deletion ext/hal/nordic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ config HAS_NORDIC_MDK
bool

config HAS_NORDIC_HAL
bool
bool

config HAS_NORDIC_DRIVERS
bool
select HAS_NORDIC_HAL
4 changes: 4 additions & 0 deletions ext/hal/nordic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ endif
ifdef CONFIG_HAS_NORDIC_HAL
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/nordic/hal
endif

ifdef CONFIG_HAS_NORDIC_DRIVERS
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/nordic/drivers
endif
34 changes: 33 additions & 1 deletion ext/hal/nordic/drivers/Kbuild
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
obj-$(CONFIG_IEEE154_NRF5) += nrf_drv_radio802154.o
obj-$(CONFIG_IEEE802154_NRF5) += nrf_drv_radio802154.o

ifeq ($(CONFIG_IEEE802154_NRF5),y)
# A common prefix used for placing radio buffer in a named
# memory section.
KBUILD_CFLAGS += -DRADIO_SECTION_PREFIX="\".top_of_image_ram\""

# Number of slots containing short addresses of nodes for which pending data is stored.
KBUILD_CFLAGS += -DRADIO_PENDING_SHORT_ADDRESSES=1

# Number of slots containing extended addresses of nodes for which pending data is stored.
KBUILD_CFLAGS += -DRADIO_PENDING_EXTENDED_ADDRESSES=1

# Number of buffers in receive queue.
KBUILD_CFLAGS += -DRADIO_RX_BUFFERS=1

# CCA mode
ifeq ($(CONFIG_IEEE802154_NRF5_CCA_MODE_ED),y)
KBUILD_CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_ED
else ifeq ($(CONFIG_IEEE802154_NRF5_CCA_MODE_CARRIER),y)
KBUILD_CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER
else ifeq ($(IEEE802154_NRF5_CCA_MODE_CARRIER_AND_ED),y)
KBUILD_CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER_AND_ED
else ifeq ($(IEEE802154_NRF5_CCA_MODE_CARRIER_OR_ED),y)
KBUILD_CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER_OR_ED
endif

# CCA mode options
KBUILD_CFLAGS += -DRADIO_CCA_CORR_LIMIT=$(CONFIG_IEEE802154_NRF5_CCA_CORR_LIMIT)
KBUILD_CFLAGS += -DRADIO_CCA_CORR_THRESHOLD=$(CONFIG_IEEE802154_NRF5_CCA_CORR_THRESHOLD)
KBUILD_CFLAGS += -DRADIO_CCA_ED_THRESHOLD=$(CONFIG_IEEE802154_NRF5_CCA_ED_THRESHOLD)

endif
32 changes: 1 addition & 31 deletions ext/hal/nordic/drivers/Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
ifeq ($(CONFIG_IEEE154_NRF5),y)
ifeq ($(CONFIG_IEEE802154_NRF5),y)
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/nordic/drivers

# A common prefix used for placing radio buffer in a named
# memory section.
CFLAGS += -DRADIO_SECTION_PREFIX=".top_of_image_ram"

# Number of slots containing short addresses of nodes for which pending data is stored.
CFLAGS += -DRADIO_PENDING_SHORT_ADDRESSES=1

# Number of slots containing extended addresses of nodes for which pending data is stored.
CFLAGS += -DRADIO_PENDING_EXTENDED_ADDRESSES=1

# Number of buffers in receive queue.
CFLAGS += -DRADIO_RX_BUFFERS=1

# CCA mode
ifeq ($(CONFIG_IEEE154_NRF5_CCA_MODE_ED,y)
CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_ED
else ifeq ($(CONFIG_IEEE154_NRF5_CCA_MODE_CARRIER),y)
CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER
else ifeq ($(IEEE154_NRF5_CCA_MODE_CARRIER_AND_ED),y)
CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER_AND_ED
else ifeq ($(IEEE154_NRF5_CCA_MODE_CARRIER_OR_ED),y)
CFLAGS += -DRADIO_CCA_MODE=NRF_RADIO_CCA_MODE_CARRIER_OR_ED
endif

# CCA mode options
CFLAGS += -DRADIO_CCA_CORR_LIMIT=$(CONFIG_IEEE154_NRF5_CCA_CORR_LIMIT)
CFLAGS += -DRADIO_CCA_CORR_THRESHOLD=$(CONFIG_IEEE154_NRF5_CCA_CORR_THRESHOLD)
CFLAGS += -DRADIO_CCA_ED_THRESHOLD=$(CONFIG_IEEE154_NRF5_CCA_ED_THRESHOLD)

endif

0 comments on commit 37b3e9f

Please sign in to comment.