Skip to content

Commit 30a58c3

Browse files
nordic-krchmasz-nordic
authored andcommitted
all: Align to GPPI API tweaking
There are minor updates in GPPI API. Align in places that are affected. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 7e6086a commit 30a58c3

File tree

12 files changed

+61
-33
lines changed

12 files changed

+61
-33
lines changed

lib/fem_al/fem_al.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int radio_domain_nrfx_dppi_channel_alloc(uint8_t *channel)
361361
{
362362
int ch;
363363

364-
ch = nrfx_gppi_channel_alloc(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI), channel);
364+
ch = nrfx_gppi_channel_alloc(nrfx_gppi_domain_id_get(RADIO_DOMAIN_NRF_DPPI));
365365
if (ch < 0) {
366366
return ch;
367367
}

samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void)
159159
uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0);
160160
int ret;
161161

162-
ret = nrfx_gppi_group_alloc(&eep0, 1, &group);
162+
ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group);
163163
if (ret < 0) {
164164
printk("Failed allocating group\n");
165165
return ret;
166166
}
167167

168+
ret = nrfx_gppi_group_ep_add(group, eep0);
169+
if (ret < 0) {
170+
printk("Failed attaching an event to the group\n");
171+
return ret;
172+
}
173+
168174
ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match);
169175
if (ret < 0) {
170176
printk("Failed allocating for RTC match\n");

samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void)
130130
uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0);
131131
int ret;
132132

133-
ret = nrfx_gppi_group_alloc(&eep0, 1, &group);
133+
ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group);
134134
if (ret < 0) {
135135
printk("Failed allocating group\n");
136136
return ret;
137137
}
138138

139+
ret = nrfx_gppi_group_ep_add(group, eep0);
140+
if (ret < 0) {
141+
printk("Failed attaching an event to the group\n");
142+
return ret;
143+
}
144+
139145
ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match);
140146
if (ret < 0) {
141147
printk("Failed allocating for RTC match\n");

samples/bluetooth/conn_time_sync/src/controller_time_nrf54.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ int controller_time_init(void)
1717
{
1818
int ret;
1919

20-
ret = nrfx_grtc_channel_alloc(&grtc_channel);
21-
if (ret != NRFX_SUCCESS) {
22-
printk("Failed allocating GRTC channel (ret: %d)\n",
23-
ret - NRFX_ERROR_BASE_NUM);
24-
return -ENODEV;
20+
ret = nrfx_grtc_channel_alloc();
21+
if (ret < 0) {
22+
printk("Failed allocating GRTC channel (ret: %d)\n", ret);
23+
return ret;
2524
}
2625

26+
grtc_channel = (uint8_t)ret;
2727
nrf_grtc_sys_counter_compare_event_enable(NRF_GRTC, grtc_channel);
2828

2929
return 0;

samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void)
158158
uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0);
159159
int ret;
160160

161-
ret = nrfx_gppi_group_alloc(&eep0, 1, &group);
161+
ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group);
162162
if (ret < 0) {
163163
printk("Failed allocating group\n");
164164
return ret;
165165
}
166166

167+
ret = nrfx_gppi_group_ep_add(group, eep0);
168+
if (ret < 0) {
169+
printk("Failed attaching an event to the group\n");
170+
return ret;
171+
}
172+
167173
ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match);
168174
if (ret < 0) {
169175
printk("Failed allocating for RTC match\n");

samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,18 @@ int config_egu_trigger_on_rtc_and_timer_match(void)
131131
uint32_t tep1 = nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0);
132132
int ret;
133133

134-
ret = nrfx_gppi_group_alloc(&eep0, 1, &group);
134+
ret = nrfx_gppi_group_alloc(nrfx_gppi_domain_id_get(eep0), &group);
135135
if (ret < 0) {
136136
printk("Failed allocating group\n");
137137
return ret;
138138
}
139139

140+
ret = nrfx_gppi_group_ep_add(group, eep0);
141+
if (ret < 0) {
142+
printk("Failed attaching an event to the group\n");
143+
return ret;
144+
}
145+
140146
ret = nrfx_gppi_conn_alloc(eep0, nrfx_gppi_group_task_en_addr(group), &ppi_on_rtc_match);
141147
if (ret < 0) {
142148
printk("Failed allocating for RTC match\n");

samples/bluetooth/iso_time_sync/src/controller_time_nrf54.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ int controller_time_init(void)
1818
int ret;
1919

2020
ret = nrfx_grtc_channel_alloc(&grtc_channel);
21-
if (ret != NRFX_SUCCESS) {
22-
printk("Failed allocating GRTC channel (ret: %d)\n",
23-
ret - NRFX_ERROR_BASE_NUM);
24-
return -ENODEV;
21+
if (ret < 0) {
22+
printk("Failed allocating GRTC channel (ret: %d)\n", ret);
23+
return ret;
2524
}
2625

26+
grtc_channel = (uint8_t)ret;
2727
nrf_grtc_sys_counter_compare_event_enable(NRF_GRTC, grtc_channel);
2828

2929
return 0;

samples/peripheral/802154_phy_test/src/rf_proc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,18 @@ static void configure_antenna_diversity(void)
140140
{
141141
nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(DT_NODELABEL(gpiote0));
142142
NRF_TIMER_Type *ad_timer = NRF_TIMER3;
143+
int rv;
143144

144145
nrf_802154_sl_ant_div_cfg_t cfg = {
145146
.ant_sel_pin = CONFIG_PTT_ANT_PIN,
146147
.toggle_time = CONFIG_PTT_ANT_TOGGLE_TIME,
147148
.p_timer = ad_timer
148149
};
149150

150-
(void)nrfx_gppi_channel_alloc(0 ,&cfg.ppi_ch);
151+
rv = nrfx_gppi_channel_alloc(0);
152+
__ASSERT_NO_MSG(rv >= 0);
153+
cfg.ppi_ch = (uint8_t)rv;
154+
151155
(void)nrfx_gpiote_channel_alloc(gpiote, &cfg.gpiote_ch);
152156
nrf_802154_sl_ant_div_mode_t ant_div_auto = 0x02;
153157

subsys/esb/esb_dppi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,51 +217,51 @@ int esb_ppi_init(void)
217217
ARG_UNUSED(err);
218218

219219
#else
220-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
220+
ch = nrfx_gppi_channel_alloc(domain_id);
221221
if (ch < 0) {
222222
goto error;
223223
}
224224
radio_address_timer_stop = (uint8_t)ch;
225225

226-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
226+
ch = nrfx_gppi_channel_alloc(domain_id);
227227
if (ch < 0) {
228228
goto error;
229229
}
230230
timer_compare0_radio_disable = (uint8_t)ch;
231231

232-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
232+
ch = nrfx_gppi_channel_alloc(domain_id);
233233
if (ch < 0) {
234234
goto error;
235235
}
236236
timer_compare1_radio_txen = (uint8_t)ch;
237237

238-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
238+
ch = nrfx_gppi_channel_alloc(domain_id);
239239
if (ch < 0) {
240240
goto error;
241241
}
242242
disabled_phy_end_egu = (uint8_t)ch;
243243

244-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
244+
ch = nrfx_gppi_channel_alloc(domain_id);
245245
if (ch < 0) {
246246
goto error;
247247
}
248248
egu_timer_start = (uint8_t)ch;
249249

250-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
250+
ch = nrfx_gppi_channel_alloc(domain_id);
251251
if (ch < 0) {
252252
goto error;
253253
}
254254
egu_ramp_up = (uint8_t)ch;
255255

256256
if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) {
257-
ch = nrfx_gppi_channel_alloc(domain_id, NULL);
257+
ch = nrfx_gppi_channel_alloc(domain_id);
258258
if (ch < 0) {
259259
goto error;
260260
}
261261
radio_end_timer_start = (uint8_t)ch;
262262
}
263263

264-
ch = nrfx_gppi_group_channel_alloc(domain_id, NULL);
264+
ch = nrfx_gppi_group_channel_alloc(domain_id);
265265
if (ch < 0) {
266266
LOG_ERR("gppi_group_alloc failed with: %d\n", ch);
267267
return ch;

subsys/esb/esb_ppi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,51 +187,51 @@ int esb_ppi_init(void)
187187
{
188188
int ch;
189189

190-
ch = nrfx_gppi_channel_alloc(0, NULL);
190+
ch = nrfx_gppi_channel_alloc(0);
191191
if (ch < 0) {
192192
goto error;
193193
}
194194
egu_ramp_up = (nrf_ppi_channel_t)ch;
195195

196-
ch = nrfx_gppi_channel_alloc(0, NULL);
196+
ch = nrfx_gppi_channel_alloc(0);
197197
if (ch < 0) {
198198
goto error;
199199
}
200200
disabled_egu = (nrf_ppi_channel_t)ch;
201201

202-
ch = nrfx_gppi_channel_alloc(0, NULL);
202+
ch = nrfx_gppi_channel_alloc(0);
203203
if (ch < 0) {
204204
goto error;
205205
}
206206
egu_timer_start = (nrf_ppi_channel_t)ch;
207207

208-
ch = nrfx_gppi_channel_alloc(0, NULL);
208+
ch = nrfx_gppi_channel_alloc(0);
209209
if (ch < 0) {
210210
goto error;
211211
}
212212
radio_address_timer_stop = (nrf_ppi_channel_t)ch;
213213

214-
ch = nrfx_gppi_channel_alloc(0, NULL);
214+
ch = nrfx_gppi_channel_alloc(0);
215215
if (ch < 0) {
216216
goto error;
217217
}
218218
timer_compare0_radio_disable = (nrf_ppi_channel_t)ch;
219219

220-
ch = nrfx_gppi_channel_alloc(0, NULL);
220+
ch = nrfx_gppi_channel_alloc(0);
221221
if (ch < 0) {
222222
goto error;
223223
}
224224
timer_compare1_radio_txen = (nrf_ppi_channel_t)ch;
225225

226226
if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) {
227-
ch = nrfx_gppi_channel_alloc(0, NULL);
227+
ch = nrfx_gppi_channel_alloc(0);
228228
if (ch < 0) {
229229
goto error;
230230
}
231231
radio_end_timer_start = (nrf_ppi_channel_t)ch;
232232
}
233233

234-
ch = nrfx_gppi_group_channel_alloc(0, NULL);
234+
ch = nrfx_gppi_group_channel_alloc(0);
235235
if (ch < 0) {
236236
LOG_ERR("gppi_group_alloc failed with: %d\n", ch);
237237
return ch;

0 commit comments

Comments
 (0)