@@ -65,13 +65,15 @@ static const struct gpio_dt_spec req_spec = GPIO_DT_SPEC_GET(CX_NODE, req_gp
6565static const struct gpio_dt_spec status0_spec = GPIO_DT_SPEC_GET (CX_NODE , status0_gpios );
6666static const struct gpio_dt_spec grant_spec = GPIO_DT_SPEC_GET (CX_NODE , grant_gpios );
6767
68+ #if !defined(CONFIG_SOC_SERIES_BSIM_NRFXX )
6869/* Direct register access pointers for ISR-safe GPIO control from DT */
6970static NRF_GPIO_Type * req_port =
7071 ((NRF_GPIO_Type * )DT_REG_ADDR (DT_GPIO_CTLR (CX_NODE , req_gpios )));
7172static NRF_GPIO_Type * status0_port =
7273 ((NRF_GPIO_Type * )DT_REG_ADDR (DT_GPIO_CTLR (CX_NODE , status0_gpios )));
7374static uint32_t req_pin_mask = BIT (DT_GPIO_PIN (CX_NODE , req_gpios ));
7475static uint32_t status0_pin_mask = BIT (DT_GPIO_PIN (CX_NODE , status0_gpios ));
76+ #endif
7577
7678static mpsl_cx_cb_t callback ;
7779static struct gpio_callback grant_cb ;
@@ -174,6 +176,9 @@ static int sig_dir_level_calc(mpsl_cx_op_map_t ops)
174176 */
175177static int32_t gpio_drive_status0_to_dir (mpsl_cx_op_map_t ops )
176178{
179+ #if defined(CONFIG_SOC_SERIES_BSIM_NRFXX )
180+ return gpio_pin_set_dt (& status0_spec , sig_dir_level_calc (ops ));
181+ #else
177182 if (status0_port == NULL ) {
178183 return - NRF_EINVAL ;
179184 }
@@ -186,6 +191,7 @@ static int32_t gpio_drive_status0_to_dir(mpsl_cx_op_map_t ops)
186191 nrf_gpio_port_out_clear (status0_port , status0_pin_mask );
187192 }
188193 return 0 ;
194+ #endif
189195}
190196
191197/**
@@ -196,6 +202,9 @@ static int32_t gpio_drive_status0_to_dir(mpsl_cx_op_map_t ops)
196202 */
197203static int32_t gpio_drive_request (int active )
198204{
205+ #if defined(CONFIG_SOC_SERIES_BSIM_NRFXX )
206+ return gpio_pin_set_dt (& req_spec , active );
207+ #else
199208 if (req_port == NULL ) {
200209 return - NRF_EINVAL ;
201210 }
@@ -206,6 +215,7 @@ static int32_t gpio_drive_request(int active)
206215 nrf_gpio_port_out_clear (req_port , req_pin_mask );
207216 }
208217 return 0 ;
218+ #endif
209219}
210220
211221static int32_t request (const mpsl_cx_request_t * req_params )
0 commit comments