1 /*
2  * Copyright (c) 2024, Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _NRF_HW_MODEL_GRTC_H
8 #define _NRF_HW_MODEL_GRTC_H
9 
10 #include "bs_types.h"
11 #include "NHW_config.h"
12 
13 #ifdef __cplusplus
14 extern "C"{
15 #endif
16 
17 extern NRF_GRTC_Type NRF_GRTC_regs;
18 
19 void nhw_GRTC_regw_sideeffects_TASKS_CAPTURE(uint inst, uint n);
20 void nhw_GRTC_regw_sideeffects_TASKS_START(uint inst);
21 void nhw_GRTC_regw_sideeffects_TASKS_STOP(uint inst);
22 void nhw_GRTC_regw_sideeffects_TASKS_CLEAR(uint inst);
23 void nhw_GRTC_regw_sideeffects_TASKS_PWMSTART(uint inst);
24 void nhw_GRTC_regw_sideeffects_TASKS_PWMSTOP(uint inst);
25 
26 void nhw_GRTC_regw_sideeffects_SUBSCRIBE_CAPTURE(uint inst, uint n);
27 
28 void nhw_GRTC_regw_sideeffects_EVENTS_all(uint inst);
29 
30 void nhw_GRTC_regw_sideeffects_INTEN(uint inst, uint n);
31 void nhw_GRTC_regw_sideeffects_INTENSET(uint inst, uint n);
32 void nhw_GRTC_regw_sideeffects_INTENCLR(uint inst, uint n);
33 
34 void nhw_GRTC_regw_sideeffects_CC_CCADD(uint inst, uint n);
35 void nhw_GRTC_regw_sideeffects_CC_CCEN(uint inst, uint cc);
36 void nhw_GRTC_regw_sideeffects_CC_CCL(uint inst, uint cc);
37 void nhw_GRTC_regw_sideeffects_CC_CCH(uint inst, uint cc);
38 
39 uint32_t nhw_GRTC_regr_sideeffects_SYSCOUNTERL(uint inst, uint n);
40 uint32_t nhw_GRTC_regr_sideeffects_SYSCOUNTERH(uint inst, uint n);
41 
42 
43 /**
44  * Return the time for a given GRTC counter value.
45  *
46  * @param inst GRTC instance
47  * @param value The GRTC value
48  *
49  * @returns The timestamp corresponding to a given GRTC value.
50  */
51 bs_time_t nhw_GRTC_counter_to_time(uint inst, uint64_t value);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif
58 
59