From e43c2f3eb58cb98b0fcdbde3dba810a501747200 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 14 Sep 2023 14:32:51 +0200 Subject: [PATCH] modules: hal_nordic: inject CONFIG_NFCT_PINS_AS_GPIOS If the users configures this option in devicetree, ie, ``` &uicr { nfct-pins-as-gpios; }; ``` CMake will inject the HAL-specific CONFIG_NFCT_PINS_AS_GPIOS definition, so that the necessary operations are performed during system init. Signed-off-by: Gerard Marull-Paretas --- modules/hal_nordic/nrfx/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 5842ae45ad..98ba196139 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -109,3 +109,16 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_WDT ${SRC_DIR}/nrfx_wdt.c) if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM) zephyr_library_sources(${SRC_DIR}/nrfx_twi_twim.c) endif() + +# Inject HAL "CONFIG_NFCT_PINS_AS_GPIOS" definition if user requests to +# configure the NFCT pins as GPIOS. This way, the HAL will take care of doing +# the proper configuration sequence during system init + +dt_nodelabel(uicr_path NODELABEL "uicr") +if(${uicr_path}) + dt_prop(nfct_pins_as_gpios PATH ${uicr_path} PROPERTY "nfct-pins-as-gpios") + + if(${nfct_pins_as_gpios}) + zephyr_library_compile_definitions(CONFIG_NFCT_PINS_AS_GPIOS) + endif() +endif()