2020#include "mpsl_fem_power_model_interface.h"
2121#endif
2222#include <nrfx_gpiote.h>
23+ #include <gpiote_nrfx.h>
2324
2425#if !defined(CONFIG_PINCTRL )
2526#error CONFIG_PINCTRL is required for nRF21540 GPIO SPI driver
2627#endif
2728
29+ #define RADIO_FEM_NODE DT_NODELABEL(nrf_radio_fem)
30+
2831#define MPSL_FEM_SPI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), spi_if)
2932#define MPSL_FEM_SPI_BUS DT_BUS(MPSL_FEM_SPI_IF)
3033#define MPSL_FEM_SPI_REG ((NRF_SPIM_Type *) DT_REG_ADDR(MPSL_FEM_SPI_BUS))
@@ -44,10 +47,10 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_
4447{
4548#if DT_NODE_HAS_PROP (MPSL_FEM_SPI_BUS , cs_gpios )
4649 uint8_t cs_gpiote_channel ;
47- const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE (
48- NRF_DT_GPIOTE_INST (MPSL_FEM_SPI_BUS , cs_gpios ));
50+ nrfx_gpiote_t * cs_gpiote =
51+ & GPIOTE_NRFX_INST_BY_NODE ( NRF_DT_GPIOTE_NODE (MPSL_FEM_SPI_BUS , cs_gpios ));
4952
50- if (nrfx_gpiote_channel_alloc (& cs_gpiote , & cs_gpiote_channel ) != NRFX_SUCCESS ) {
53+ if (nrfx_gpiote_channel_alloc (cs_gpiote , & cs_gpiote_channel ) != 0 ) {
5154 return - ENOMEM ;
5255 }
5356#endif
@@ -65,7 +68,7 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_
6568 .active_high = true,
6669 .gpiote_ch_id = cs_gpiote_channel ,
6770#if defined(NRF54L_SERIES )
68- .p_gpiote = cs_gpiote . p_reg ,
71+ .p_gpiote = cs_gpiote -> p_reg ,
6972#endif
7073#else
7174 MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT
@@ -115,30 +118,30 @@ static int fem_nrf21540_gpio_spi_configure(void)
115118
116119#if DT_NODE_HAS_PROP (DT_NODELABEL (nrf_radio_fem ), tx_en_gpios )
117120 uint8_t txen_gpiote_channel ;
118- const nrfx_gpiote_t txen_gpiote = NRFX_GPIOTE_INSTANCE (
119- NRF_DT_GPIOTE_INST ( DT_NODELABEL ( nrf_radio_fem ) , tx_en_gpios ));
121+ nrfx_gpiote_t * txen_gpiote =
122+ & GPIOTE_NRFX_INST_BY_NODE ( NRF_DT_GPIOTE_NODE ( RADIO_FEM_NODE , tx_en_gpios ));
120123
121- if (nrfx_gpiote_channel_alloc (& txen_gpiote , & txen_gpiote_channel ) != NRFX_SUCCESS ) {
124+ if (nrfx_gpiote_channel_alloc (txen_gpiote , & txen_gpiote_channel ) != 0 ) {
122125 return - ENOMEM ;
123126 }
124127#endif
125128
126129#if DT_NODE_HAS_PROP (DT_NODELABEL (nrf_radio_fem ), rx_en_gpios )
127130 uint8_t rxen_gpiote_channel ;
128- const nrfx_gpiote_t rxen_gpiote = NRFX_GPIOTE_INSTANCE (
129- NRF_DT_GPIOTE_INST ( DT_NODELABEL ( nrf_radio_fem ) , rx_en_gpios ));
131+ nrfx_gpiote_t * rxen_gpiote =
132+ & GPIOTE_NRFX_INST_BY_NODE ( NRF_DT_GPIOTE_NODE ( RADIO_FEM_NODE , rx_en_gpios ));
130133
131- if (nrfx_gpiote_channel_alloc (& rxen_gpiote , & rxen_gpiote_channel ) != NRFX_SUCCESS ) {
134+ if (nrfx_gpiote_channel_alloc (rxen_gpiote , & rxen_gpiote_channel ) != 0 ) {
132135 return - ENOMEM ;
133136 }
134137#endif
135138
136139#if DT_NODE_HAS_PROP (DT_NODELABEL (nrf_radio_fem ), pdn_gpios )
137140 uint8_t pdn_gpiote_channel ;
138- const nrfx_gpiote_t pdn_gpiote = NRFX_GPIOTE_INSTANCE (
139- NRF_DT_GPIOTE_INST ( DT_NODELABEL ( nrf_radio_fem ) , pdn_gpios ));
141+ nrfx_gpiote_t * pdn_gpiote =
142+ & GPIOTE_NRFX_INST_BY_NODE ( NRF_DT_GPIOTE_NODE ( RADIO_FEM_NODE , pdn_gpios ));
140143
141- if (nrfx_gpiote_channel_alloc (& pdn_gpiote , & pdn_gpiote_channel ) != NRFX_SUCCESS ) {
144+ if (nrfx_gpiote_channel_alloc (pdn_gpiote , & pdn_gpiote_channel ) != 0 ) {
142145 return - ENOMEM ;
143146 }
144147#endif
@@ -177,7 +180,7 @@ static int fem_nrf21540_gpio_spi_configure(void)
177180 .active_high = MPSL_FEM_GPIO_POLARITY_GET (tx_en_gpios ),
178181 .gpiote_ch_id = txen_gpiote_channel ,
179182#if defined(NRF54L_SERIES )
180- .p_gpiote = txen_gpiote . p_reg ,
183+ .p_gpiote = txen_gpiote -> p_reg ,
181184#endif
182185#else
183186 MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT
@@ -194,7 +197,7 @@ static int fem_nrf21540_gpio_spi_configure(void)
194197 .active_high = MPSL_FEM_GPIO_POLARITY_GET (rx_en_gpios ),
195198 .gpiote_ch_id = rxen_gpiote_channel ,
196199#if defined(NRF54L_SERIES )
197- .p_gpiote = rxen_gpiote . p_reg ,
200+ .p_gpiote = rxen_gpiote -> p_reg ,
198201#endif
199202#else
200203 MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT
@@ -211,7 +214,7 @@ static int fem_nrf21540_gpio_spi_configure(void)
211214 .active_high = MPSL_FEM_GPIO_POLARITY_GET (pdn_gpios ),
212215 .gpiote_ch_id = pdn_gpiote_channel ,
213216#if defined(NRF54L_SERIES )
214- .p_gpiote = pdn_gpiote . p_reg ,
217+ .p_gpiote = pdn_gpiote -> p_reg ,
215218#endif
216219#else
217220 MPSL_FEM_DISABLED_GPIOTE_PIN_CONFIG_INIT
0 commit comments