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 <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2023-09-14 14:32:51 +02:00 committed by Carles Cufí
parent 1213ed4e8f
commit e43c2f3eb5

View file

@ -109,3 +109,16 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_WDT ${SRC_DIR}/nrfx_wdt.c)
if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM) if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM)
zephyr_library_sources(${SRC_DIR}/nrfx_twi_twim.c) zephyr_library_sources(${SRC_DIR}/nrfx_twi_twim.c)
endif() 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()