1515#elif IS_ENABLED (CONFIG_HAS_HW_NRF_DPPIC )
1616#include <nrfx_dppi.h>
1717#endif
18+ #if defined(NRF54L_SERIES )
19+ #include <hal/nrf_gpiote.h>
20+ #include <nrfx_ppib.h>
21+ #include <helpers/nrfx_gppi.h>
22+ #endif
1823
1924int mpsl_fem_utils_ppi_channel_alloc (uint8_t * ppi_channels , size_t size )
2025{
2126 nrfx_err_t err = NRFX_ERROR_NOT_SUPPORTED ;
2227#ifdef DPPI_PRESENT
28+ #if defined(NRF53_SERIES )
2329 nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE (0 );
30+ #elif defined(NRF54L_SERIES )
31+ nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE (10 );
32+ #else
33+ #error Unsupported SoC series
34+ #endif
2435#endif
2536
2637 for (int i = 0 ; i < size ; i ++ ) {
@@ -47,3 +58,50 @@ void mpsl_fem_extended_pin_to_mpsl_fem_pin(uint32_t pin_num, mpsl_fem_pin_t *p_f
4758
4859 p_fem_pin -> port_pin = pin_num ;
4960}
61+
62+ int mpsl_fem_utils_gpiote_pin_init (mpsl_fem_gpiote_pin_config_t * gpiote_pin )
63+ {
64+ #if defined(NRF54L_SERIES )
65+ nrfx_err_t err ;
66+ uint8_t ppib_ch = 0 ;
67+ uint8_t gppi_ch = 0 ;
68+ nrfx_ppib_interconnect_t ppib11_21 = NRFX_PPIB_INTERCONNECT_INSTANCE (11 , 21 );
69+
70+ err = nrfx_ppib_channel_alloc (& ppib11_21 , & ppib_ch );
71+ if (err != NRFX_SUCCESS ) {
72+ return - ENOMEM ;
73+ }
74+ gpiote_pin -> ppib_channels [0 ] = ppib_ch ;
75+
76+ err = nrfx_gppi_channel_alloc (& gppi_ch );
77+ if (err != NRFX_SUCCESS ) {
78+ return - ENOMEM ;
79+ }
80+
81+ nrfx_gppi_channel_endpoints_setup (gppi_ch ,
82+ nrfx_ppib_receive_event_address_get (& ppib11_21 .right , ppib_ch ),
83+ nrf_gpiote_task_address_get (gpiote_pin -> p_gpiote ,
84+ nrf_gpiote_clr_task_get (gpiote_pin -> gpiote_ch_id )));
85+
86+ nrfx_gppi_channels_enable (1U << gppi_ch );
87+
88+ err = nrfx_ppib_channel_alloc (& ppib11_21 , & ppib_ch );
89+ if (err != NRFX_SUCCESS ) {
90+ return - ENOMEM ;
91+ }
92+ gpiote_pin -> ppib_channels [1 ] = ppib_ch ;
93+
94+ err = nrfx_gppi_channel_alloc (& gppi_ch );
95+ if (err != NRFX_SUCCESS ) {
96+ return - ENOMEM ;
97+ }
98+
99+ nrfx_gppi_channel_endpoints_setup (gppi_ch ,
100+ nrfx_ppib_receive_event_address_get (& ppib11_21 .right , ppib_ch ),
101+ nrf_gpiote_task_address_get (gpiote_pin -> p_gpiote ,
102+ nrf_gpiote_set_task_get (gpiote_pin -> gpiote_ch_id )));
103+
104+ nrfx_gppi_channels_enable (1U << gppi_ch );
105+ #endif
106+ return 0 ;
107+ }
0 commit comments