Skip to content

Commit 324973f

Browse files
nordic-krchmasz-nordic
authored andcommitted
[nrf fromlist] drivers: timer: nrf_rtc_timer: Align to use GPPI API
Use GPPI API instead of PPI driver API. Upstream PR #: 98327 Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent bc4d2c4 commit 324973f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

drivers/timer/Kconfig.nrf_rtc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config NRF_RTC_TIMER
99
depends on SOC_COMPATIBLE_NRF
1010
select TICKLESS_CAPABLE
1111
select SYSTEM_TIMER_HAS_DISABLE_SUPPORT
12-
select NRFX_PPI if SOC_NRF52832
12+
select NRFX_GPPI if SOC_NRF52832
1313
depends on !$(dt_nodelabel_enabled,rtc1)
1414
help
1515
This module implements a kernel device driver for the nRF Real Time

drivers/timer/nrf_rtc_timer.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define CUSTOM_COUNTER_BIT_WIDTH 1
2424
#define WRAP_CH 0
2525
#define SYS_CLOCK_CH 1
26-
#include "nrfx_ppi.h"
26+
#include "helpers/nrfx_gppi.h"
2727
#else
2828
#define CUSTOM_COUNTER_BIT_WIDTH 0
2929
#define SYS_CLOCK_CH 0
@@ -806,8 +806,8 @@ static int sys_clock_driver_init(void)
806806
alloc_mask &= ~BIT(WRAP_CH);
807807

808808
nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(WRAP_CH);
809-
nrfx_err_t result;
810-
nrf_ppi_channel_t ch;
809+
int result;
810+
nrfx_gppi_handle_t handle;
811811

812812
nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH));
813813
nrfy_rtc_cc_set(RTC, WRAP_CH, COUNTER_MAX);
@@ -817,12 +817,11 @@ static int sys_clock_driver_init(void)
817817
evt_addr = nrfy_rtc_event_address_get(RTC, evt);
818818
task_addr = nrfy_rtc_task_address_get(RTC, NRF_RTC_TASK_CLEAR);
819819

820-
result = nrfx_ppi_channel_alloc(&ch);
821-
if (result != NRFX_SUCCESS) {
822-
return -ENODEV;
820+
result = nrfx_gppi_conn_alloc(evt_addr, task_addr, &handle);
821+
if (result < 0) {
822+
return result;
823823
}
824-
(void)nrfx_ppi_channel_assign(ch, evt_addr, task_addr);
825-
(void)nrfx_ppi_channel_enable(ch);
824+
nrfx_gppi_conn_enable(handle);
826825
#endif
827826
return 0;
828827
}

0 commit comments

Comments
 (0)