Zephyr Project API 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
nrf_grtc_timer.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_TIMER_NRF_GRTC_TIMER_H
8#define ZEPHYR_INCLUDE_DRIVERS_TIMER_NRF_GRTC_TIMER_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <zephyr/sys_clock.h>
15
29typedef void (*z_nrf_grtc_timer_compare_handler_t)(int32_t id, uint64_t expire_time,
30 void *user_data);
31
37int32_t z_nrf_grtc_timer_chan_alloc(void);
38
53int32_t z_nrf_grtc_timer_ext_chan_alloc(void);
54
59void z_nrf_grtc_timer_chan_free(int32_t chan);
60
65uint64_t z_nrf_grtc_timer_read(void);
66
74bool z_nrf_grtc_timer_compare_evt_check(int32_t chan);
75
84uint32_t z_nrf_grtc_timer_compare_evt_address_get(int32_t chan);
85
94uint32_t z_nrf_grtc_timer_capture_task_address_get(int32_t chan);
95
104bool z_nrf_grtc_timer_compare_int_lock(int32_t chan);
105
114void z_nrf_grtc_timer_compare_int_unlock(int32_t chan, bool key);
115
126int z_nrf_grtc_timer_compare_read(int32_t chan, uint64_t *val);
127
141int z_nrf_grtc_timer_set(int32_t chan, uint64_t target_time,
142 z_nrf_grtc_timer_compare_handler_t handler, void *user_data);
143
164int z_nrf_grtc_timer_interval_set(int32_t chan, uint32_t initial_value, uint32_t interval_value,
165 z_nrf_grtc_timer_compare_handler_t handler, void *user_data);
166
175void z_nrf_grtc_timer_interval_stop(int32_t chan);
176
187void z_nrf_grtc_timer_abort(int32_t chan);
188
196uint64_t z_nrf_grtc_timer_get_ticks(k_timeout_t t);
197
211int z_nrf_grtc_timer_capture_prepare(int32_t chan);
212
225int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time);
226
239int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us);
240
250uint64_t z_nrf_grtc_timer_startup_value_get(void);
251
260
261#ifdef __cplusplus
262}
263#endif
264
265#endif /* ZEPHYR_INCLUDE_DRIVERS_TIMER_NRF_GRTC_TIMER_H */
int nrf_grtc_timer_clock_driver_init(void)
Initialize the GRTC clock timer driver from an application- defined function.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Kernel timeout type.
Definition clock.h:65