From b87e6ecb13afe9de706692ea3aa4222ad6766047 Mon Sep 17 00:00:00 2001 From: Magdalena Pastula Date: Wed, 4 Sep 2024 14:06:34 +0200 Subject: [PATCH] [nrf noup] modules: hal_nordic: add DPPI channel allocation for NRFE Add possibility to mark DPPI channels as allocated for software- defines peripherals. Signed-off-by: Magdalena Pastula --- modules/hal_nordic/nrfx/nrfe_config.h | 20 ++++++++++++++++++++ modules/hal_nordic/nrfx/nrfx_glue.h | 15 +++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 modules/hal_nordic/nrfx/nrfe_config.h diff --git a/modules/hal_nordic/nrfx/nrfe_config.h b/modules/hal_nordic/nrfx/nrfe_config.h new file mode 100644 index 00000000000..c85d22a14a3 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfe_config.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFE_CONFIG_H__ +#define NRFE_CONFIG_H__ + +#ifdef CONFIG_GPIO_NRFE +#include +#else +#error "NRFE config header included, even though no SW-define IO device is enabled." +#endif + +#ifndef NRFE_RESERVED_PPI_CHANNELS +#define NRFE_RESERVED_PPI_CHANNELS 0 +#endif + +#endif /* NRFE_CONFIG_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index 2d4c25f4383..da0a445e7cb 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -317,12 +317,14 @@ void nrfx_busy_wait(uint32_t usec_to_wait); /** @brief Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library. */ #define NRFX_DPPI_CHANNELS_USED (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | \ NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL) + NRFX_PPI_CHANNELS_USED_BY_MPSL | \ + NRFX_PPI_CHANNELS_USED_BY_NRFE) /** @brief Bitmask that defines DPPI groups that are reserved for use outside of the nrfx library. */ #define NRFX_DPPI_GROUPS_USED (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | \ NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL) + NRFX_PPI_GROUPS_USED_BY_MPSL | \ + NRFX_PPI_GROUPS_USED_BY_NRFE) /** @brief Bitmask that defines PPI channels that are reserved for use outside of the nrfx library. */ #define NRFX_PPI_CHANNELS_USED (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | \ @@ -387,6 +389,15 @@ void nrfx_busy_wait(uint32_t usec_to_wait); #define NRFX_PPI_GROUPS_USED_BY_MPSL 0 #endif +#if defined(CONFIG_NRFE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_NRFE NRFE_RESERVED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 +#else +#define NRFX_PPI_CHANNELS_USED_BY_NRFE 0 +#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 +#endif + #if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) BUILD_ASSERT( (NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0,