Skip to content

Commit

Permalink
esb: Fix DPPIC instance selection for nRF54 SoCs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
grochu authored and anangl committed Jan 30, 2025
1 parent a50d6bb commit acf399b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
8 changes: 8 additions & 0 deletions samples/esb/esb_prx/boards/nrf54l15dk_nrf54l15_cpuapp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2025 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable DPPI driver
CONFIG_NRFX_DPPI10=y
8 changes: 8 additions & 0 deletions samples/esb/esb_ptx/boards/nrf54l15dk_nrf54l15_cpuapp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2025 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable DPPI driver
CONFIG_NRFX_DPPI10=y
4 changes: 2 additions & 2 deletions subsys/esb/esb_dppi.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int esb_ppi_init(void)

#else

nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO);

err = nrfx_dppi_channel_alloc(&dppi, &radio_address_timer_stop);
if (err != NRFX_SUCCESS) {
Expand Down Expand Up @@ -319,7 +319,7 @@ void esb_ppi_deinit(void)

#else

nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(ESB_DPPIC_INSTANCE_NO);

err = nrfx_dppi_channel_free(&dppi, radio_address_timer_stop);
if (err != NRFX_SUCCESS) {
Expand Down
19 changes: 13 additions & 6 deletions subsys/esb/esb_peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ extern "C" {
/** The ESB Radio interrupt number. */
#define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn

/** DPPIC instance used by ESB. */
#define ESB_DPPIC NRF_DPPIC020
/** DPPIC instance number used by ESB. */
#define ESB_DPPIC_INSTANCE_NO 020

/** ESB EGU instance configuration. */
#define ESB_EGU NRF_EGU020
Expand All @@ -47,8 +47,8 @@ extern "C" {
/** The ESB Radio interrupt number. */
#define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn

/** DPPIC instance used by ESB. */
#define ESB_DPPIC NRF_DPPIC10
/** DPPIC instance number used by ESB. */
#define ESB_DPPIC_INSTANCE_NO 10

/** ESB EGU instance configuration. */
#define ESB_EGU NRF_EGU10
Expand All @@ -66,8 +66,8 @@ extern "C" {
/** The ESB Radio interrupt number. */
#define ESB_RADIO_IRQ_NUMBER RADIO_IRQn

/** DPPIC instance used by ESB. */
#define ESB_DPPIC NRF_DPPIC
/** DPPIC instance number used by ESB. */
#define ESB_DPPIC_INSTANCE_NO 0

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

#endif

/** ESB DPPIC instance number. */
#if ESB_DPPIC_INSTANCE_NO
#define ESB_DPPIC NRFX_CONCAT_2(NRF_DPPIC, ESB_DPPIC_INSTANCE_NO)
#else
#define ESB_DPPIC NRF_DPPIC
#endif /* ESB_DPPIC_INSTANCE_NO */

/** ESB timer instance number. */
#if defined(CONFIG_ESB_SYS_TIMER_INSTANCE_LEADING_ZERO)
#define ESB_TIMER_INSTANCE_NO NRFX_CONCAT_2(0, CONFIG_ESB_SYS_TIMER_INSTANCE)
Expand Down

0 comments on commit acf399b

Please sign in to comment.