[nrf52840] update radio driver to f36aa41 and provide temperature (#2638)

This commit is contained in:
Hubert Miś
2018-03-27 17:31:31 +01:00
committed by Jonathan Hui
parent 5a2a808329
commit 3c019a5d59
17 changed files with 1279 additions and 762 deletions
+132 -129
View File
@@ -146,6 +146,7 @@ RADIO_DRIVER_SOURCES
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/nrf_802154_revision.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control.c \
@top_builddir@/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.c \
@@ -212,135 +213,137 @@ libopenthread_nrf52840_softdevice_sdk_a_SOURCES
$(SOFTDEVICE_SOURCES) \
$(NULL)
noinst_HEADERS = \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/arm_math.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cm4.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmFunc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmInstr.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmSimd.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util_platform.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/apply_old_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nordic_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_assert.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_section.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_glue.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_log.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_errors.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_macros.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_os.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_resources.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_ack_pending_bit.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_revision.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_api.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal/nrf_radio.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/timer/nrf_802154_timer.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/nrf_raal_api.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/nrf_raal_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_errors.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_systick.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpio.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpiote.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_egu.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_nvmc.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_ppi.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_rng.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_uart.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/compiler_abstraction.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf_peripherals.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_bitfields.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_peripherals.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/system_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT.h \
$(top_srcdir)/third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT_Conf.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_err.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gap.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatt.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gattc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatts.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_hci.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_l2cap.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_ranges.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_sdm.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_soc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_nvic.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_sdm.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_soc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_svc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52/nrf_mbr.h \
noinst_HEADERS = \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/arm_math.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cm4.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmFunc.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmInstr.h \
$(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmSimd.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util_platform.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/apply_old_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nordic_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_assert.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_section.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_glue.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_log.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_errors.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_macros.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_os.h \
$(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_resources.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_ack_pending_bit.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_revision.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_api.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal/nrf_radio.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/timer/nrf_802154_timer.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/nrf_raal_api.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/nrf_raal_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.h \
$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h \
$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_common.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_errors.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_systick.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_clock.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpio.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpiote.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_egu.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_nvmc.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_ppi.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_power.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_rng.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_uart.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_usbd.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/compiler_abstraction.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf_peripherals.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_bitfields.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_peripherals.h \
$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/system_nrf52840.h \
$(top_srcdir)/third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT.h \
$(top_srcdir)/third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT_Conf.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_err.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gap.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatt.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gattc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatts.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_hci.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_l2cap.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_ranges.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_types.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_sdm.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_soc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_nvic.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_sdm.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_soc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_svc.h \
$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52/nrf_mbr.h \
$(NULL)
PRETTY_FILES = \
@@ -392,4 +392,18 @@
#define NRF_802154_ACK_TIMEOUT_ENABLED 1
#endif
/*******************************************************************************
* @section Temperature sensor driver configuration.
******************************************************************************/
/**
* @def TEMP_MEASUREMENT_INTERVAL
*
* Interval of consecutive temperature measurements [s].
*
*/
#ifndef TEMP_MEASUREMENT_INTERVAL
#define TEMP_MEASUREMENT_INTERVAL 30
#endif
#endif // PLATFORM_CONFIG_H_
@@ -179,6 +179,12 @@ void nrf5TempInit(void);
*/
void nrf5TempDeinit(void);
/**
* Function for processing temperature controller.
*
*/
void nrf5TempProcess(void);
/**
* Function for measuring internal temperature.
*
+1
View File
@@ -110,6 +110,7 @@ void PlatformProcessDrivers(otInstance *aInstance)
nrf5AlarmProcess(aInstance);
nrf5RadioProcess(aInstance);
nrf5UartProcess();
nrf5TempProcess();
}
__WEAK void PlatformEventSignalPending(void)
+56 -13
View File
@@ -34,11 +34,17 @@
#include <utils/code_utils.h>
#include "platform-nrf5.h"
#include <drivers/radio/platform/temperature/nrf_802154_temperature.h>
#if SOFTDEVICE_PRESENT
#include "softdevice.h"
#endif
#define US_PER_S 1000000ULL
static uint64_t sLastReadTimestamp;
static int32_t sTemperature;
#if !SOFTDEVICE_PRESENT
__STATIC_INLINE void dataReadyEventClear(void)
{
@@ -52,6 +58,8 @@ void nrf5TempInit(void)
{
#if !SOFTDEVICE_PRESENT
nrf_temp_init();
NRF_TEMP->TASKS_START = 1;
#endif
}
@@ -62,25 +70,60 @@ void nrf5TempDeinit(void)
#endif
}
int32_t nrf5TempGet(void)
void nrf5TempProcess(void)
{
#if SOFTDEVICE_PRESENT
int32_t temperature;
(void)sd_temp_get(&temperature);
#else
NRF_TEMP->TASKS_START = 1;
int32_t prevTemperature = sTemperature;
uint64_t now;
while (NRF_TEMP->EVENTS_DATARDY == 0)
#if SOFTDEVICE_PRESENT
now = nrf5AlarmGetCurrentTime();
if (now - sLastReadTimestamp > (TEMP_MEASUREMENT_INTERVAL * US_PER_S))
{
;
(void)sd_temp_get(&sTemperature);
sLastReadTimestamp = now;
}
#else
if (NRF_TEMP->EVENTS_DATARDY)
{
dataReadyEventClear();
sTemperature = nrf_temp_read();
}
dataReadyEventClear();
now = nrf5AlarmGetCurrentTime();
int32_t temperature = nrf_temp_read();
NRF_TEMP->TASKS_STOP = 1;
if (now - sLastReadTimestamp > (TEMP_MEASUREMENT_INTERVAL * US_PER_S))
{
NRF_TEMP->TASKS_START = 1;
sLastReadTimestamp = now;
}
#endif
return temperature;
if (prevTemperature != sTemperature)
{
nrf_802154_temperature_changed();
}
}
int32_t nrf5TempGet(void)
{
// Provide temperature value in [0.25 C] unit.
return sTemperature;
}
void nrf_802154_temperature_init(void)
{
// Intentionally empty
}
void nrf_802154_temperature_deinit(void)
{
// Intentionally empty
}
int8_t nrf_802154_temperature_get(void)
{
// Provide temperature value in [C].
return (int8_t)(sTemperature / 4);
}
+12 -35
View File
@@ -53,9 +53,11 @@
#include "nrf_802154_priority_drop.h"
#include "nrf_802154_request.h"
#include "nrf_802154_revision.h"
#include "nrf_802154_rssi.h"
#include "nrf_802154_rx_buffer.h"
#include "hal/nrf_radio.h"
#include "platform/clock/nrf_802154_clock.h"
#include "platform/temperature/nrf_802154_temperature.h"
#include "platform/timer/nrf_802154_timer.h"
#include "raal/nrf_raal_api.h"
#include "timer_scheduler/nrf_802154_timer_sched.h"
@@ -123,6 +125,11 @@ int8_t nrf_802154_tx_power_get(void)
return nrf_802154_pib_tx_power_get();
}
void nrf_802154_temperature_changed(void)
{
nrf_802154_request_cca_cfg_update();
}
void nrf_802154_pan_id_set(const uint8_t * p_pan_id)
{
nrf_802154_pib_pan_id_set(p_pan_id);
@@ -164,6 +171,7 @@ void nrf_802154_init(void)
nrf_802154_request_init();
nrf_802154_revision_init();
nrf_802154_rx_buffer_init();
nrf_802154_temperature_init();
nrf_802154_timer_init();
nrf_802154_timer_sched_init();
nrf_raal_init();
@@ -173,6 +181,7 @@ void nrf_802154_deinit(void)
{
nrf_802154_timer_sched_deinit();
nrf_802154_timer_deinit();
nrf_802154_temperature_deinit();
nrf_802154_clock_deinit();
nrf_802154_core_deinit();
}
@@ -356,44 +365,12 @@ void nrf_802154_buffer_free(uint8_t * p_data)
int8_t nrf_802154_rssi_last_get(void)
{
uint8_t minus_dbm = nrf_radio_rssi_sample_get();
minus_dbm = nrf_802154_rssi_sample_corrected_get(minus_dbm);
return - (int8_t)minus_dbm;
}
int8_t nrf_802154_rssi_corrected_get(int8_t rssi, int8_t temp)
{
if (temp <= -30)
{
return rssi + 3;
}
if (temp <= -10)
{
return rssi + 2;
}
if (temp <= 10)
{
return rssi + 1;
}
if (temp <= 30)
{
return rssi;
}
if (temp <= 50)
{
return rssi - 1;
}
if (temp <= 70)
{
return rssi - 2;
}
return rssi - 3;
}
bool nrf_802154_promiscuous_get(void)
{
return nrf_802154_pib_promiscuous_get();
File diff suppressed because it is too large Load Diff
@@ -45,17 +45,18 @@ extern "C" {
* @defgroup nrf_802154_config 802.15.4 driver configuration
* @{
* @ingroup nrf_802154
* @brief Configuration of 802.15.4 radio driver for nRF SoC.
* @brief Configuration of the 802.15.4 radio driver for nRF SoCs.
*/
/***************************************************************************************************
* @section Radio Driver Configuration.
**************************************************************************************************/
/**
* @defgroup nrf_802154_config_radio Radio driver configuration
* @{
*/
/**
* @def NRF_802154_CCA_MODE
* @def NRF_802154_CCA_MODE_DEFAULT
*
* CCA Mode used by the driver.
* CCA mode used by the driver.
*
*/
#ifndef NRF_802154_CCA_MODE_DEFAULT
@@ -63,9 +64,9 @@ extern "C" {
#endif
/**
* @def NRF_802154_CCA_ED_THRESHOLD
* @def NRF_802154_CCA_ED_THRESHOLD_DEFAULT
*
* Energy Detection Threshold used in CCA procedure.
* Energy detection threshold used in CCA procedure.
*
*/
#ifndef NRF_802154_CCA_ED_THRESHOLD_DEFAULT
@@ -73,9 +74,9 @@ extern "C" {
#endif
/**
* @def NRF_802154_CCA_CORR_THRESHOLD
* @def NRF_802154_CCA_CORR_THRESHOLD_DEFAULT
*
* Correlator Threshold used in CCA procedure.
* Correlator threshold used in CCA procedure.
*
*/
#ifndef NRF_802154_CCA_CORR_THRESHOLD_DEFAULT
@@ -83,7 +84,7 @@ extern "C" {
#endif
/**
* @def NRF_802154_CCA_CORR_LIMIT
* @def NRF_802154_CCA_CORR_LIMIT_DEFAULT
*
* Correlator limit used in CCA procedure.
*
@@ -96,8 +97,8 @@ extern "C" {
* @def NRF_802154_INTERNAL_RADIO_IRQ_HANDLING
*
* If the driver should internally handle the RADIO IRQ.
* In case the driver is used in an OS the RADIO IRQ may be handled by the OS and passed to
* the driver @sa nrf_802154_radio_irq_handler(). In this case internal handling should be disabled.
* If the driver is used in an OS, the RADIO IRQ may be handled by the OS and passed to
* the driver by @ref nrf_802154_radio_irq_handler. In this case, internal handling should be disabled.
*/
#ifndef NRF_802154_INTERNAL_RADIO_IRQ_HANDLING
@@ -114,7 +115,7 @@ extern "C" {
* @def NRF_802154_IRQ_PRIORITY
*
* Interrupt priority for RADIO peripheral.
* It is recommended to keep IRQ priority high (low number) to prevent losing frames due to
* Keep IRQ priority high (low number) to prevent losing frames due to
* preemption.
*
*/
@@ -125,7 +126,7 @@ extern "C" {
/**
* @def NRF_802154_TIMER_INSTANCE
*
* TIMER instance used by the driver for Ack IFS and by FEM module.
* Timer instance used by the driver for ACK IFS and by the FEM module.
*
*/
#ifndef NRF_802154_TIMER_INSTANCE
@@ -137,8 +138,8 @@ extern "C" {
*
* Timer instance used by the driver for detecting when PSDU is being received.
*
* @note This configuration is only used when NRF_RADIO_EVENT_BCMATCH event handling is disabled
* (@sa NRF_802154_DISABLE_BCC_MATCHING).
* @note This configuration is used only when NRF_RADIO_EVENT_BCMATCH event handling is disabled
* (see @ref NRF_802154_DISABLE_BCC_MATCHING).
*/
#ifndef NRF_802154_COUNTER_TIMER_INSTANCE
#define NRF_802154_COUNTER_TIMER_INSTANCE NRF_TIMER2
@@ -150,7 +151,7 @@ extern "C" {
* SWI EGU instance used by the driver to synchronize PPIs and for requests and notifications if
* SWI is in use.
*
* @note This option is used by core module regardless driver configuration.
* @note This option is used by the core module regardless of the driver configuration.
*
*/
#ifndef NRF_802154_SWI_EGU_INSTANCE
@@ -194,7 +195,7 @@ extern "C" {
/**
* @def NRF_802154_USE_RAW_API
*
* When this flag is set RAW API is available for the MAC layer. It is recommended to use RAW API,
* When this flag is set, RAW API is available for the MAC layer. It is recommended to use RAW API
* because it provides more optimized functions.
*
* @note If RAW API is not available for the MAC layer, only less optimized functions performing
@@ -236,7 +237,7 @@ extern "C" {
#endif
/**
* @def NRF_802154_EXCLUDE_BCC_MATCHING
* @def NRF_802154_DISABLE_BCC_MATCHING
*
* Setting this flag disables NRF_RADIO_EVENT_BCMATCH handling, and therefore address filtering
* during frame reception. With this flag set to 1, address filtering is done after receiving
@@ -250,7 +251,7 @@ extern "C" {
/**
* @def NRF_802154_NOTIFY_CRCERROR
*
* With this flag set to 1 CRC errors would be notified to upper layers. This requires interrupt
* With this flag set to 1, CRC errors are notified to upper layers. This requires an interrupt
* handler to be used.
*
*/
@@ -262,25 +263,27 @@ extern "C" {
* @def NRF_802154_FRAME_TIMESTAMP_ENABLED
*
* If timestamps should be added to received frames.
* Enabling this feature enables @sa nrf_802154_received_timsestamp_raw,
* @sa nrf_802154_received_timestamp, @sa nrf_802154_transmitted_timestamp_raw and
* @sa nrf_802154_transmitted_timestamp functions that add timestamps to received frames.
* Enabling this feature enables the functions @ref nrf_802154_received_timsestamp_raw,
* @ref nrf_802154_received_timestamp, @ref nrf_802154_transmitted_timestamp_raw, and
* @ref nrf_802154_transmitted_timestamp, which add timestamps to received frames.
*
*/
#ifndef NRF_802154_FRAME_TIMESTAMP_ENABLED
#define NRF_802154_FRAME_TIMESTAMP_ENABLED 1
#endif
/***************************************************************************************************
* @section Clock Driver Configuration.
**************************************************************************************************/
/**
* @}
* @defgroup nrf_802154_config_clock Clock driver configuration
* @{
*/
/**
* @def NRF_802154_CLOCK_IRQ_PRIORITY
*
* Priority of clock interrupt used in standalone clock driver implementation.
*
* @note This configuration is only applicable for Clock Abstraction Layer implementation
* @note This configuration is only applicable for the Clock Abstraction Layer implementation
* in nrf_802154_clock_nodrv.c.
*
*/
@@ -289,11 +292,11 @@ extern "C" {
#endif
/**
* @def NRF_802154_CLOCK_IRQ_PRIORITY
* @def NRF_802154_CLOCK_LFCLK_SOURCE
*
* Low frequency clock source used in standalone clock driver implementation.
* Low-frequency clock source used in standalone clock driver implementation.
*
* @note This configuration is only applicable for Clock Abstraction Layer implementation
* @note This configuration is only applicable for the Clock Abstraction Layer implementation
* in nrf_802154_clock_nodrv.c.
*
*/
@@ -301,16 +304,18 @@ extern "C" {
#define NRF_802154_CLOCK_LFCLK_SOURCE NRF_CLOCK_LFCLK_Xtal
#endif
/***************************************************************************************************
* @section RTC Driver Configuration.
**************************************************************************************************/
/**
* @}
* @defgroup nrf_802154_config_rtc RTC driver configuration
* @{
*/
/**
* @def NRF_802154_RTC_IRQ_PRIORITY
*
* Priority of RTC interrupt used in standalone timer driver implementation.
*
* @note This configuration is only applicable for Timer Abstraction Layer implementation
* @note This configuration is only applicable for the Timer Abstraction Layer implementation
* in nrf_802154_timer_nodrv.c.
*
*/
@@ -323,7 +328,7 @@ extern "C" {
*
* RTC instance used in standalone timer driver implementation.
*
* @note This configuration is only applicable for Timer Abstraction Layer implementation
* @note This configuration is only applicable for the Timer Abstraction Layer implementation
* in nrf_802154_timer_nodrv.c.
*
*/
@@ -350,7 +355,7 @@ extern "C" {
*
* RTC Interrupt number used in standalone timer driver implementation.
*
* @note This configuration is only applicable for Timer Abstraction Layer implementation
* @note This configuration is only applicable for the Timer Abstraction Layer implementation
* in nrf_802154_timer_nodrv.c.
*
*/
@@ -359,14 +364,16 @@ extern "C" {
#endif
/***************************************************************************************************
* @section CSMA/CA procedure configuration.
**************************************************************************************************/
/**
* @}
* @defgroup nrf_802154_config_csma CSMA/CA procedure configuration
* @{
*/
/**
* @def NRF_802154_CSMA_CA_ENABLED
*
* If CSMA-CA procedure should be enabled by the driver. Disabling CSMA-CA procedure improves
* If CSMA-CA should be enabled by the driver. Disabling CSMA-CA improves
* driver performance.
*
*/
@@ -377,8 +384,8 @@ extern "C" {
/**
* @def NRF_802154_CSMA_CA_MIN_BE
*
* The minimum value of the backoff exponent (BE) in the CSMA-CA algorithm.
* (IEEE 802.15.4-2015: 6.2.5.1)
* The minimum value of the backoff exponent (BE) in the CSMA-CA algorithm
* (IEEE 802.15.4-2015: 6.2.5.1).
*
*/
#ifndef NRF_802154_CSMA_CA_MIN_BE
@@ -388,8 +395,8 @@ extern "C" {
/**
* @def NRF_802154_CSMA_CA_MAX_BE
*
* The maximum value of the backoff exponent, BE, in the CSMA-CA algorithm.
* (IEEE 802.15.4-2015: 6.2.5.1)
* The maximum value of the backoff exponent, BE, in the CSMA-CA algorithm
* (IEEE 802.15.4-2015: 6.2.5.1).
*
*/
#ifndef NRF_802154_CSMA_CA_MAX_BE
@@ -399,7 +406,7 @@ extern "C" {
/**
* @def NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel
* The maximum number of backoffs that the CSMA-CA algorithm will attempt before declaring a channel
* access failure.
*
*/
@@ -407,14 +414,16 @@ extern "C" {
#define NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS 4
#endif
/***************************************************************************************************
* @section ACK timeout feature configuration.
**************************************************************************************************/
/**
* @}
* @defgroup nrf_802154_config_timeout ACK time-out feature configuration
* @{
*/
/**
* @def NRF_802154_ACK_TIMEOUT_ENABLED
*
* If ACK timeout feature should be enabled in the driver.
* If the ACK time-out feature should be enabled in the driver.
*
*/
#ifndef NRF_802154_ACK_TIMEOUT_ENABLED
@@ -424,24 +433,26 @@ extern "C" {
/**
* @def NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT
*
* Default timeout time in us for ACK timeout feature.
* Default time-out in us for the ACK time-out feature.
*
*/
#ifndef NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT
#define NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT 7000
#endif
/***************************************************************************************************
* @section Transmission start notification feature configuration.
**************************************************************************************************/
/**
* @}
* @defgroup nrf_802154_config_transmission Transmission start notification feature configuration
* @{
*/
/**
* @def NRF_802154_TX_STARTED_NOTIFY_ENABLED
*
* If notification of started transmission should be enabled in the driver.
* If notifications of started transmissions should be enabled in the driver.
*
* @note This feature is enabled by default if Ack Timeout feature or CSMA-CA feature is enabled.
* These features depend on notification of transmission start.
* @note This feature is enabled by default if the ACK time-out feature or CSMA-CA is enabled.
* These features depend on notifications of transmission start.
*/
#ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED
#if NRF_802154_ACK_TIMEOUT_ENABLED || NRF_802154_CSMA_CA_ENABLED
@@ -460,3 +471,7 @@ extern "C" {
#endif
#endif // NRF_802154_CONFIG_H__
/**
*@}
**/
@@ -52,6 +52,7 @@
#include "nrf_802154_priority_drop.h"
#include "nrf_802154_procedures_duration.h"
#include "nrf_802154_revision.h"
#include "nrf_802154_rssi.h"
#include "nrf_802154_rx_buffer.h"
#include "nrf_802154_types.h"
#include "fem/nrf_fem_control_api.h"
@@ -222,7 +223,11 @@ static void rx_flags_clear(void)
*/
static int8_t rssi_last_measurement_get(void)
{
return -((int8_t)nrf_radio_rssi_sample_get());
uint8_t rssi_sample = nrf_radio_rssi_sample_get();
rssi_sample = nrf_802154_rssi_sample_corrected_get(rssi_sample);
return -((int8_t)rssi_sample);
}
/** Get LQI of a received frame.
@@ -235,6 +240,7 @@ static uint8_t lqi_get(const uint8_t * p_data)
{
uint32_t lqi = RX_FRAME_LQI(p_data);
lqi = nrf_802154_rssi_lqi_corrected_get(lqi);
lqi *= LQI_VALUE_FACTOR;
if (lqi > LQI_MAX)
@@ -328,7 +334,8 @@ static void cca_configuration_update(void)
nrf_802154_pib_cca_cfg_get(&cca_cfg);
nrf_radio_cca_mode_set(cca_cfg.mode);
nrf_radio_cca_ed_threshold_set(cca_cfg.ed_threshold);
nrf_radio_cca_ed_threshold_set(
nrf_802154_rssi_cca_ed_threshold_corrected_get(cca_cfg.ed_threshold));
nrf_radio_cca_corr_threshold_set(cca_cfg.corr_threshold);
nrf_radio_cca_corr_counter_set(cca_cfg.corr_limit);
}
@@ -511,7 +518,6 @@ static void irq_init(void)
{
NVIC_SetPriority(RADIO_IRQn, NRF_802154_IRQ_PRIORITY);
NVIC_ClearPendingIRQ(RADIO_IRQn);
NVIC_EnableIRQ(RADIO_IRQn);
}
/** Deinitialize interrupts for radio peripheral. */
@@ -556,6 +562,7 @@ static uint8_t ed_result_get(void)
{
uint32_t result = m_ed_result;
result = nrf_802154_rssi_ed_corrected_get(result);
result *= ED_RESULT_FACTOR;
if (result > ED_RESULT_MAX)
@@ -796,7 +803,9 @@ static void fem_for_tx_set(bool cca)
static void fem_for_tx_reset(bool disable_ppi_egu_timer_start)
{
nrf_fem_control_ppi_disable(NRF_FEM_CONTROL_ANY_PIN);
nrf_fem_control_timer_reset(NRF_FEM_CONTROL_ANY_PIN, NRF_TIMER_SHORT_COMPARE0_STOP_MASK | NRF_TIMER_SHORT_COMPARE1_STOP_MASK);
nrf_fem_control_timer_reset(NRF_FEM_CONTROL_ANY_PIN,
(nrf_timer_short_mask_t) (NRF_TIMER_SHORT_COMPARE0_STOP_MASK |
NRF_TIMER_SHORT_COMPARE1_STOP_MASK));
nrf_fem_control_ppi_fork_clear(NRF_FEM_CONTROL_ANY_PIN, PPI_CCAIDLE_FEM);
nrf_ppi_channel_disable(PPI_CCAIDLE_FEM);
@@ -2192,7 +2201,7 @@ static void irq_end_state_rx_ack(void)
if (ack_match)
{
p_ack_buffer = mp_current_rx_buffer;
p_ack_buffer = mp_current_rx_buffer;
mp_current_rx_buffer->free = false;
}
@@ -48,6 +48,8 @@ extern "C" {
#define EVENT_TRACE_EXIT 0x0002UL
#define EVENT_SET_STATE 0x0005UL
#define EVENT_RADIO_RESET 0x0006UL
#define EVENT_TIMESLOT_REQUEST 0x0007UL
#define EVENT_TIMESLOT_REQUEST_RESULT 0x0008UL
#define FUNCTION_SLEEP 0x0001UL
#define FUNCTION_RECEIVE 0x0002UL
@@ -88,8 +90,11 @@ extern "C" {
#define FUNCTION_RAAL_SIG_EVENT_EXTEND 0x0403UL
#define FUNCTION_RAAL_SIG_EVENT_ENDED 0x0404UL
#define FUNCTION_RAAL_SIG_EVENT_RADIO 0x0405UL
#define FUNCTION_RAAL_SIG_EVENT_EXCEED_SUCCESS 0x0406UL
#define FUNCTION_RAAL_SIG_EVENT_EXCEED_FAIL 0x0407UL
#define FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS 0x0406UL
#define FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL 0x0407UL
#define FUNCTION_RAAL_EVT_BLOCKED 0x0408UL
#define FUNCTION_RAAL_EVT_SESSION_IDLE 0x0409UL
#define FUNCTION_RAAL_EVT_HFCLK_READY 0x040AUL
#define PIN_DBG_RADIO_EVT_END 11
#define PIN_DBG_RADIO_EVT_DISABLED 12
@@ -123,7 +128,7 @@ extern volatile uint32_t nrf_802154_debug_log_ptr;
#else // ENABLE_DEBUG_LOG
#define nrf_802154_log(EVENT_CODE, EVENT_ARG)
#define nrf_802154_log(EVENT_CODE, EVENT_ARG) (void)(EVENT_ARG)
#endif // ENABLE_DEBUG_LOG
@@ -0,0 +1,96 @@
/* Copyright (c) 2018, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* @file
* This file implements RSSI calculations for 802.15.4 driver.
*
*/
#include <stdint.h>
#include "platform/temperature/nrf_802154_temperature.h"
int8_t nrf_802154_rssi_sample_temp_corr_value_get(void)
{
int8_t temp = nrf_802154_temperature_get();
int8_t result;
if (temp <= -30)
{
result = 3;
}
else if (temp <= -10)
{
result = 2;
}
else if (temp <= 10)
{
result = 1;
}
else if (temp <= 30)
{
result = 0;
}
else if (temp <= 50)
{
result = -1;
}
else if (temp <= 70)
{
result = -2;
}
else
{
result = -3;
}
return result;
}
uint8_t nrf_802154_rssi_sample_corrected_get(uint8_t rssi_sample)
{
return rssi_sample + nrf_802154_rssi_sample_temp_corr_value_get();
}
uint8_t nrf_802154_rssi_lqi_corrected_get(uint8_t lqi)
{
return lqi - nrf_802154_rssi_sample_temp_corr_value_get();
}
uint8_t nrf_802154_rssi_ed_corrected_get(uint8_t ed)
{
return ed - nrf_802154_rssi_sample_temp_corr_value_get();
}
uint8_t nrf_802154_rssi_cca_ed_threshold_corrected_get(uint8_t cca_ed)
{
return cca_ed - nrf_802154_rssi_sample_temp_corr_value_get();
}
@@ -0,0 +1,90 @@
/* Copyright (c) 2018, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef NRF_802154_RSSI_H__
#define NRF_802154_RSSI_H__
#include <stdint.h>
/**
* @defgroup nrf_802154_rssi RSSI calculations used internally in the 802.15.4 driver.
* @{
* @ingroup nrf_802154
* @brief RSSI calculations used internally in the 802.15.4 driver.
*/
/**
* @brief Get RSSISAMPLE temperature correction value for temperature provided by platform.
*
* @returns RSSISAMPLE temperature correction value (Errata 153).
*/
int8_t nrf_802154_rssi_sample_temp_corr_value_get(void);
/**
* @brief Adjust the given RSSISAMPLE value using a temperature correction factor.
*
* @param[in] rssi_sample Value read from RSSISAMPLE register.
*
* @returns RSSISAMPLE corrected by a temperature factor (Errata 153).
*/
uint8_t nrf_802154_rssi_sample_corrected_get(uint8_t rssi_sample);
/**
* @brief Adjust the reported LQI value using a temperature correction factor.
*
* @param[in] lqi Value read from LQI byte.
*
* @returns LQI byte value corrected by a temperature factor (Errata 153).
*/
uint8_t nrf_802154_rssi_lqi_corrected_get(uint8_t lqi);
/**
* @brief Adjust the EDSAMPLE value using a temperature correction factor.
*
* @param[in] ed Value read from EDSAMPLE register.
*
* @returns EDSAMPLE value corrected by a temperature factor (Errata 153).
*/
uint8_t nrf_802154_rssi_ed_corrected_get(uint8_t ed);
/**
* @brief Adjust the CCA ED threshold value using a temperature correction factor.
*
* @param[in] cca_ed Value representing CCA ED threshold that should be corrected.
*
* @returns CCA ED threshold value corrected by a temperature factor (Errata 153).
*/
uint8_t nrf_802154_rssi_cca_ed_threshold_corrected_get(uint8_t cca_ed);
/**
*@}
**/
#endif // NRF_802154_RSSI_H__
@@ -36,7 +36,7 @@
#include "hal/nrf_radio.h"
/**
* @defgroup nrf_802154_types Types definitions used in the 802.15.4 driver.
* @defgroup nrf_802154_types Type definitions used in the 802.15.4 driver.
* @{
* @ingroup nrf_802154
* @brief Definitions of types used in the 802.15.4 driver.
@@ -47,74 +47,74 @@
*/
typedef uint8_t nrf_802154_state_t;
#define NRF_802154_STATE_INVALID 0x01 /**< Radio in an invalid state. */
#define NRF_802154_STATE_SLEEP 0x02 /**< Radio in Sleep state. */
#define NRF_802154_STATE_RECEIVE 0x03 /**< Radio in Receive state. */
#define NRF_802154_STATE_TRANSMIT 0x04 /**< Radio in Transmit state. */
#define NRF_802154_STATE_ENERGY_DETECTION 0x05 /**< Radio in Energy Detection state. */
#define NRF_802154_STATE_CCA 0x06 /**< Radio in CCA state. */
#define NRF_802154_STATE_CONTINUOUS_CARRIER 0x07 /**< Radio in Continuous Carrier state. */
#define NRF_802154_STATE_INVALID 0x01 //!< Radio in an invalid state.
#define NRF_802154_STATE_SLEEP 0x02 //!< Radio in sleep state.
#define NRF_802154_STATE_RECEIVE 0x03 //!< Radio in receive state.
#define NRF_802154_STATE_TRANSMIT 0x04 //!< Radio in transmit state.
#define NRF_802154_STATE_ENERGY_DETECTION 0x05 //!< Radio in energy detection state.
#define NRF_802154_STATE_CCA 0x06 //!< Radio in CCA state.
#define NRF_802154_STATE_CONTINUOUS_CARRIER 0x07 //!< Radio in continuous carrier state.
/**
* @brief Errors reported during frame transmission.
*/
typedef uint8_t nrf_802154_tx_error_t;
#define NRF_802154_TX_ERROR_NONE 0x00 /**< There is no transmit error. */
#define NRF_802154_TX_ERROR_BUSY_CHANNEL 0x01 /**< CCA reported busy channel prior to transmission. */
#define NRF_802154_TX_ERROR_INVALID_ACK 0x02 /**< Received ACK frame is other than expected. */
#define NRF_802154_TX_ERROR_NO_MEM 0x03 /**< No receive buffer are available to receive an ACK. */
#define NRF_802154_TX_ERROR_TIMESLOT_ENDED 0x04 /**< Radio timeslot ended during transmission procedure. */
#define NRF_802154_TX_ERROR_NO_ACK 0x05 /**< ACK frame was not received during timeout period. */
#define NRF_802154_TX_ERROR_ABORTED 0x06 /**< Procedure was aborted by other driver operation with FORCE priority. */
#define NRF_802154_TX_ERROR_NONE 0x00 //!< There is no transmit error.
#define NRF_802154_TX_ERROR_BUSY_CHANNEL 0x01 //!< CCA reported busy channel prior to transmission.
#define NRF_802154_TX_ERROR_INVALID_ACK 0x02 //!< Received ACK frame is other than expected.
#define NRF_802154_TX_ERROR_NO_MEM 0x03 //!< No receive buffer is available to receive an ACK.
#define NRF_802154_TX_ERROR_TIMESLOT_ENDED 0x04 //!< Radio timeslot ended during transmission procedure.
#define NRF_802154_TX_ERROR_NO_ACK 0x05 //!< ACK frame was not received during time-out period.
#define NRF_802154_TX_ERROR_ABORTED 0x06 //!< Procedure was aborted by another driver operation with FORCE priority.
/**
* @brief Possible errors during frame reception.
*/
typedef uint8_t nrf_802154_rx_error_t;
#define NRF_802154_RX_ERROR_NONE 0x00 /**< There is no receive error */
#define NRF_802154_RX_ERROR_INVALID_FRAME 0x01 /**< Received a malformed frame */
#define NRF_802154_RX_ERROR_INVALID_FCS 0x02 /**< Received a frame with invalid checksum. */
#define NRF_802154_RX_ERROR_INVALID_DEST_ADDR 0x03 /**< Received a frame with mismatched destination address. */
#define NRF_802154_RX_ERROR_RUNTIME 0x04 /**< A runtime error occured (e.g. CPU was hold for too long.) */
#define NRF_802154_RX_ERROR_TIMESLOT_ENDED 0x05 /**< Radio timeslot ended during frame reception. */
#define NRF_802154_RX_ERROR_ABORTED 0x06 /**< Procedure was aborted by other driver operation with FORCE priority. */
#define NRF_802154_RX_ERROR_NONE 0x00 //!< There is no receive error.
#define NRF_802154_RX_ERROR_INVALID_FRAME 0x01 //!< Received a malformed frame.
#define NRF_802154_RX_ERROR_INVALID_FCS 0x02 //!< Received a frame with invalid checksum.
#define NRF_802154_RX_ERROR_INVALID_DEST_ADDR 0x03 //!< Received a frame with mismatched destination address.
#define NRF_802154_RX_ERROR_RUNTIME 0x04 //!< A runtime error occurred (for example, CPU was held for too long).
#define NRF_802154_RX_ERROR_TIMESLOT_ENDED 0x05 //!< Radio timeslot ended during frame reception.
#define NRF_802154_RX_ERROR_ABORTED 0x06 //!< Procedure was aborted by another driver operation with FORCE priority.
/**
* @brief Possible errors during energy detection.
*/
typedef uint8_t nrf_802154_ed_error_t;
#define NRF_802154_ED_ERROR_ABORTED 0x01 /**< Procedure was aborted by other driver operation with FORCE priority. */
#define NRF_802154_ED_ERROR_ABORTED 0x01 //!< Procedure was aborted by another driver operation with FORCE priority.
/**
* @brief Possible errors during CCA procedure.
*/
typedef uint8_t nrf_802154_cca_error_t;
#define NRF_802154_CCA_ERROR_ABORTED 0x01 /**< Procedure was aborted by other driver operation with FORCE priority. */
#define NRF_802154_CCA_ERROR_ABORTED 0x01 //!< Procedure was aborted by another driver operation with FORCE priority.
/**
* @brief Termination level selected for particular request.
* @brief Termination level selected for a particular request.
*
* Each request is able to terminate ongoing operation. This type selects which operation should be
* aborted by given request.
* Each request can terminate an ongoing operation. This type selects which operation should be
* aborted by a given request.
*/
typedef uint8_t nrf_802154_term_t;
#define NRF_802154_TERM_NONE 0x00 /**< Request is skipped if another operation is ongoing. */
#define NRF_802154_TERM_802154 0x01 /**< Request terminates ongoing 802.15.4 operation. */
#define NRF_802154_TERM_NONE 0x00 //!< Request is skipped if another operation is ongoing.
#define NRF_802154_TERM_802154 0x01 //!< Request terminates ongoing 802.15.4 operation.
/**
* @brief Structure for configuring CCA.
*/
typedef struct
{
nrf_radio_cca_mode_t mode; /**< CCA mode. */
uint8_t ed_threshold; /**< CCA Energy Busy Threshold. Not used in NRF_RADIO_CCA_MODE_CARRIER. */
uint8_t corr_threshold; /**< CCA Correlator Busy Threshold. Not used in NRF_RADIO_CCA_MODE_ED. */
uint8_t corr_limit; /**< Limit of occurrences above CCA Correlator Busy Threshold. Not used in NRF_RADIO_CCA_MODE_ED. */
nrf_radio_cca_mode_t mode; //!< CCA mode.
uint8_t ed_threshold; //!< CCA energy busy threshold. Not used in NRF_RADIO_CCA_MODE_CARRIER.
uint8_t corr_threshold; //!< CCA correlator busy threshold. Not used in NRF_RADIO_CCA_MODE_ED.
uint8_t corr_limit; //!< Limit of occurrences above CCA correlator busy threshold. Not used in NRF_RADIO_CCA_MODE_ED.
} nrf_802154_cca_cfg_t;
/**
@@ -0,0 +1,87 @@
/* Copyright (c) 2018, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* @brief This module defines Thermometer Abstraction Layer for the 802.15.4 driver.
*
*/
#ifndef NRF_802154_TEMPERATURE_H_
#define NRF_802154_TEMPERATURE_H_
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup nrf_802154_temperature Thermometer Abstraction Layer for the 802.15.4 driver
* @{
* @ingroup nrf_802154
* @brief Thermometer Abstraction Layer interface for the 802.15.4 driver.
*
* Thermometer Abstraction Layer is an abstraction layer of thermometer that is used to correct
* RSSI, LQI, ED result and CCA threshold measurements.
*
*/
/**
* @brief Initialize thermometer.
*/
void nrf_802154_temperature_init(void);
/**
* @brief Uninitialize thermometer.
*/
void nrf_802154_temperature_deinit(void);
/**
* @brief Get current temperature.
*
* @return Current temperature [C].
*/
int8_t nrf_802154_temperature_get(void);
/**
* @brief Callback executed when temperature changes.
*/
extern void nrf_802154_temperature_changed(void);
/**
*@}
**/
#ifdef __cplusplus
}
#endif
#endif /* NRF_802154_TEMPERATURE_H_ */
@@ -0,0 +1,60 @@
/* Copyright (c) 2018, Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* @file
* This file implements the thermometer abstraction stub that does not use thermometer.
*
* This thermometer abstraction will cause RSSI, LQI, ED, CCA threshold errors up to 3 dBm when
* temperature of device differs more than 5 C from 20 C.
*
*/
#include "nrf_802154_temperature.h"
#include <stdint.h>
#define DEFAULT_TEMPERATURE 20 ///< Default temperature reported by this driver stub [C].
void nrf_802154_temperature_init(void)
{
// Intentionally empty
}
void nrf_802154_temperature_deinit(void)
{
// Intentionally empty
}
int8_t nrf_802154_temperature_get(void)
{
return DEFAULT_TEMPERATURE;
}
@@ -61,6 +61,10 @@
_Pragma("GCC diagnostic pop")
#endif
/***************************************************************************************************
* @section Defines and typedefs.
**************************************************************************************************/
/**@brief Enable Request and End on timeslot safety interrupt. */
#define ENABLE_REQUEST_AND_END_ON_TIMESLOT_END 0
@@ -83,6 +87,7 @@
#define TIMER_CC_MARGIN_INT NRF_TIMER_INT_COMPARE1_MASK
#define TIMER_CC_CAPTURE NRF_TIMER_CC_CHANNEL2
#define TIMER_CC_CAPTURE_TASK NRF_TIMER_TASK_CAPTURE2
/**@brief Defines number of microseconds in one second. */
#define US_PER_S 1000000
@@ -98,6 +103,21 @@ typedef enum
PENDING_EVENT_ENDED
} pending_events_t;
/**@brief Defines states of timeslot. */
typedef enum
{
TIMESLOT_STATE_IDLE = 0,
TIMESLOT_STATE_REQUESTED,
TIMESLOT_STATE_GRANTED
} timeslot_state_t;
/***************************************************************************************************
* @section Static variables.
**************************************************************************************************/
/**@brief Defines if module has been initialized. */
static bool m_initialized = false;
/**@brief Request parameters. */
static nrf_radio_request_t m_request;
@@ -107,20 +127,17 @@ static nrf_radio_signal_callback_return_param_t m_ret_param;
/**@brief Current configuration of the RAAL. */
static nrf_raal_softdevice_cfg_t m_config;
/**@brief Current timeslot length. */
static uint16_t m_timeslot_length;
/**@brief Defines if RAAL is in continous mode. */
/**@brief Defines if RAAL is in continuous mode. */
static volatile bool m_continuous = false;
/**@brief Defines if RAAL is currently in a timeslot. */
static volatile bool m_in_timeslot = false;
static volatile timeslot_state_t m_timeslot_state;
/**@brief Current iteration process number. */
static volatile uint16_t m_alloc_iters;
/**@brief Current timeslot length. */
static uint16_t m_timeslot_length;
/**@brief Defines if module has been initialized. */
static bool m_initialize = false;
/**@brief Number of already performed extentions tries on failed event. */
static volatile uint16_t m_timeslot_extend_tries;
/**@breif Defines if Radio Driver entered critical section. */
static volatile bool m_in_critical_section = false;
@@ -131,79 +148,9 @@ static volatile pending_events_t m_pending_event = PENDING_EVENT_NONE;
/**@brief Defines RTC0 counter value on timeslot begin. */
static uint32_t m_start_rtc_ticks = 0;
/**@brief Initialize timeslot internal variables. */
static inline void timeslot_data_init(void)
{
m_alloc_iters = 0;
m_timeslot_length = m_config.timeslot_length;
}
/**@brief Get actual time. */
static inline uint32_t timer_time_get(void)
{
RAAL_TIMER->TASKS_CAPTURE[TIMER_CC_CAPTURE] = 1;
return RAAL_TIMER->CC[TIMER_CC_CAPTURE];
}
/**@brief Check if margin is already reached. */
static inline bool timer_is_margin_reached(void)
{
return RAAL_TIMER->EVENTS_COMPARE[TIMER_CC_MARGIN];
}
/**@brief Enter timeslot critical section. */
static inline void timeslot_critical_section_enter(void)
{
NVIC_DisableIRQ(RAAL_TIMER_IRQn);
__DSB();
__ISB();
}
/**@brief Exit timeslot critical section. */
static inline void timeslot_critical_section_exit(void)
{
NVIC_EnableIRQ(RAAL_TIMER_IRQn);
}
static inline void timeslot_started_notify(void)
{
if (m_in_timeslot && m_continuous)
{
nrf_raal_timeslot_started();
}
}
static inline void timeslot_ended_notify(void)
{
if (!m_in_timeslot && m_continuous)
{
nrf_raal_timeslot_ended();
}
}
/**@brief Calculate maximal crystal drift. */
static inline uint32_t rtc_drift_calculate(uint32_t timeslot_length)
{
return DIVIDE_AND_CEIL(((uint64_t)timeslot_length * m_config.lf_clk_accuracy_ppm), US_PER_S);
}
/**@brief Prepare earliest timeslot request. */
static void timeslot_request_prepare(void)
{
memset(&m_request, 0, sizeof(m_request));
m_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST;
m_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_NO_GUARANTEE;
m_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL;
m_request.params.earliest.length_us = m_timeslot_length;
m_request.params.earliest.timeout_us = m_config.timeslot_timeout;
}
/**@brief Request earliest timeslot. */
static void timeslot_request(void)
{
timeslot_request_prepare();
sd_radio_request(&m_request);
}
/***************************************************************************************************
* @section Operations on RAAL TIMER.
**************************************************************************************************/
/**@brief Set timer on timeslot started. */
static void timer_start(void)
@@ -214,8 +161,8 @@ static void timer_start(void)
nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_MARGIN_INT);
nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_EXTEND, 0);
nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_MARGIN, m_timeslot_length - m_config.timeslot_safe_margin);
nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_START);
nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_START);
NVIC_EnableIRQ(RAAL_TIMER_IRQn);
}
@@ -228,22 +175,38 @@ static void timer_reset(void)
NVIC_ClearPendingIRQ(RAAL_TIMER_IRQn);
}
/**@brief Get current time on RAAL Timer. */
static inline uint32_t timer_time_get(void)
{
nrf_timer_task_trigger(RAAL_TIMER, TIMER_CC_CAPTURE_TASK);
return nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_CAPTURE);
}
/**@brief Check if margin is already reached. */
static inline bool timer_is_margin_reached(void)
{
return nrf_timer_event_check(RAAL_TIMER, TIMER_CC_MARGIN_EVENT);
}
/**@brief Calculate maximal crystal drift. */
static inline uint32_t timer_rtc_drift_calculate(uint32_t timeslot_length)
{
return DIVIDE_AND_CEIL(((uint64_t)timeslot_length * m_config.lf_clk_accuracy_ppm), US_PER_S);
}
/**@brief Set timer on extend event. */
static void timer_extend(void)
static void timer_on_extend_update(void)
{
NVIC_ClearPendingIRQ(RAAL_TIMER_IRQn);
nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_MARGIN_INT);
nrf_timer_cc_write(RAAL_TIMER,
TIMER_CC_MARGIN,
nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_MARGIN,
nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_MARGIN) + m_timeslot_length);
if (!m_alloc_iters)
if (m_timeslot_extend_tries == 0)
{
nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_EXTEND_INT);
nrf_timer_cc_write(RAAL_TIMER,
TIMER_CC_EXTEND,
nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_EXTEND,
nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_EXTEND) + m_timeslot_length);
nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_EXTEND_INT);
}
}
@@ -270,7 +233,7 @@ static void timer_jitter_adjust(void)
// Check if we are still in time.
uint32_t cc_margin = nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_MARGIN);
assert(cc_margin > rtc_ticks + rtc_drift_calculate(cc_margin));
assert(cc_margin > rtc_ticks + timer_rtc_drift_calculate(cc_margin));
if (rtc_ticks > timer_ticks)
{
@@ -286,48 +249,146 @@ static void timer_jitter_adjust(void)
}
// Add safety drift time.
uint32_t safety_drift_time = rtc_drift_calculate(2 * m_config.timeslot_length) +
uint32_t safety_drift_time = timer_rtc_drift_calculate(2 * m_config.timeslot_length) +
TIMER_TO_SIGNAL_JITTER_US;
nrf_timer_cc_write(RAAL_TIMER,
TIMER_CC_MARGIN,
nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_MARGIN) - safety_drift_time);
}
/**@brief Decrease timeslot length. */
static void timeslot_decrease_length(void)
/***************************************************************************************************
* @section Timeslot related functions.
**************************************************************************************************/
/**@brief Initialize timeslot internal variables. */
static inline void timeslot_data_init(void)
{
m_alloc_iters++;
m_timeslot_extend_tries = 0;
m_timeslot_length = m_config.timeslot_length;
}
/**@brief Indicate if timeslot is in idle state. */
static inline bool timeslot_is_idle(void)
{
return (m_timeslot_state == TIMESLOT_STATE_IDLE);
}
/**@brief Indicate if timeslot has been granted. */
static inline bool timeslot_is_granted(void)
{
return (m_timeslot_state == TIMESLOT_STATE_GRANTED);
}
/**@brief Enter timeslot critical section. */
static inline void timeslot_critical_section_enter(void)
{
NVIC_DisableIRQ(RAAL_TIMER_IRQn);
__DSB();
__ISB();
}
/**@brief Exit timeslot critical section. */
static inline void timeslot_critical_section_exit(void)
{
NVIC_EnableIRQ(RAAL_TIMER_IRQn);
}
/**@brief Notify driver that timeslot has been started. */
static inline void timeslot_started_notify(void)
{
if (timeslot_is_granted() && m_continuous)
{
nrf_raal_timeslot_started();
}
}
/**@brief Notify driver that timeslot has been ended. */
static inline void timeslot_ended_notify(void)
{
if (!timeslot_is_granted() && m_continuous)
{
nrf_raal_timeslot_ended();
}
}
/**@brief Prepare earliest timeslot request. */
static void timeslot_request_prepare(void)
{
memset(&m_request, 0, sizeof(m_request));
m_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST;
m_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_NO_GUARANTEE;
m_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL;
m_request.params.earliest.length_us = m_timeslot_length;
m_request.params.earliest.timeout_us = m_config.timeslot_timeout;
}
/**@brief Request earliest timeslot. */
static void timeslot_request(void)
{
timeslot_request_prepare();
// Request timeslot from SoftDevice.
uint32_t err_code = sd_radio_request(&m_request);
if (err_code == NRF_SUCCESS)
{
m_timeslot_state = TIMESLOT_STATE_REQUESTED;
}
nrf_802154_log(EVENT_TIMESLOT_REQUEST, m_request.params.earliest.length_us);
nrf_802154_log(EVENT_TIMESLOT_REQUEST_RESULT, err_code);
}
/**@brief Decrease timeslot length. */
static void timeslot_length_decrease(void)
{
m_timeslot_extend_tries++;
m_timeslot_length = m_timeslot_length >> 1;
}
/**@brief Extend timeslot. */
static void timeslot_extend(void)
/**@brief Fill timeslot parameters with extend action. */
static void timeslot_extend(uint32_t timeslot_length)
{
if (m_alloc_iters < m_config.timeslot_alloc_iters)
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND;
m_ret_param.params.extend.length_us = timeslot_length;
nrf_802154_pin_set(PIN_DBG_TIMESLOT_EXTEND_REQ);
nrf_802154_log(EVENT_TIMESLOT_REQUEST, m_ret_param.params.extend.length_us);
}
/**@brief Extend timeslot further. */
static void timeslot_next_extend(void)
{
// Check if we can make another extend query.
if (m_timeslot_extend_tries < m_config.timeslot_alloc_iters)
{
timeslot_decrease_length();
// Decrease timeslot length.
timeslot_length_decrease();
// Try to extend right after start.
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND;
m_ret_param.params.extend.length_us = m_timeslot_length;
nrf_802154_pin_set(PIN_DBG_TIMESLOT_EXTEND_REQ);
timeslot_extend(m_timeslot_length);
}
else
{
// Adjust possible clock jitters and wait for safety margin.
timer_jitter_adjust();
}
}
/***************************************************************************************************
* @section RAAL TIMER interrupt handler.
**************************************************************************************************/
/**@brief Handle timer interrupts. */
static void timer_irq_handle(void)
{
// Safe margin exceeded.
if (RAAL_TIMER->EVENTS_COMPARE[TIMER_CC_MARGIN])
if (nrf_timer_event_check(RAAL_TIMER, TIMER_CC_MARGIN_EVENT))
{
nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_MARGIN);
m_in_timeslot = false;
m_timeslot_state = TIMESLOT_STATE_IDLE;
if (m_in_critical_section)
{
@@ -364,7 +425,7 @@ static void timer_irq_handle(void)
}
// Extension margin exceeded.
else if (RAAL_TIMER->EVENTS_COMPARE[TIMER_CC_EXTEND])
else if (nrf_timer_event_check(RAAL_TIMER, TIMER_CC_EXTEND_EVENT))
{
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND);
@@ -375,13 +436,12 @@ static void timer_irq_handle(void)
(nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_EXTEND) +
m_config.timeslot_length < m_config.timeslot_max_length))
{
nrf_802154_pin_set(PIN_DBG_TIMESLOT_EXTEND_REQ);
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND;
m_ret_param.params.extend.length_us = m_config.timeslot_length;
// Try to extend timeslot.
timeslot_extend(m_config.timeslot_length);
}
else
{
// We have reached maximum timeslot length.
timer_jitter_adjust();
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE;
@@ -396,6 +456,10 @@ static void timer_irq_handle(void)
}
}
/***************************************************************************************************
* @section SoftDevice signal and SoC handlers.
**************************************************************************************************/
/**@brief Signal handler. */
static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_type)
{
@@ -409,8 +473,8 @@ static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_t
nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_ENDED);
m_pending_event = PENDING_EVENT_NONE;
m_in_timeslot = false;
m_pending_event = PENDING_EVENT_NONE;
m_timeslot_state = TIMESLOT_STATE_IDLE;
// TODO: Change to NRF_RADIO_SIGNAL_CALLBACK_ACTION_END (KRKNWK-937)
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE;
@@ -430,12 +494,15 @@ static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_t
// Ensure HFCLK is running before start is issued.
assert(NRF_CLOCK->HFCLKSTAT == (CLOCK_HFCLKSTAT_SRC_Msk | CLOCK_HFCLKSTAT_STATE_Msk));
timer_start();
assert(m_timeslot_state == TIMESLOT_STATE_REQUESTED);
m_start_rtc_ticks = NRF_RTC0->COUNTER;
m_in_timeslot = true;
m_timeslot_state = TIMESLOT_STATE_GRANTED;
// Set up timer first with requested timeslot length.
timer_start();
// Re-initialize timeslot data for future extensions.
timeslot_data_init();
if (m_in_critical_section)
@@ -457,11 +524,9 @@ static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_t
}
// Try to extend right after start.
m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND;
m_ret_param.params.extend.length_us = m_timeslot_length;
timeslot_extend(m_timeslot_length);
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_START);
nrf_802154_pin_set(PIN_DBG_TIMESLOT_EXTEND_REQ);
break;
}
@@ -473,7 +538,7 @@ static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_t
nrf_802154_pin_set(PIN_DBG_TIMESLOT_RADIO_IRQ);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_RADIO);
if (m_in_timeslot)
if (timeslot_is_granted())
{
if (!timer_is_margin_reached())
{
@@ -491,27 +556,26 @@ static nrf_radio_signal_callback_return_param_t *signal_handler(uint8_t signal_t
break;
case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED: /**< This signal indicates extend action failed. */
nrf_802154_pin_clr(PIN_DBG_TIMESLOT_EXTEND_REQ);
nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_FAILED);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXCEED_FAIL);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL);
timeslot_extend();
timeslot_next_extend();
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXCEED_FAIL);
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL);
break;
case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED: /**< This signal indicates extend action succeeded. */
nrf_802154_pin_clr(PIN_DBG_TIMESLOT_EXTEND_REQ);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXCEED_SUCCESS);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS);
timer_extend();
timer_on_extend_update();
if (m_alloc_iters != 0)
// Request futher extension only if any of previous one failed.
if (m_timeslot_extend_tries != 0)
{
timeslot_extend();
timeslot_next_extend();
}
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXCEED_SUCCESS);
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS);
break;
default:
@@ -531,19 +595,24 @@ void nrf_raal_softdevice_soc_evt_handler(uint32_t evt_id)
case NRF_EVT_RADIO_CANCELED:
{
nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_BLOCKED);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_EVT_BLOCKED);
assert(!m_in_timeslot);
assert(!timeslot_is_granted());
m_timeslot_state = TIMESLOT_STATE_IDLE;
if (m_continuous)
{
if (m_alloc_iters < m_config.timeslot_alloc_iters)
if (m_timeslot_extend_tries < m_config.timeslot_alloc_iters)
{
timeslot_decrease_length();
timeslot_length_decrease();
}
timeslot_request();
}
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_EVT_BLOCKED);
break;
}
@@ -552,14 +621,18 @@ void nrf_raal_softdevice_soc_evt_handler(uint32_t evt_id)
break;
case NRF_EVT_RADIO_SESSION_IDLE:
if (m_continuous)
{
nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_SESSION_IDLE);
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_EVT_SESSION_IDLE);
nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_SESSION_IDLE);
if (m_continuous && timeslot_is_idle())
{
timeslot_data_init();
timeslot_request();
}
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_EVT_SESSION_IDLE);
break;
case NRF_EVT_RADIO_SESSION_CLOSED:
@@ -570,9 +643,30 @@ void nrf_raal_softdevice_soc_evt_handler(uint32_t evt_id)
}
}
/***************************************************************************************************
* @section HFCLK management.
**************************************************************************************************/
void nrf_802154_clock_hfclk_ready(void)
{
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_EVT_HFCLK_READY);
if (m_continuous && timeslot_is_idle())
{
timeslot_data_init();
timeslot_request();
}
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_EVT_HFCLK_READY);
}
/***************************************************************************************************
* @section RAAL API.
**************************************************************************************************/
void nrf_raal_softdevice_config(const nrf_raal_softdevice_cfg_t * p_cfg)
{
assert(m_initialize);
assert(m_initialized);
assert(!m_continuous);
assert(p_cfg);
@@ -581,10 +675,10 @@ void nrf_raal_softdevice_config(const nrf_raal_softdevice_cfg_t * p_cfg)
void nrf_raal_init(void)
{
assert(!m_initialize);
assert(!m_initialized);
m_continuous = false;
m_in_timeslot = false;
m_continuous = false;
m_timeslot_state = TIMESLOT_STATE_IDLE;
m_config.lf_clk_accuracy_ppm = NRF_RAAL_DEFAULT_LF_CLK_ACCURACY_PPM;
m_config.timeslot_length = NRF_RAAL_TIMESLOT_DEFAULT_LENGTH;
@@ -596,18 +690,18 @@ void nrf_raal_init(void)
uint32_t err_code = sd_radio_session_open(signal_handler);
assert(err_code == NRF_SUCCESS);
m_initialize = true;
m_initialized = true;
}
void nrf_raal_uninit(void)
{
assert(m_initialize);
assert(m_initialized);
uint32_t err_code = sd_radio_session_close();
assert(err_code == NRF_SUCCESS);
m_continuous = false;
m_in_timeslot = false;
m_continuous = false;
m_timeslot_state = TIMESLOT_STATE_IDLE;
nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE);
}
@@ -616,12 +710,10 @@ void nrf_raal_continuous_mode_enter(void)
{
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_ENTER);
assert(m_initialize);
assert(m_initialized);
assert(!m_continuous);
m_alloc_iters = 0;
m_timeslot_length = m_config.timeslot_length;
m_continuous = true;
m_continuous = true;
nrf_802154_clock_hfclk_start();
@@ -632,13 +724,13 @@ void nrf_raal_continuous_mode_exit(void)
{
nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_EXIT);
assert(m_initialize);
assert(m_initialized);
assert(m_continuous);
m_continuous = false;
// Emulate signal interrupt to inform SD about end of m_continuous mode.
if (m_in_timeslot)
// Emulate signal interrupt to inform SD about end of continuous mode.
if (timeslot_is_granted())
{
NVIC_SetPendingIRQ(RAAL_TIMER_IRQn);
}
@@ -650,7 +742,7 @@ void nrf_raal_continuous_mode_exit(void)
bool nrf_raal_timeslot_request(uint32_t length_us)
{
if (!m_continuous || !m_in_timeslot)
if (!m_continuous || !timeslot_is_granted())
{
return false;
}
@@ -660,12 +752,12 @@ bool nrf_raal_timeslot_request(uint32_t length_us)
bool nrf_raal_timeslot_is_granted(void)
{
return (m_continuous && m_in_timeslot);
return (m_continuous && timeslot_is_granted());
}
uint32_t nrf_raal_timeslot_us_left_get(void)
{
if (!m_continuous || !m_in_timeslot)
if (!m_continuous || !timeslot_is_granted())
{
return 0;
}
@@ -710,11 +802,3 @@ void nrf_raal_critical_section_exit(void)
nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_CRIT_SECT_EXIT);
}
void nrf_802154_clock_hfclk_ready(void)
{
if (m_continuous && !m_in_timeslot)
{
timeslot_request();
}
}
@@ -49,6 +49,10 @@
#include <nrf.h>
#include "platform/timer/nrf_802154_timer.h"
#if defined(__ICCARM__)
_Pragma("diag_suppress=Pe167")
#endif
static volatile uint8_t m_mutex; ///< Mutex for starting the timer.
static volatile uint8_t m_queue_changed_cntr; ///< Information that scheduler queue was modified.
static volatile nrf_802154_timer_t * mp_head; ///< Head of the running timers list.