From 18e4a1a9e7fe54f8149af3133af26fd7cda0fd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 15 Oct 2024 14:33:31 +0200 Subject: [PATCH] align to new DPPI API --- .../src/modules/audio_sync_timer.c | 18 ++++++++++-------- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf5340dk_nrf5340_cpunet.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpunet_hci.conf | 2 +- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 5 ++++- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 +++++- .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 5 ++++- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 5 ++++- subsys/debug/cpu_load/cpu_load.c | 7 +++++-- subsys/debug/ppi_trace/ppi_trace.c | 6 +++++- subsys/dm/dm.c | 5 ++++- subsys/mpsl/fem/common/mpsl_fem_utils.c | 6 +++++- .../mpsl/pin_debug/mpsl_pin_debug_radio_core.c | 10 ++++++---- .../subsys/debug/cpu_load/src/test_cpu_load.c | 6 ++++-- 22 files changed, 82 insertions(+), 34 deletions(-) diff --git a/applications/nrf5340_audio/src/modules/audio_sync_timer.c b/applications/nrf5340_audio/src/modules/audio_sync_timer.c index 6b2ef7b8fafc..855b8046c621 100644 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ b/applications/nrf5340_audio/src/modules/audio_sync_timer.c @@ -51,6 +51,8 @@ static uint8_t dppi_channel_timer_sync_with_rtc; static uint8_t dppi_channel_rtc_start; static volatile uint32_t num_rtc_overflows; +static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + static nrfx_timer_config_t cfg = {.frequency = NRFX_MHZ_TO_HZ(1UL), .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_32, @@ -161,7 +163,7 @@ static int audio_sync_timer_init(void) nrfx_rtc_overflow_enable(&audio_sync_lf_timer_instance, true); /* Initialize capturing of I2S frame start event timestamps */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_i2s_frame_start); + ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_i2s_frame_start); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret); return -ENOMEM; @@ -177,14 +179,14 @@ static int audio_sync_timer_init(void) dppi_channel_i2s_frame_start); nrf_i2s_publish_set(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART, dppi_channel_i2s_frame_start); - ret = nrfx_dppi_channel_enable(dppi_channel_i2s_frame_start); + ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_i2s_frame_start); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel enable error (I2S frame start): %d", ret); return -EIO; } /* Initialize capturing of current timestamps */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_curr_time_capture); + ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_curr_time_capture); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel alloc error (I2S frame start) - Return value: %d", ret); return -ENOMEM; @@ -200,14 +202,14 @@ static int audio_sync_timer_init(void) nrf_egu_publish_set(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0, dppi_channel_curr_time_capture); - ret = nrfx_dppi_channel_enable(dppi_channel_curr_time_capture); + ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_curr_time_capture); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel enable error (I2S frame start) - Return value: %d", ret); return -EIO; } /* Initialize functionality for synchronization between APP and NET core */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_rtc_start); + ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_rtc_start); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret); return -ENOMEM; @@ -222,14 +224,14 @@ static int audio_sync_timer_init(void) NRF_IPC_CHANNEL_4); nrf_ipc_publish_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT, dppi_channel_rtc_start); - ret = nrfx_dppi_channel_enable(dppi_channel_rtc_start); + ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_rtc_start); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret); return -EIO; } /* Initialize functionality for synchronization between RTC and TIMER */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_timer_sync_with_rtc); + ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_timer_sync_with_rtc); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret); return -ENOMEM; @@ -242,7 +244,7 @@ static int audio_sync_timer_init(void) nrfx_rtc_tick_enable(&audio_sync_lf_timer_instance, false); - ret = nrfx_dppi_channel_enable(dppi_channel_timer_sync_with_rtc); + ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_timer_sync_with_rtc); if (ret - NRFX_ERROR_BASE_NUM) { LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret); return -EIO; diff --git a/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 5239e095884a..11ea3913da9f 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -6,4 +6,4 @@ CONFIG_NRFX_TIMER0=y CONFIG_NRFX_RTC0=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y diff --git a/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf index 5239e095884a..11ea3913da9f 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -6,4 +6,4 @@ CONFIG_NRFX_TIMER0=y CONFIG_NRFX_RTC0=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y diff --git a/samples/bluetooth/conn_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 9965db474f2b..c1a3e375e9a4 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,5 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/samples/bluetooth/conn_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/conn_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 9965db474f2b..c1a3e375e9a4 100644 --- a/samples/bluetooth/conn_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/conn_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -4,5 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.conf b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.conf index dbcdbce33edb..03d38a1e84e3 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.conf @@ -9,6 +9,6 @@ CONFIG_IPC_SERVICE=y CONFIG_IPC_SERVICE_BACKEND_RPMSG=y CONFIG_MBOX=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf index baa0ecf83459..9c1f23b061e0 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf @@ -8,7 +8,7 @@ CONFIG_IPC_SERVICE=y CONFIG_IPC_SERVICE_BACKEND_RPMSG=y CONFIG_MBOX=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 48b14dda825a..3c0c96e9979c 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,4 +12,7 @@ CONFIG_NRFX_TIMER2=n # Use necessary peripherals CONFIG_NRFX_TIMER20=y CONFIG_NRFX_TIMER10=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 042fa8a9bf9b..75d1ec86d38a 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -12,4 +12,7 @@ CONFIG_NRFX_TIMER2=n # Use necessary peripherals CONFIG_NRFX_TIMER20=y CONFIG_NRFX_TIMER10=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 5239e095884a..11ea3913da9f 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -6,4 +6,4 @@ CONFIG_NRFX_TIMER0=y CONFIG_NRFX_RTC0=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf index 5239e095884a..11ea3913da9f 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -6,4 +6,4 @@ CONFIG_NRFX_TIMER0=y CONFIG_NRFX_RTC0=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI0=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 9965db474f2b..c1a3e375e9a4 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -4,5 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 9965db474f2b..c1a3e375e9a4 100644 --- a/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -4,5 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y CONFIG_BT_RX_STACK_SIZE=2048 diff --git a/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 535150595933..de1fc8626df1 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -11,7 +11,11 @@ CONFIG_PTT_CACHE_MGMT=n # nrfx drivers configuration: CONFIG_NRFX_TIMER20=y # enable TIMER2 -CONFIG_NRFX_DPPI=y # enable DPPIC +# enable DPPIC +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y # Set temperature sensor update period in ms CONFIG_NRF_802154_TEMPERATURE_UPDATE_PERIOD=10000 diff --git a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf index e9be522c1fbe..67fed631f576 100644 --- a/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -9,4 +9,7 @@ CONFIG_NRFX_TIMER0=n # Enable the necessary drivers CONFIG_NRFX_TIMER10=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y diff --git a/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 35ec907203d2..b7af099bcabe 100644 --- a/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -9,4 +9,7 @@ CONFIG_NRFX_TIMER0=n # Enable the necessary drivers CONFIG_NRFX_TIMER10=y -CONFIG_NRFX_DPPI=y +CONFIG_NRFX_DPPI00=y +CONFIG_NRFX_DPPI10=y +CONFIG_NRFX_DPPI20=y +CONFIG_NRFX_DPPI30=y diff --git a/subsys/debug/cpu_load/cpu_load.c b/subsys/debug/cpu_load/cpu_load.c index a4613bd166c5..5463d4f005fe 100644 --- a/subsys/debug/cpu_load/cpu_load.c +++ b/subsys/debug/cpu_load/cpu_load.c @@ -42,6 +42,9 @@ static uint32_t shared_ch_mask; (IS_ENABLED(CONFIG_CPU_LOAD_USE_SHARED_DPPI_CHANNELS) && \ (BIT(ch) & shared_ch_mask)) +#ifdef DPPI_PRESENT +static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); +#endif /** @brief Allocate (D)PPI channel. */ static nrfx_err_t ppi_alloc(uint8_t *ch, uint32_t evt) @@ -60,7 +63,7 @@ static nrfx_err_t ppi_alloc(uint8_t *ch, uint32_t evt) err = NRFX_SUCCESS; shared_ch_mask |= BIT(*ch); } else { - err = nrfx_dppi_channel_alloc(ch); + err = nrfx_dppi_channel_alloc(&dppi, ch); } #else err = nrfx_ppi_channel_alloc((nrf_ppi_channel_t *)ch); @@ -73,7 +76,7 @@ static nrfx_err_t ppi_free(uint8_t ch) #ifdef DPPI_PRESENT if (!IS_ENABLED(CONFIG_CPU_LOAD_USE_SHARED_DPPI_CHANNELS) || ((BIT(ch) & shared_ch_mask) == 0)) { - return nrfx_dppi_channel_free(ch); + return nrfx_dppi_channel_free(&dppi, ch); } else { return NRFX_SUCCESS; } diff --git a/subsys/debug/ppi_trace/ppi_trace.c b/subsys/debug/ppi_trace/ppi_trace.c index 2108d137cbdb..54bbb6584e4e 100644 --- a/subsys/debug/ppi_trace/ppi_trace.c +++ b/subsys/debug/ppi_trace/ppi_trace.c @@ -51,6 +51,10 @@ LOG_MODULE_REGISTER(ppi_trace, CONFIG_PPI_TRACE_LOG_LEVEL); [DT_PROP(gpio_node, port)] = \ NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)), +#ifdef DPPI_PRESENT +static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); +#endif + static const nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin) { static const nrfx_gpiote_t gpiote[GPIO_COUNT] = { @@ -73,7 +77,7 @@ static nrfx_err_t ppi_alloc(uint8_t *ch, uint32_t evt) *ch = *PUBLISH_ADDR(evt) & DPPIC_SUBSCRIBE_CHG_EN_CHIDX_Msk; err = NRFX_SUCCESS; } else { - err = nrfx_dppi_channel_alloc(ch); + err = nrfx_dppi_channel_alloc(&dppi, ch); } #else err = nrfx_ppi_channel_alloc((nrf_ppi_channel_t *)ch); diff --git a/subsys/dm/dm.c b/subsys/dm/dm.c index 1d2567a07a98..a128aeba92fd 100644 --- a/subsys/dm/dm.c +++ b/subsys/dm/dm.c @@ -25,8 +25,11 @@ #if defined(DPPI_PRESENT) #include + +static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + #define gppi_channel_t uint8_t -#define gppi_channel_alloc nrfx_dppi_channel_alloc +#define gppi_channel_alloc(x) nrfx_dppi_channel_alloc(&dppi, x) #else #include #define gppi_channel_t nrf_ppi_channel_t diff --git a/subsys/mpsl/fem/common/mpsl_fem_utils.c b/subsys/mpsl/fem/common/mpsl_fem_utils.c index 6098596a2b04..f258fa1288f2 100644 --- a/subsys/mpsl/fem/common/mpsl_fem_utils.c +++ b/subsys/mpsl/fem/common/mpsl_fem_utils.c @@ -16,6 +16,10 @@ #include #endif +#ifdef DPPI_PRESENT +static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); +#endif + int mpsl_fem_utils_ppi_channel_alloc(uint8_t *ppi_channels, size_t size) { nrfx_err_t err = NRFX_ERROR_NOT_SUPPORTED; @@ -24,7 +28,7 @@ int mpsl_fem_utils_ppi_channel_alloc(uint8_t *ppi_channels, size_t size) IF_ENABLED(CONFIG_HAS_HW_NRF_PPI, (err = nrfx_ppi_channel_alloc(&ppi_channels[i]);)); IF_ENABLED(CONFIG_HAS_HW_NRF_DPPIC, - (err = nrfx_dppi_channel_alloc(&ppi_channels[i]);)); + (err = nrfx_dppi_channel_alloc(&dppi, &ppi_channels[i]);)); if (err != NRFX_SUCCESS) { return -ENOMEM; } diff --git a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c index 9d1f8110c6a2..bb464f0aa9ee 100644 --- a/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c +++ b/subsys/mpsl/pin_debug/mpsl_pin_debug_radio_core.c @@ -103,12 +103,14 @@ static int m_ppi_config(void) uint8_t dppi_chan_ready_disabled; uint8_t dppi_chan_address_end; - if (nrfx_dppi_channel_alloc(&dppi_chan_ready_disabled) != NRFX_SUCCESS) { + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + + if (nrfx_dppi_channel_alloc(&dppi, &dppi_chan_ready_disabled) != NRFX_SUCCESS) { LOG_ERR("Failed allocating DPPI chan"); return -ENOMEM; } - if (nrfx_dppi_channel_alloc(&dppi_chan_address_end) != NRFX_SUCCESS) { + if (nrfx_dppi_channel_alloc(&dppi, &dppi_chan_address_end) != NRFX_SUCCESS) { LOG_ERR("Failed allocating DPPI chan"); return -ENOMEM; } @@ -132,12 +134,12 @@ static int m_ppi_config(void) nrfx_gpiote_out_task_address_get(&gpiote, CONFIG_MPSL_PIN_DEBUG_RADIO_ADDRESS_AND_END_PIN)); - if (nrfx_dppi_channel_enable(dppi_chan_ready_disabled) != NRFX_SUCCESS) { + if (nrfx_dppi_channel_enable(&dppi, dppi_chan_ready_disabled) != NRFX_SUCCESS) { LOG_ERR("Failed enabling channel"); return -ENOMEM; } - if (nrfx_dppi_channel_enable(dppi_chan_address_end) != NRFX_SUCCESS) { + if (nrfx_dppi_channel_enable(&dppi, dppi_chan_address_end) != NRFX_SUCCESS) { LOG_ERR("Failed enabling channel"); return -ENOMEM; } diff --git a/tests/subsys/debug/cpu_load/src/test_cpu_load.c b/tests/subsys/debug/cpu_load/src/test_cpu_load.c index d7909a0dfba9..d623c96ee757 100644 --- a/tests/subsys/debug/cpu_load/src/test_cpu_load.c +++ b/tests/subsys/debug/cpu_load/src/test_cpu_load.c @@ -46,10 +46,12 @@ ZTEST(cpu_load, test_cpu_load) config.frequency = NRFX_MHZ_TO_HZ(1); config.bit_width = NRF_TIMER_BIT_WIDTH_32; + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + err = nrfx_timer_init(&timer, &config, timer_handler); zassert_equal(err, NRFX_SUCCESS, "Unexpected error:%d", err); - err = nrfx_dppi_channel_alloc(&ch); + err = nrfx_dppi_channel_alloc(&dppi, &ch); zassert_equal(err, NRFX_SUCCESS, "Unexpected error:%d", err); nrfx_gppi_channel_endpoints_setup(ch, evt, tsk); @@ -62,7 +64,7 @@ ZTEST(cpu_load, test_cpu_load) nrfx_gppi_channels_disable(BIT(ch)); nrfx_gppi_event_endpoint_clear(ch, evt); nrfx_gppi_task_endpoint_clear(ch, tsk); - err = nrfx_dppi_channel_free(ch); + err = nrfx_dppi_channel_free(&dppi, ch); } #endif