diff --git a/nrf_802154/common/include/nrf_802154_config.h b/nrf_802154/common/include/nrf_802154_config.h index 65215df1f5..51143346cd 100644 --- a/nrf_802154/common/include/nrf_802154_config.h +++ b/nrf_802154/common/include/nrf_802154_config.h @@ -538,6 +538,62 @@ extern "C" { #define NRF_802154_CARRIER_FUNCTIONS_ENABLED 1 #endif +/** + * @def NRF_802154_NOTIFICATION_IMPL_DIRECT + * + * Use nrf_802154_notification_direct.c implementation. + * See @ref NRF_802154_NOTIFICATION_IMPL. + */ +#define NRF_802154_NOTIFICATION_IMPL_DIRECT 0 + +/** + * @def NRF_802154_NOTIFICATION_IMPL_SWI + * + * Use nrf_802154_notification_swi.c implementation. + * See @ref NRF_802154_NOTIFICATION_IMPL. + */ +#define NRF_802154_NOTIFICATION_IMPL_SWI 1 + +/** + * @def NRF_802154_NOTIFICATION_IMPL + * + * Selects implementation of internal "notification" module. + * Possible values: + * @ref NRF_802154_NOTIFICATION_IMPL_DIRECT, + * @ref NRF_802154_NOTIFICATION_IMPL_SWI + */ +#ifndef NRF_802154_NOTIFICATION_IMPL +#define NRF_802154_NOTIFICATION_IMPL NRF_802154_NOTIFICATION_IMPL_SWI +#endif + +/** + * @def NRF_802154_REQUEST_IMPL_DIRECT + * + * Use nrf_802154_request_direct.c implementation. + * See @ref NRF_802154_NOTIFICATION_IMPL. + */ +#define NRF_802154_REQUEST_IMPL_DIRECT 0 + +/** + * @def NRF_802154_REQUEST_IMPL_DIRECT + * + * Use nrf_802154_request_swi.c implementation. + * See @ref NRF_802154_REQUEST_IMPL. + */ +#define NRF_802154_REQUEST_IMPL_SWI 1 + +/** + * @def NRF_802154_REQUEST_IMPL + * + * Selects implementation of internal "request" module. + * Possible values: + * @ref NRF_802154_REQUEST_IMPL_DIRECT, + * @ref NRF_802154_REQUEST_IMPL_SWI + */ +#ifndef NRF_802154_REQUEST_IMPL +#define NRF_802154_REQUEST_IMPL NRF_802154_REQUEST_IMPL_SWI +#endif + /** *@} **/ diff --git a/nrf_802154/doc/CHANGELOG.rst b/nrf_802154/doc/CHANGELOG.rst index 3071718e1f..4a4a1f5272 100644 --- a/nrf_802154/doc/CHANGELOG.rst +++ b/nrf_802154/doc/CHANGELOG.rst @@ -16,11 +16,18 @@ Main branch - nRF 802.15.4 Radio Driver Notable changes =============== -* If a time slot ends while waiting for or receiving an ACK frame, the transmission terminates with the :c:macro:NRF_802154_TX_ERROR_NO_ACK error code. +* If a time slot ends while waiting for or receiving an ACK frame, the transmission terminates with the :c:macro:`NRF_802154_TX_ERROR_NO_ACK` error code. This behavior allows the higher layer to distinguish between a frame that was not transmitted and a frame that was transmitted but did not receive an ACK frame. (KRKNWK-19126) -* When the nRF 802.15.4 Radio Driver prepares for a reception but no free buffer is left, the :c:func:`nrf_802154_receive_failed` callout is generated with a new error code :c:macro:NRF_802154_RX_ERROR_NO_BUFFER. (KRKNWK-19304) +* When the nRF 802.15.4 Radio Driver prepares for a reception but no free buffer is left, the :c:func:`nrf_802154_receive_failed` callout is generated with a new error code :c:macro:`NRF_802154_RX_ERROR_NO_BUFFER`. (KRKNWK-19304) * The default assignment of the DPPI channels on the nRF54L Series is changed so that the channels 14 and 15 are left unused for other purposes. (KRKNWK-19349) * The binaries of the nRF 802.15.4 SL library for the nRF54L15 SoC are provided also for the non-secure operation. (KRKNWK-19338) +* The internal implementation of *notification* module is selected by the :c:macro:`NRF_802154_NOTIFICATION_IMPL` configuration macro. + The internal implementation of *request* module is selected by the :c:macro:`NRF_802154_REQUEST_IMPL` configuration macro. + +Added +===== + +* Added the :c:macro:`NRF_802154_EGU_USED_CHANNELS_MASK` to inform about the fixed EGU channels used by the driver. (KRKNWK-19408) nRF Connect SDK v2.7.0 - nRF 802.15.4 Radio Driver ************************************************** diff --git a/nrf_802154/driver/CMakeLists.txt b/nrf_802154/driver/CMakeLists.txt index 3ba57a6040..fd3726e793 100644 --- a/nrf_802154/driver/CMakeLists.txt +++ b/nrf_802154/driver/CMakeLists.txt @@ -53,9 +53,13 @@ target_sources(nrf-802154-driver src/nrf_802154_critical_section.c src/nrf_802154_debug.c src/nrf_802154_encrypt.c + src/nrf_802154_notification_direct.c + src/nrf_802154_notification_swi.c src/nrf_802154_pib.c src/nrf_802154_peripherals_alloc.c src/nrf_802154_queue.c + src/nrf_802154_request_direct.c + src/nrf_802154_request_swi.c src/nrf_802154_rssi.c src/nrf_802154_rx_buffer.c src/nrf_802154_stats.c @@ -80,20 +84,6 @@ target_sources(nrf-802154-driver src/mac_features/ack_generator/nrf_802154_imm_ack_generator.c ) -if (SL_OPENSOURCE) - target_sources(nrf-802154-driver - PRIVATE - src/nrf_802154_notification_direct.c - src/nrf_802154_request_direct.c - ) -else () - target_sources(nrf-802154-driver - PRIVATE - src/nrf_802154_notification_swi.c - src/nrf_802154_request_swi.c - ) -endif () - if (SL_OPENSOURCE) target_compile_definitions(nrf-802154-driver-interface INTERFACE @@ -105,6 +95,10 @@ if (SL_OPENSOURCE) NRF_802154_IFS_ENABLED=0 # Disable CSMA-CA NRF_802154_CSMA_CA_ENABLED=0 + # Use nrf_802154_notification_direct.c implementation for "notification" module + NRF_802154_NOTIFICATION_IMPL=NRF_802154_NOTIFICATION_IMPL_DIRECT + # Use nrf_802154_request_direct.c implementation for "request" module + NRF_802154_REQUEST_IMPL=NRF_802154_REQUEST_IMPL_DIRECT ) endif() diff --git a/nrf_802154/driver/src/nrf_802154_notification_direct.c b/nrf_802154/driver/src/nrf_802154_notification_direct.c index ee3c1d07b5..24019e2af3 100644 --- a/nrf_802154/driver/src/nrf_802154_notification_direct.c +++ b/nrf_802154/driver/src/nrf_802154_notification_direct.c @@ -42,6 +42,8 @@ #include "nrf_802154_notification.h" +#if NRF_802154_NOTIFICATION_IMPL == NRF_802154_NOTIFICATION_IMPL_DIRECT + #include #include #include @@ -161,3 +163,5 @@ void nrf_802154_notify_cca_failed(nrf_802154_cca_error_t error) nrf_802154_log_function_exit(NRF_802154_LOG_VERBOSITY_LOW); } + +#endif /* NRF_802154_NOTIFICATION_IMPL == NRF_802154_NOTIFICATION_IMPL_DIRECT */ diff --git a/nrf_802154/driver/src/nrf_802154_notification_swi.c b/nrf_802154/driver/src/nrf_802154_notification_swi.c index 0ce70b0f00..bbe7309049 100644 --- a/nrf_802154/driver/src/nrf_802154_notification_swi.c +++ b/nrf_802154/driver/src/nrf_802154_notification_swi.c @@ -42,6 +42,8 @@ #include "nrf_802154_notification.h" +#if NRF_802154_NOTIFICATION_IMPL == NRF_802154_NOTIFICATION_IMPL_SWI + #include "nrf_802154_assert.h" #include #include @@ -54,6 +56,7 @@ #include "nrf_802154_queue.h" #include "nrf_802154_swi.h" #include "nrf_802154_tx_work_buffer.h" +#include "nrf_802154_peripherals.h" #include "nrf_802154_utils.h" #include "hal/nrf_egu.h" #include "rsch/nrf_802154_rsch.h" @@ -111,9 +114,12 @@ */ #define NTF_QUEUE_SIZE (NTF_PRIMARY_POOL_SIZE + NTF_SECONDARY_POOL_SIZE + 1) -#define NTF_INT NRF_EGU_INT_TRIGGERED0 ///< Label of notification interrupt. -#define NTF_TASK NRF_EGU_TASK_TRIGGER0 ///< Label of notification task. -#define NTF_EVENT NRF_EGU_EVENT_TRIGGERED0 ///< Label of notification event. +#define NTF_INT NRFX_CONCAT_2(NRF_EGU_INT_TRIGGERED, \ + NRF_802154_EGU_NOTIFICATION_CHANNEL_NO) +#define NTF_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \ + NRF_802154_EGU_NOTIFICATION_CHANNEL_NO) +#define NTF_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, \ + NRF_802154_EGU_NOTIFICATION_CHANNEL_NO) /// Types of notifications in notification queue. typedef enum @@ -800,3 +806,5 @@ void nrf_802154_notification_swi_module_reset(void) } #endif // defined(TEST) + +#endif /* NRF_802154_NOTIFICATION_IMPL == NRF_802154_NOTIFICATION_IMPL_SWI */ diff --git a/nrf_802154/driver/src/nrf_802154_peripherals.h b/nrf_802154/driver/src/nrf_802154_peripherals.h index 1e06fd1451..455c982805 100644 --- a/nrf_802154/driver/src/nrf_802154_peripherals.h +++ b/nrf_802154/driver/src/nrf_802154_peripherals.h @@ -171,6 +171,113 @@ extern "C" { #define NRF_802154_GPIOTE_CHANNELS_USED_MASK NRF_802154_DEBUG_GPIOTE_CHANNELS_USED_MASK #endif // NRF_802154_GPIOTE_CHANNELS_USED_MASK +/** + * @def NRF_802154_EGU_NOTIFICATION_USED_CHANNELS_MASK + * + * Mask of EGU channels used by the "notification" module. + * See @ref NRF_802154_EGU_USED_CHANNELS_MASK. + */ + +#if NRF_802154_NOTIFICATION_IMPL == NRF_802154_NOTIFICATION_IMPL_SWI +/** + * @def NRF_802154_EGU_NOTIFICATION_SWI_CHANNEL_NO + * + * The channel number of the @ref NRF_802154_EGU_INSTANCE used by the + * "swi" implementation of the "notification" module. + */ +#ifndef NRF_802154_EGU_NOTIFICATION_CHANNEL_NO +#define NRF_802154_EGU_NOTIFICATION_CHANNEL_NO 0 +#endif // NRF_802154_EGU_NOTIFICATION_SWI_CHANNEL_NO + +#define NRF_802154_EGU_NOTIFICATION_USED_CHANNELS_MASK \ + (1U << NRF_802154_EGU_NOTIFICATION_CHANNEL_NO) +#else +#define NRF_802154_EGU_NOTIFICATION_USED_CHANNELS_MASK 0U +#endif + +/** + * @def NRF_802154_EGU_REQUEST_USED_CHANNELS_MASK + * + * Mask of EGU channels used by the "request" module. + * See @ref NRF_802154_EGU_USED_CHANNELS_MASK. + */ + +#if NRF_802154_REQUEST_IMPL == NRF_802154_REQUEST_IMPL_SWI +/** + * @def NRF_802154_EGU_REQUEST_CHANNEL_NO + * + * The channel number of the @ref NRF_802154_EGU_INSTANCE used by the + * "swi" implementation of the "request" module. + */ +#ifndef NRF_802154_EGU_REQUEST_CHANNEL_NO +#define NRF_802154_EGU_REQUEST_CHANNEL_NO 2 +#endif // NRF_802154_EGU_REQUEST_CHANNEL_NO +#define NRF_802154_EGU_REQUEST_USED_CHANNELS_MASK (1U << NRF_802154_EGU_REQUEST_CHANNEL_NO) +#else +#define NRF_802154_EGU_REQUEST_USED_CHANNELS_MASK 0U +#endif + +/** + * @def NRF_802154_EGU_SYNC_CHANNEL_NO + * + * The channel number of the @ref NRF_802154_EGU_INSTANCE used for generation + * of an interrupt by the RADIO.EVENTS_SYNC event. + * + */ +#define NRF_802154_EGU_SYNC_CHANNEL_NO 3 + +/** + * @def NRF_802154_EGU_SYNC_USED_CHANNELS_MASK + * + * Mask of EGU channels used by the interrupt generation from the RADIO.EVENTS_SYNC event. + * See @ref NRF_802154_EGU_USED_CHANNELS_MASK. + */ +#define NRF_802154_EGU_SYNC_USED_CHANNELS_MASK (1U << NRF_802154_EGU_SYNC_CHANNEL_NO) + +/** + * @def NRF_802154_EGU_RAMP_UP_CHANNEL_NO + * + * The channel number of the @ref NRF_802154_EGU_INSTANCE used for triggering the ramp-up of the RADIO. + */ +#define NRF_802154_EGU_RAMP_UP_CHANNEL_NO 15 + +/** + * @def NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK + * + * Mask of EGU channels used for triggering the ramp-up of the RADIO. + * See @ref NRF_802154_EGU_USED_CHANNELS_MASK. + */ +#define NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_RAMP_UP_CHANNEL_NO) + +/** + * @def NRF_802154_EGU_RAMP_UP_EVENT + * + * The EGU event used by the driver to trigger radio ramp-up. + */ +#define NRF_802154_EGU_RAMP_UP_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, \ + NRF_802154_EGU_RAMP_UP_CHANNEL_NO) + +/** + * @def NRF_802154_EGU_RAMP_UP_TASK + * + * The EGU task used by the driver to trigger radio ramp-up. + */ +#define NRF_802154_EGU_RAMP_UP_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \ + NRF_802154_EGU_RAMP_UP_CHANNEL_NO) + +/** + * @def NRF_802154_EGU_CHANNELS_MASK + * + * The mask of fixed channels of the @ref NRF_802154_EGU_INSTANCE used by the + * nRF 802.15.4 Radio Driver. + */ +#define NRF_802154_EGU_USED_CHANNELS_MASK \ + (NRF_802154_EGU_NOTIFICATION_USED_CHANNELS_MASK | \ + NRF_802154_EGU_REQUEST_USED_CHANNELS_MASK | \ + NRF_802154_EGU_SYNC_USED_CHANNELS_MASK | \ + NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK | \ + NRF_802154_SL_EGU_USED_CHANNELS_MASK) + #ifdef __cplusplus } #endif diff --git a/nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h b/nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h index f52525201e..3295722ed1 100644 --- a/nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h +++ b/nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h @@ -44,6 +44,7 @@ #include "nrf_802154_config.h" #include "nrf_802154_debug.h" #include "hal/nrf_ppi.h" +#include "nrf_802154_sl_periphs.h" #ifdef __cplusplus extern "C" { @@ -58,7 +59,7 @@ extern "C" { */ #ifndef NRF_802154_EGU_INSTANCE_NO -#define NRF_802154_EGU_INSTANCE_NO 3 +#define NRF_802154_EGU_INSTANCE_NO 0 #endif // NRF_802154_EGU_INSTANCE_NO @@ -221,49 +222,6 @@ extern "C" { #define NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK \ (1 << NRF_802154_PPI_RADIO_SYNC_TO_EGU_SYNC) -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED - -/** - * @def NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE - * - * The PPI channel that connects LP timer's COMPARE event to HP timer's TIMER_CAPTURE task. - * - * @note This option is used only when the timestamping feature is enabled - * (see @ref NRF_802154_FRAME_TIMESTAMP_ENABLED). - * - */ -#ifndef NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE -#define NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE NRF_PPI_CHANNEL13 -#endif - -/** - * @def NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE - * - * The PPI channel that connects provided event to HP timer's TIMER_CAPTURE task. - * - * @note This option is used only when the timestamping feature is enabled - * (see @ref NRF_802154_FRAME_TIMESTAMP_ENABLED). - * - */ -#ifndef NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE -#define NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE NRF_PPI_CHANNEL14 -#endif - -/** - * @def NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK - * - * Helper bit mask of PPI channels used by the 802.15.4 driver for timestamping. - */ -#define NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK \ - ((1 << NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE) | \ - (1 << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE)) - -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED - -#define NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK 0 - -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - /** * @def NRF_802154_PPI_CORE_GROUP * @@ -310,7 +268,7 @@ extern "C" { (1 << NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN) | \ (1 << NRF_802154_PPI_RADIO_CCABUSY_TO_RADIO_CCASTART) | \ NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK | \ - NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK | \ + NRF_802154_SL_PPI_CHANNELS_USED_MASK | \ NRF_802154_DEBUG_PPI_CHANNELS_USED_MASK) #endif // NRF_802154_PPI_CHANNELS_USED_MASK diff --git a/nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h b/nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h index e21107f110..32fc395987 100644 --- a/nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h +++ b/nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h @@ -82,20 +82,6 @@ extern "C" { #define NRF_802154_EGU_IRQ_HANDLER \ NRFX_CONCAT_3(EGU, NRF_802154_EGU_INSTANCE_NO, _IRQHandler) -/** - * @def NRF_802154_EGU_RAMP_UP_EVENT - * - * The EGU event used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_EVENT NRF_EGU_EVENT_TRIGGERED15 - -/** - * @def NRF_802154_EGU_RAMP_UP_TASK - * - * The EGU task used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_TASK NRF_EGU_TASK_TRIGGER15 - /** * @def NRF_802154_EGU_USED_MASK * @@ -254,19 +240,6 @@ extern "C" { #define NRF_802154_DPPI_RADIO_HW_TRIGGER 15U #endif -/** - * @def NRF_802154_DPPI_TIMESTAMPS_USED_MASK - * - * Helper bit mask of DPPI channels used by the 802.15.4 driver for timestamping. - */ -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK \ - ((1UL << NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE) | \ - (1UL << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE)) -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK 0U -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - /** * @def NRF_802154_DPPI_CHANNELS_USED_MASK * @@ -286,7 +259,7 @@ extern "C" { (1UL << NRF_802154_DPPI_RADIO_CCABUSY) | \ (1UL << NRF_802154_DPPI_RADIO_HW_TRIGGER) | \ NRF_802154_DPPI_RADIO_TEST_MODE_USED_MASK | \ - NRF_802154_DPPI_TIMESTAMPS_USED_MASK) + NRF_802154_SL_PPI_CHANNELS_USED_MASK) #endif // NRF_802154_DPPI_CHANNELS_USED_MASK /** diff --git a/nrf_802154/driver/src/nrf_802154_peripherals_nrf54h.h b/nrf_802154/driver/src/nrf_802154_peripherals_nrf54h.h index 490cdfafb1..c410d0fae3 100644 --- a/nrf_802154/driver/src/nrf_802154_peripherals_nrf54h.h +++ b/nrf_802154/driver/src/nrf_802154_peripherals_nrf54h.h @@ -81,20 +81,6 @@ extern "C" { #define NRF_802154_EGU_IRQ_HANDLER \ NRFX_CONCAT_3(EGU, NRF_802154_EGU_INSTANCE_NO, _IRQHandler) -/** - * @def NRF_802154_EGU_RAMP_UP_EVENT - * - * The EGU event used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_EVENT NRF_EGU_EVENT_TRIGGERED15 - -/** - * @def NRF_802154_EGU_RAMP_UP_TASK - * - * The EGU task used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_TASK NRF_EGU_TASK_TRIGGER15 - /** * @def NRF_802154_EGU_USED_MASK * @@ -274,18 +260,6 @@ extern "C" { #define NRF_802154_DPPI_RADIO_HW_TRIGGER 15U #endif -/** - * @def NRF_802154_DPPI_TIMESTAMPS_USED_MASK - * - * Helper bit mask of DPPI channels used by the 802.15.4 driver for timestamping. - */ -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK \ - (1UL << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE) -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK 0U -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - /** * @def NRF_802154_DPPI_CHANNELS_USED_MASK * @@ -304,7 +278,7 @@ extern "C" { (1UL << NRF_802154_DPPI_RADIO_CCAIDLE) | \ (1UL << NRF_802154_DPPI_RADIO_CCABUSY) | \ (1UL << NRF_802154_DPPI_RADIO_HW_TRIGGER) | \ - NRF_802154_DPPI_TIMESTAMPS_USED_MASK) + NRF_802154_SL_PPI_CHANNELS_USED_MASK) #endif // NRF_802154_DPPI_CHANNELS_USED_MASK /** diff --git a/nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h b/nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h index c95fc59f89..c25b631b4c 100644 --- a/nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h +++ b/nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h @@ -81,20 +81,6 @@ extern "C" { #define NRF_802154_EGU_IRQ_HANDLER \ NRFX_CONCAT_3(EGU, NRF_802154_EGU_INSTANCE_NO, _IRQHandler) -/** - * @def NRF_802154_EGU_RAMP_UP_EVENT - * - * The EGU event used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_EVENT NRF_EGU_EVENT_TRIGGERED15 - -/** - * @def NRF_802154_EGU_RAMP_UP_TASK - * - * The EGU task used by the driver to trigger radio ramp-up. - */ -#define NRF_802154_EGU_RAMP_UP_TASK NRF_EGU_TASK_TRIGGER15 - /** * @def NRF_802154_EGU_USED_MASK * @@ -274,18 +260,6 @@ extern "C" { #define NRF_802154_DPPI_RADIO_HW_TRIGGER 10U #endif -/** - * @def NRF_802154_DPPI_TIMESTAMPS_USED_MASK - * - * Helper bit mask of DPPI channels used by the 802.15.4 driver for timestamping. - */ -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK \ - (1UL << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE) -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_DPPI_TIMESTAMPS_USED_MASK 0U -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - /** * @def NRF_802154_DPPI_CHANNELS_USED_MASK * @@ -304,7 +278,7 @@ extern "C" { (1UL << NRF_802154_DPPI_RADIO_CCAIDLE) | \ (1UL << NRF_802154_DPPI_RADIO_CCABUSY) | \ (1UL << NRF_802154_DPPI_RADIO_HW_TRIGGER) | \ - NRF_802154_DPPI_TIMESTAMPS_USED_MASK) + NRF_802154_SL_PPI_CHANNELS_USED_MASK) #endif // NRF_802154_DPPI_CHANNELS_USED_MASK /** diff --git a/nrf_802154/driver/src/nrf_802154_request_direct.c b/nrf_802154/driver/src/nrf_802154_request_direct.c index 781745430d..30b259c60d 100644 --- a/nrf_802154/driver/src/nrf_802154_request_direct.c +++ b/nrf_802154/driver/src/nrf_802154_request_direct.c @@ -40,6 +40,8 @@ #include "nrf_802154_request.h" +#if NRF_802154_REQUEST_IMPL == NRF_802154_REQUEST_IMPL_DIRECT + #include #include @@ -198,3 +200,5 @@ bool nrf_802154_request_csma_ca_start(uint8_t { REQUEST_FUNCTION_PARMS(nrf_802154_csma_ca_start, p_data, p_metadata); } + +#endif /* NRF_802154_REQUEST_IMPL == NRF_802154_REQUEST_IMPL_DIRECT */ diff --git a/nrf_802154/driver/src/nrf_802154_request_swi.c b/nrf_802154/driver/src/nrf_802154_request_swi.c index fe1b43a6b4..8f74dd65b1 100644 --- a/nrf_802154/driver/src/nrf_802154_request_swi.c +++ b/nrf_802154/driver/src/nrf_802154_request_swi.c @@ -40,6 +40,8 @@ #include "nrf_802154_request.h" +#if NRF_802154_REQUEST_IMPL == NRF_802154_REQUEST_IMPL_SWI + #include "nrf_802154_assert.h" #include #include @@ -47,6 +49,7 @@ #include "nrf_802154_config.h" #include "nrf_802154_core.h" #include "nrf_802154_critical_section.h" +#include "nrf_802154_peripherals.h" #include "nrf_802154_queue.h" #include "nrf_802154_rx_buffer.h" #include "nrf_802154_swi.h" @@ -65,9 +68,9 @@ */ #define REQ_QUEUE_SIZE 2 -#define REQ_INT NRF_EGU_INT_TRIGGERED2 ///< Label of request interrupt. -#define REQ_TASK NRF_EGU_TASK_TRIGGER2 ///< Label of request task. -#define REQ_EVENT NRF_EGU_EVENT_TRIGGERED2 ///< Label of request event. +#define REQ_INT NRFX_CONCAT_2(NRF_EGU_INT_TRIGGERED, NRF_802154_EGU_REQUEST_CHANNEL_NO) +#define REQ_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, NRF_802154_EGU_REQUEST_CHANNEL_NO) +#define REQ_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, NRF_802154_EGU_REQUEST_CHANNEL_NO) /// Type of requests in request queue. typedef enum @@ -963,3 +966,5 @@ void nrf_802154_request_swi_irq_handler(void) irq_handler_req_event(); } } + +#endif /* NRF_802154_REQUEST_IMPL == NRF_802154_REQUEST_IMPL_SWI */ diff --git a/nrf_802154/driver/src/nrf_802154_trx.c b/nrf_802154/driver/src/nrf_802154_trx.c index 43a585e32b..1a71b8516b 100644 --- a/nrf_802154/driver/src/nrf_802154_trx.c +++ b/nrf_802154/driver/src/nrf_802154_trx.c @@ -68,9 +68,9 @@ #include "nrf_802154_trx_internal.h" #endif -#define EGU_SYNC_EVENT NRF_EGU_EVENT_TRIGGERED3 -#define EGU_SYNC_TASK NRF_EGU_TASK_TRIGGER3 -#define EGU_SYNC_INTMASK NRF_EGU_INT_TRIGGERED3 +#define EGU_SYNC_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, NRF_802154_EGU_SYNC_CHANNEL_NO) +#define EGU_SYNC_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, NRF_802154_EGU_SYNC_CHANNEL_NO) +#define EGU_SYNC_INTMASK NRFX_CONCAT_2(NRF_EGU_INT_TRIGGERED, NRF_802154_EGU_SYNC_CHANNEL_NO) #if defined(DPPI_PRESENT) #define RADIO_BASE NRF_RADIO_NS_BASE diff --git a/nrf_802154/driver/src/nrf_802154_trx_ppi.c b/nrf_802154/driver/src/nrf_802154_trx_ppi.c index d2ca559cdc..ef5e2d13e0 100644 --- a/nrf_802154/driver/src/nrf_802154_trx_ppi.c +++ b/nrf_802154/driver/src/nrf_802154_trx_ppi.c @@ -52,8 +52,8 @@ #include "hal/nrf_radio.h" #include "hal/nrf_timer.h" -#define EGU_EVENT NRF_EGU_EVENT_TRIGGERED15 -#define EGU_TASK NRF_EGU_TASK_TRIGGER15 +#define EGU_EVENT NRF_802154_EGU_RAMP_UP_EVENT +#define EGU_TASK NRF_802154_EGU_RAMP_UP_TASK #define PPI_CHGRP_RAMP_UP NRF_802154_PPI_CORE_GROUP ///< PPI group used to disable self-disabling PPIs #define PPI_CHGRP_RAMP_UP_DIS_TASK NRF_PPI_TASK_CHG0_DIS ///< PPI task used to disable self-disabling PPIs diff --git a/nrf_802154/sl/sl/CMakeLists.txt b/nrf_802154/sl/sl/CMakeLists.txt index bdaf7ca004..943fa3d40f 100644 --- a/nrf_802154/sl/sl/CMakeLists.txt +++ b/nrf_802154/sl/sl/CMakeLists.txt @@ -22,4 +22,6 @@ target_link_libraries(nrf-802154-sl ${NRF_802154_SL_LIB_PATH}/libnrf-802154-sl.a ) +target_include_directories(nrf-802154-driver-interface INTERFACE include) + endif () diff --git a/nrf_802154/sl/include/nrf_802154_sl_periphs.h b/nrf_802154/sl/sl/include/nrf_802154_sl_periphs.h similarity index 70% rename from nrf_802154/sl/include/nrf_802154_sl_periphs.h rename to nrf_802154/sl/sl/include/nrf_802154_sl_periphs.h index 6fcbe9b35d..956c70b45b 100644 --- a/nrf_802154/sl/include/nrf_802154_sl_periphs.h +++ b/nrf_802154/sl/sl/include/nrf_802154_sl_periphs.h @@ -1,39 +1,11 @@ /* - * Copyright (c) 2020, Nordic Semiconductor ASA - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - * 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. + * Copyright (c) 2020 Nordic Semiconductor ASA * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ /** - * @file Module that defines the 802.15.4 driver peripheral usage. + * @file Module that defines the peripherals used by the nRF 802.15.4 SL. * */ @@ -63,21 +35,33 @@ #endif #endif +#if defined(NRF53_SERIES) /** * @def NRF_802154_EGU_INSTANCE * - * The EGU instance used by the driver to synchronize PPIs and for requests and notifications if - * SWI is in use. + * The EGU instance used by the nRF 802.15.4 SL. * - * @note This option is used by the core module regardless of the driver configuration. + * @note This option is used on nRF53 series SoCs only. * */ -#define NRF_802154_EGU_INSTANCE NRFX_CONCAT_2(NRF_EGU, NRF_802154_EGU_INSTANCE_NO) +#define NRF_802154_EGU_INSTANCE NRFX_CONCAT_2(NRF_EGU, \ + NRF_802154_EGU_INSTANCE_NO) /** * @def NRF_802154_EGU_TIMESTAMP_CHANNEL + * + * The EGU channel number of the @ref NRF_802154_EGU_INSTANCE instance used by the time stamping feature. + * + * @note This option is used on nRF53 series SoCs only. + * */ -#define NRF_802154_EGU_TIMESTAMP_CHANNEL 4 +#define NRF_802154_EGU_TIMESTAMP_CHANNEL 4 + +#define NRF_802154_SL_EGU_TIMESTAMP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_TIMESTAMP_CHANNEL) + +#else +#define NRF_802154_SL_EGU_TIMESTAMP_USED_CHANNELS_MASK 0U +#endif /** * @def NRF_802154_RTC_INSTANCE_NO @@ -178,11 +162,11 @@ #endif /** - * @def NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK + * @def NRF_802154_SL_PPI_CHANNELS_USED_MASK * - * Helper bit mask of PPI channels used by the 802.15.4 driver for timestamping. + * Mask of fixed (D)PPI channels used by the nRF 802.15.4 SL. */ -#define NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK \ +#define NRF_802154_SL_PPI_CHANNELS_USED_MASK \ ((1 << NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE) | \ (1 << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE)) @@ -203,6 +187,22 @@ #endif #endif +/** + * @def NRF_802154_SL_PPI_GROUPS_USED_MASK + * + * Mask of fixed (D)PPI groups used by the nRF 802.15.4 SL. + */ +#define NRF_802154_SL_PPI_GROUPS_USED_MASK \ + (1U << NRF_802154_PPI_TIMESTAMP_GROUP) + +/** + * @def NRF_802154_SL_EGU_USED_CHANNELS_MASK + * + * Mask of fixed EGU channels used by the nRF 802.15.4 SL. + */ +#define NRF_802154_SL_EGU_USED_CHANNELS_MASK \ + NRF_802154_SL_EGU_TIMESTAMP_USED_CHANNELS_MASK + #if defined(NRF54L_SERIES) /** * @def NRF_802154_SL_DPPIC_INSTANCE_NO diff --git a/nrf_802154/sl/sl/lib/nrf52833/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52833/hard-float/libnrf-802154-sl.a index 85e5625ac0..6b4fdf4b7a 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52833/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52833/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf52833/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52833/soft-float/libnrf-802154-sl.a index 6be94c6dfe..631f8f8443 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52833/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52833/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf52833/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52833/softfp-float/libnrf-802154-sl.a index a88b6b10b2..19191d3c21 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52833/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52833/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf52840/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52840/hard-float/libnrf-802154-sl.a index 85e5625ac0..6b4fdf4b7a 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52840/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52840/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf52840/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52840/soft-float/libnrf-802154-sl.a index 6be94c6dfe..631f8f8443 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52840/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52840/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf52840/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf52840/softfp-float/libnrf-802154-sl.a index a88b6b10b2..19191d3c21 100644 Binary files a/nrf_802154/sl/sl/lib/nrf52840/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf52840/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf5340_cpunet/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf5340_cpunet/soft-float/libnrf-802154-sl.a index f3128b3b7f..7e1905712c 100644 Binary files a/nrf_802154/sl/sl/lib/nrf5340_cpunet/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf5340_cpunet/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/hard-float/libnrf-802154-sl.a index 5f771bc2ff..b5b8e0f7e7 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/soft-float/libnrf-802154-sl.a index 5f771bc2ff..b5b8e0f7e7 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/softfp-float/libnrf-802154-sl.a index 5f771bc2ff..b5b8e0f7e7 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54h20_cpurad/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54h20_cpurad/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a index 68bb89c26b..b1235fd562 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a index 58961d9796..a3aefb73fc 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a index 9158d9afa5..6fd8612c6d 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/hard-float/libnrf-802154-sl.a index 9340676066..63f39c1bd4 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/soft-float/libnrf-802154-sl.a index b2b3aa74f9..c597df9d8d 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/softfp-float/libnrf-802154-sl.a index 4c360c3228..3c11cae9aa 100644 Binary files a/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp_ns/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl_opensource/include/nrf_802154_sl_periphs.h b/nrf_802154/sl/sl_opensource/include/nrf_802154_sl_periphs.h new file mode 100644 index 0000000000..e8df3be6bc --- /dev/null +++ b/nrf_802154/sl/sl_opensource/include/nrf_802154_sl_periphs.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @file Module that defines the peripherals used by the nRF 802.15.4 SL. + * + */ + +#ifndef NRF_802154_SL_PERIPHS_H__ +#define NRF_802154_SL_PERIPHS_H__ + +#include + +#if NRF_802154_USE_INTERNAL_INCLUDES +#include "nrf_802154_sl_periphs_internal.h" +#endif + +#define NRF_802154_SL_PPI_CHANNELS_USED_MASK 0U +#define NRF_802154_SL_PPI_GROUPS_USED_MASK 0U +#define NRF_802154_SL_EGU_USED_CHANNELS_MASK 0U + +#endif // NRF_802154_SL_PERIPHS_H__