Skip to content

Commit 839e86e

Browse files
grochuanangl
authored andcommitted
esb: Fix DPPIC instance selection for nRF54 SoCs
So far when building for nRF54L15 static DPPI channels were assigned. After adding nRF54L15 support in the DPPI driver this code is unused for nRF54L15 and the common DPPI allocator used hardcoded DPPIC instance. This commit parameterizes the DDPIC instance number depending on the SoC and enables the coresponding instances in the ESB samples' configurations. ESB uses hardcoded instance number per SoC. TODO: Allow selection of the DPPIC instance in one place e.g. Kconfig based on the DTS. Signed-off-by: Michał Grochala <[email protected]>
1 parent b731768 commit 839e86e

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Enable DPPI driver
8+
CONFIG_NRFX_DPPI10=y
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Enable DPPI driver
8+
CONFIG_NRFX_DPPI10=y

subsys/esb/esb_dppi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int esb_ppi_init(void)
227227

228228
#else
229229

230-
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
230+
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO);
231231

232232
err = nrfx_dppi_channel_alloc(&dppi, &radio_address_timer_stop);
233233
if (err != NRFX_SUCCESS) {
@@ -319,7 +319,7 @@ void esb_ppi_deinit(void)
319319

320320
#else
321321

322-
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
322+
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO);
323323

324324
err = nrfx_dppi_channel_free(&dppi, radio_address_timer_stop);
325325
if (err != NRFX_SUCCESS) {

subsys/esb/esb_peripherals.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extern "C" {
2626
/** The ESB Radio interrupt number. */
2727
#define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn
2828

29-
/** DPPIC instance used by ESB. */
30-
#define ESB_DPPIC NRF_DPPIC020
29+
/** DPPIC instance number used by ESB. */
30+
#define ESB_DPPIC_INSTANCE_NO 020
3131

3232
/** ESB EGU instance configuration. */
3333
#define ESB_EGU NRF_EGU020
@@ -47,8 +47,8 @@ extern "C" {
4747
/** The ESB Radio interrupt number. */
4848
#define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn
4949

50-
/** DPPIC instance used by ESB. */
51-
#define ESB_DPPIC NRF_DPPIC10
50+
/** DPPIC instance number used by ESB. */
51+
#define ESB_DPPIC_INSTANCE_NO 10
5252

5353
/** ESB EGU instance configuration. */
5454
#define ESB_EGU NRF_EGU10
@@ -66,8 +66,8 @@ extern "C" {
6666
/** The ESB Radio interrupt number. */
6767
#define ESB_RADIO_IRQ_NUMBER RADIO_IRQn
6868

69-
/** DPPIC instance used by ESB. */
70-
#define ESB_DPPIC NRF_DPPIC
69+
/** DPPIC instance number used by ESB. */
70+
#define ESB_DPPIC_INSTANCE_NO 0
7171

7272
/** ESB EGU instance configuration. */
7373
#define ESB_EGU NRF_EGU0
@@ -80,6 +80,13 @@ extern "C" {
8080

8181
#endif
8282

83+
/** ESB DPPIC instance number. */
84+
#if ESB_DPPIC_INSTANCE_NO
85+
#define ESB_DPPIC NRFX_CONCAT_2(NRF_DPPIC, ESB_DPPIC_INSTANCE_NO)
86+
#else
87+
#define ESB_DPPIC NRF_DPPIC
88+
#endif /* ESB_DPPIC_INSTANCE_NO */
89+
8390
/** ESB timer instance number. */
8491
#if defined(CONFIG_ESB_SYS_TIMER_INSTANCE_LEADING_ZERO)
8592
#define ESB_TIMER_INSTANCE_NO NRFX_CONCAT_2(0, CONFIG_ESB_SYS_TIMER_INSTANCE)

0 commit comments

Comments
 (0)