Software APIs
dif_aon_timer_autogen.h
Go to the documentation of this file.
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_AON_TIMER_AUTOGEN_H_
6 #define OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_AON_TIMER_AUTOGEN_H_
7 
8 // THIS FILE HAS BEEN GENERATED, DO NOT EDIT MANUALLY. COMMAND:
9 // util/make_new_dif.py --mode=regen --only=autogen
10 
11 /**
12  * @file
13  * @brief <a href="/book/hw/ip/aon_timer/">AON_TIMER</a> Device Interface
14  * Functions
15  */
16 
17 #include <stdbool.h>
18 #include <stdint.h>
19 
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif // __cplusplus
27 
28 /**
29  * A handle to aon_timer.
30  *
31  * This type should be treated as opaque by users.
32  */
33 typedef struct dif_aon_timer {
34  /**
35  * The base address for the aon_timer hardware registers.
36  */
39 
40 /**
41  * Creates a new handle for a(n) aon_timer peripheral.
42  *
43  * This function does not actuate the hardware.
44  *
45  * @param base_addr The MMIO base address of the aon_timer peripheral.
46  * @param[out] aon_timer Out param for the initialized handle.
47  * @return The result of the operation.
48  */
51  dif_aon_timer_t *aon_timer);
52 
53 /**
54  * A aon_timer alert type.
55  */
56 typedef enum dif_aon_timer_alert {
57  /**
58  * This fatal alert is triggered when a fatal TL-UL bus integrity fault is
59  * detected.
60  */
63 
64 /**
65  * Forces a particular alert, causing it to be escalated as if the hardware
66  * had raised it.
67  *
68  * @param aon_timer A aon_timer handle.
69  * @param alert The alert to force.
70  * @return The result of the operation.
71  */
74  dif_aon_timer_alert_t alert);
75 
76 /**
77  * A aon_timer interrupt request type.
78  */
79 typedef enum dif_aon_timer_irq {
80  /**
81  * Raised if the wakeup timer has hit the specified threshold
82  */
84  /**
85  * Raised if the watchdog timer has hit the bark threshold
86  */
89 
90 /**
91  * A snapshot of the state of the interrupts for this IP.
92  *
93  * This is an opaque type, to be used with the `dif_aon_timer_irq_get_state()`
94  * and `dif_aon_timer_irq_acknowledge_state()` functions.
95  */
97 
98 /**
99  * Returns the type of a given interrupt (i.e., event or status) for this IP.
100  *
101  * @param aon_timer A aon_timer handle.
102  * @param irq An interrupt request.
103  * @param[out] type Out-param for the interrupt type.
104  * @return The result of the operation.
105  */
109  dif_irq_type_t *type);
110 
111 /**
112  * Returns the state of all interrupts (i.e., pending or not) for this IP.
113  *
114  * @param aon_timer A aon_timer handle.
115  * @param[out] snapshot Out-param for interrupt state snapshot.
116  * @return The result of the operation.
117  */
120  const dif_aon_timer_t *aon_timer,
122 
123 /**
124  * Returns whether a particular interrupt is currently pending.
125  *
126  * @param aon_timer A aon_timer handle.
127  * @param irq An interrupt request.
128  * @param[out] is_pending Out-param for whether the interrupt is pending.
129  * @return The result of the operation.
130  */
134  bool *is_pending);
135 
136 /**
137  * Acknowledges all interrupts that were pending at the time of the state
138  * snapshot.
139  *
140  * @param aon_timer A aon_timer handle.
141  * @param snapshot Interrupt state snapshot.
142  * @return The result of the operation.
143  */
146  const dif_aon_timer_t *aon_timer,
148 
149 /**
150  * Acknowledges all interrupts, indicating to the hardware that all
151  * interrupts have been successfully serviced.
152  *
153  * @param aon_timer A aon_timer handle.
154  * @return The result of the operation.
155  */
158  const dif_aon_timer_t *aon_timer);
159 
160 /**
161  * Acknowledges a particular interrupt, indicating to the hardware that it has
162  * been successfully serviced.
163  *
164  * @param aon_timer A aon_timer handle.
165  * @param irq An interrupt request.
166  * @return The result of the operation.
167  */
170  dif_aon_timer_irq_t irq);
171 
172 /**
173  * Forces a particular interrupt, causing it to be serviced as if hardware had
174  * asserted it.
175  *
176  * @param aon_timer A aon_timer handle.
177  * @param irq An interrupt request.
178  * @param val Value to be set.
179  * @return The result of the operation.
180  */
183  dif_aon_timer_irq_t irq, const bool val);
184 
185 #ifdef __cplusplus
186 } // extern "C"
187 #endif // __cplusplus
188 
189 #endif // OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_AON_TIMER_AUTOGEN_H_