1 // THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
2 
3 /**
4  * Copyright (c) 2024 Raspberry Pi Ltd.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 // =============================================================================
9 // Register block : ADC
10 // Version        : 2
11 // Bus type       : apb
12 // Description    : Control and data interface to SAR ADC
13 // =============================================================================
14 #ifndef _HARDWARE_REGS_ADC_H
15 #define _HARDWARE_REGS_ADC_H
16 // =============================================================================
17 // Register    : ADC_CS
18 // Description : ADC Control and Status
19 #define ADC_CS_OFFSET _u(0x00000000)
20 #define ADC_CS_BITS   _u(0x001f770f)
21 #define ADC_CS_RESET  _u(0x00000000)
22 // -----------------------------------------------------------------------------
23 // Field       : ADC_CS_RROBIN
24 // Description : Round-robin sampling. 1 bit per channel. Set all bits to 0 to
25 //               disable.
26 //               Otherwise, the ADC will cycle through each enabled channel in a
27 //               round-robin fashion.
28 //               The first channel to be sampled will be the one currently
29 //               indicated by AINSEL.
30 //               AINSEL will be updated after each conversion with the newly-
31 //               selected channel.
32 #define ADC_CS_RROBIN_RESET  _u(0x00)
33 #define ADC_CS_RROBIN_BITS   _u(0x001f0000)
34 #define ADC_CS_RROBIN_MSB    _u(20)
35 #define ADC_CS_RROBIN_LSB    _u(16)
36 #define ADC_CS_RROBIN_ACCESS "RW"
37 // -----------------------------------------------------------------------------
38 // Field       : ADC_CS_AINSEL
39 // Description : Select analog mux input. Updated automatically in round-robin
40 //               mode.
41 #define ADC_CS_AINSEL_RESET  _u(0x0)
42 #define ADC_CS_AINSEL_BITS   _u(0x00007000)
43 #define ADC_CS_AINSEL_MSB    _u(14)
44 #define ADC_CS_AINSEL_LSB    _u(12)
45 #define ADC_CS_AINSEL_ACCESS "RW"
46 // -----------------------------------------------------------------------------
47 // Field       : ADC_CS_ERR_STICKY
48 // Description : Some past ADC conversion encountered an error. Write 1 to
49 //               clear.
50 #define ADC_CS_ERR_STICKY_RESET  _u(0x0)
51 #define ADC_CS_ERR_STICKY_BITS   _u(0x00000400)
52 #define ADC_CS_ERR_STICKY_MSB    _u(10)
53 #define ADC_CS_ERR_STICKY_LSB    _u(10)
54 #define ADC_CS_ERR_STICKY_ACCESS "WC"
55 // -----------------------------------------------------------------------------
56 // Field       : ADC_CS_ERR
57 // Description : The most recent ADC conversion encountered an error; result is
58 //               undefined or noisy.
59 #define ADC_CS_ERR_RESET  _u(0x0)
60 #define ADC_CS_ERR_BITS   _u(0x00000200)
61 #define ADC_CS_ERR_MSB    _u(9)
62 #define ADC_CS_ERR_LSB    _u(9)
63 #define ADC_CS_ERR_ACCESS "RO"
64 // -----------------------------------------------------------------------------
65 // Field       : ADC_CS_READY
66 // Description : 1 if the ADC is ready to start a new conversion. Implies any
67 //               previous conversion has completed.
68 //               0 whilst conversion in progress.
69 #define ADC_CS_READY_RESET  _u(0x0)
70 #define ADC_CS_READY_BITS   _u(0x00000100)
71 #define ADC_CS_READY_MSB    _u(8)
72 #define ADC_CS_READY_LSB    _u(8)
73 #define ADC_CS_READY_ACCESS "RO"
74 // -----------------------------------------------------------------------------
75 // Field       : ADC_CS_START_MANY
76 // Description : Continuously perform conversions whilst this bit is 1. A new
77 //               conversion will start immediately after the previous finishes.
78 #define ADC_CS_START_MANY_RESET  _u(0x0)
79 #define ADC_CS_START_MANY_BITS   _u(0x00000008)
80 #define ADC_CS_START_MANY_MSB    _u(3)
81 #define ADC_CS_START_MANY_LSB    _u(3)
82 #define ADC_CS_START_MANY_ACCESS "RW"
83 // -----------------------------------------------------------------------------
84 // Field       : ADC_CS_START_ONCE
85 // Description : Start a single conversion. Self-clearing. Ignored if start_many
86 //               is asserted.
87 #define ADC_CS_START_ONCE_RESET  _u(0x0)
88 #define ADC_CS_START_ONCE_BITS   _u(0x00000004)
89 #define ADC_CS_START_ONCE_MSB    _u(2)
90 #define ADC_CS_START_ONCE_LSB    _u(2)
91 #define ADC_CS_START_ONCE_ACCESS "SC"
92 // -----------------------------------------------------------------------------
93 // Field       : ADC_CS_TS_EN
94 // Description : Power on temperature sensor. 1 - enabled. 0 - disabled.
95 #define ADC_CS_TS_EN_RESET  _u(0x0)
96 #define ADC_CS_TS_EN_BITS   _u(0x00000002)
97 #define ADC_CS_TS_EN_MSB    _u(1)
98 #define ADC_CS_TS_EN_LSB    _u(1)
99 #define ADC_CS_TS_EN_ACCESS "RW"
100 // -----------------------------------------------------------------------------
101 // Field       : ADC_CS_EN
102 // Description : Power on ADC and enable its clock.
103 //               1 - enabled. 0 - disabled.
104 #define ADC_CS_EN_RESET  _u(0x0)
105 #define ADC_CS_EN_BITS   _u(0x00000001)
106 #define ADC_CS_EN_MSB    _u(0)
107 #define ADC_CS_EN_LSB    _u(0)
108 #define ADC_CS_EN_ACCESS "RW"
109 // =============================================================================
110 // Register    : ADC_RESULT
111 // Description : Result of most recent ADC conversion
112 #define ADC_RESULT_OFFSET _u(0x00000004)
113 #define ADC_RESULT_BITS   _u(0x00000fff)
114 #define ADC_RESULT_RESET  _u(0x00000000)
115 #define ADC_RESULT_MSB    _u(11)
116 #define ADC_RESULT_LSB    _u(0)
117 #define ADC_RESULT_ACCESS "RO"
118 // =============================================================================
119 // Register    : ADC_FCS
120 // Description : FIFO control and status
121 #define ADC_FCS_OFFSET _u(0x00000008)
122 #define ADC_FCS_BITS   _u(0x0f0f0f0f)
123 #define ADC_FCS_RESET  _u(0x00000000)
124 // -----------------------------------------------------------------------------
125 // Field       : ADC_FCS_THRESH
126 // Description : DREQ/IRQ asserted when level >= threshold
127 #define ADC_FCS_THRESH_RESET  _u(0x0)
128 #define ADC_FCS_THRESH_BITS   _u(0x0f000000)
129 #define ADC_FCS_THRESH_MSB    _u(27)
130 #define ADC_FCS_THRESH_LSB    _u(24)
131 #define ADC_FCS_THRESH_ACCESS "RW"
132 // -----------------------------------------------------------------------------
133 // Field       : ADC_FCS_LEVEL
134 // Description : The number of conversion results currently waiting in the FIFO
135 #define ADC_FCS_LEVEL_RESET  _u(0x0)
136 #define ADC_FCS_LEVEL_BITS   _u(0x000f0000)
137 #define ADC_FCS_LEVEL_MSB    _u(19)
138 #define ADC_FCS_LEVEL_LSB    _u(16)
139 #define ADC_FCS_LEVEL_ACCESS "RO"
140 // -----------------------------------------------------------------------------
141 // Field       : ADC_FCS_OVER
142 // Description : 1 if the FIFO has been overflowed. Write 1 to clear.
143 #define ADC_FCS_OVER_RESET  _u(0x0)
144 #define ADC_FCS_OVER_BITS   _u(0x00000800)
145 #define ADC_FCS_OVER_MSB    _u(11)
146 #define ADC_FCS_OVER_LSB    _u(11)
147 #define ADC_FCS_OVER_ACCESS "WC"
148 // -----------------------------------------------------------------------------
149 // Field       : ADC_FCS_UNDER
150 // Description : 1 if the FIFO has been underflowed. Write 1 to clear.
151 #define ADC_FCS_UNDER_RESET  _u(0x0)
152 #define ADC_FCS_UNDER_BITS   _u(0x00000400)
153 #define ADC_FCS_UNDER_MSB    _u(10)
154 #define ADC_FCS_UNDER_LSB    _u(10)
155 #define ADC_FCS_UNDER_ACCESS "WC"
156 // -----------------------------------------------------------------------------
157 // Field       : ADC_FCS_FULL
158 #define ADC_FCS_FULL_RESET  _u(0x0)
159 #define ADC_FCS_FULL_BITS   _u(0x00000200)
160 #define ADC_FCS_FULL_MSB    _u(9)
161 #define ADC_FCS_FULL_LSB    _u(9)
162 #define ADC_FCS_FULL_ACCESS "RO"
163 // -----------------------------------------------------------------------------
164 // Field       : ADC_FCS_EMPTY
165 #define ADC_FCS_EMPTY_RESET  _u(0x0)
166 #define ADC_FCS_EMPTY_BITS   _u(0x00000100)
167 #define ADC_FCS_EMPTY_MSB    _u(8)
168 #define ADC_FCS_EMPTY_LSB    _u(8)
169 #define ADC_FCS_EMPTY_ACCESS "RO"
170 // -----------------------------------------------------------------------------
171 // Field       : ADC_FCS_DREQ_EN
172 // Description : If 1: assert DMA requests when FIFO contains data
173 #define ADC_FCS_DREQ_EN_RESET  _u(0x0)
174 #define ADC_FCS_DREQ_EN_BITS   _u(0x00000008)
175 #define ADC_FCS_DREQ_EN_MSB    _u(3)
176 #define ADC_FCS_DREQ_EN_LSB    _u(3)
177 #define ADC_FCS_DREQ_EN_ACCESS "RW"
178 // -----------------------------------------------------------------------------
179 // Field       : ADC_FCS_ERR
180 // Description : If 1: conversion error bit appears in the FIFO alongside the
181 //               result
182 #define ADC_FCS_ERR_RESET  _u(0x0)
183 #define ADC_FCS_ERR_BITS   _u(0x00000004)
184 #define ADC_FCS_ERR_MSB    _u(2)
185 #define ADC_FCS_ERR_LSB    _u(2)
186 #define ADC_FCS_ERR_ACCESS "RW"
187 // -----------------------------------------------------------------------------
188 // Field       : ADC_FCS_SHIFT
189 // Description : If 1: FIFO results are right-shifted to be one byte in size.
190 //               Enables DMA to byte buffers.
191 #define ADC_FCS_SHIFT_RESET  _u(0x0)
192 #define ADC_FCS_SHIFT_BITS   _u(0x00000002)
193 #define ADC_FCS_SHIFT_MSB    _u(1)
194 #define ADC_FCS_SHIFT_LSB    _u(1)
195 #define ADC_FCS_SHIFT_ACCESS "RW"
196 // -----------------------------------------------------------------------------
197 // Field       : ADC_FCS_EN
198 // Description : If 1: write result to the FIFO after each conversion.
199 #define ADC_FCS_EN_RESET  _u(0x0)
200 #define ADC_FCS_EN_BITS   _u(0x00000001)
201 #define ADC_FCS_EN_MSB    _u(0)
202 #define ADC_FCS_EN_LSB    _u(0)
203 #define ADC_FCS_EN_ACCESS "RW"
204 // =============================================================================
205 // Register    : ADC_FIFO
206 // Description : Conversion result FIFO
207 #define ADC_FIFO_OFFSET _u(0x0000000c)
208 #define ADC_FIFO_BITS   _u(0x00008fff)
209 #define ADC_FIFO_RESET  _u(0x00000000)
210 // -----------------------------------------------------------------------------
211 // Field       : ADC_FIFO_ERR
212 // Description : 1 if this particular sample experienced a conversion error.
213 //               Remains in the same location if the sample is shifted.
214 #define ADC_FIFO_ERR_RESET  "-"
215 #define ADC_FIFO_ERR_BITS   _u(0x00008000)
216 #define ADC_FIFO_ERR_MSB    _u(15)
217 #define ADC_FIFO_ERR_LSB    _u(15)
218 #define ADC_FIFO_ERR_ACCESS "RF"
219 // -----------------------------------------------------------------------------
220 // Field       : ADC_FIFO_VAL
221 #define ADC_FIFO_VAL_RESET  "-"
222 #define ADC_FIFO_VAL_BITS   _u(0x00000fff)
223 #define ADC_FIFO_VAL_MSB    _u(11)
224 #define ADC_FIFO_VAL_LSB    _u(0)
225 #define ADC_FIFO_VAL_ACCESS "RF"
226 // =============================================================================
227 // Register    : ADC_DIV
228 // Description : Clock divider. If non-zero, CS_START_MANY will start
229 //               conversions
230 //               at regular intervals rather than back-to-back.
231 //               The divider is reset when either of these fields are written.
232 //               Total period is 1 + INT + FRAC / 256
233 #define ADC_DIV_OFFSET _u(0x00000010)
234 #define ADC_DIV_BITS   _u(0x00ffffff)
235 #define ADC_DIV_RESET  _u(0x00000000)
236 // -----------------------------------------------------------------------------
237 // Field       : ADC_DIV_INT
238 // Description : Integer part of clock divisor.
239 #define ADC_DIV_INT_RESET  _u(0x0000)
240 #define ADC_DIV_INT_BITS   _u(0x00ffff00)
241 #define ADC_DIV_INT_MSB    _u(23)
242 #define ADC_DIV_INT_LSB    _u(8)
243 #define ADC_DIV_INT_ACCESS "RW"
244 // -----------------------------------------------------------------------------
245 // Field       : ADC_DIV_FRAC
246 // Description : Fractional part of clock divisor. First-order delta-sigma.
247 #define ADC_DIV_FRAC_RESET  _u(0x00)
248 #define ADC_DIV_FRAC_BITS   _u(0x000000ff)
249 #define ADC_DIV_FRAC_MSB    _u(7)
250 #define ADC_DIV_FRAC_LSB    _u(0)
251 #define ADC_DIV_FRAC_ACCESS "RW"
252 // =============================================================================
253 // Register    : ADC_INTR
254 // Description : Raw Interrupts
255 #define ADC_INTR_OFFSET _u(0x00000014)
256 #define ADC_INTR_BITS   _u(0x00000001)
257 #define ADC_INTR_RESET  _u(0x00000000)
258 // -----------------------------------------------------------------------------
259 // Field       : ADC_INTR_FIFO
260 // Description : Triggered when the sample FIFO reaches a certain level.
261 //               This level can be programmed via the FCS_THRESH field.
262 #define ADC_INTR_FIFO_RESET  _u(0x0)
263 #define ADC_INTR_FIFO_BITS   _u(0x00000001)
264 #define ADC_INTR_FIFO_MSB    _u(0)
265 #define ADC_INTR_FIFO_LSB    _u(0)
266 #define ADC_INTR_FIFO_ACCESS "RO"
267 // =============================================================================
268 // Register    : ADC_INTE
269 // Description : Interrupt Enable
270 #define ADC_INTE_OFFSET _u(0x00000018)
271 #define ADC_INTE_BITS   _u(0x00000001)
272 #define ADC_INTE_RESET  _u(0x00000000)
273 // -----------------------------------------------------------------------------
274 // Field       : ADC_INTE_FIFO
275 // Description : Triggered when the sample FIFO reaches a certain level.
276 //               This level can be programmed via the FCS_THRESH field.
277 #define ADC_INTE_FIFO_RESET  _u(0x0)
278 #define ADC_INTE_FIFO_BITS   _u(0x00000001)
279 #define ADC_INTE_FIFO_MSB    _u(0)
280 #define ADC_INTE_FIFO_LSB    _u(0)
281 #define ADC_INTE_FIFO_ACCESS "RW"
282 // =============================================================================
283 // Register    : ADC_INTF
284 // Description : Interrupt Force
285 #define ADC_INTF_OFFSET _u(0x0000001c)
286 #define ADC_INTF_BITS   _u(0x00000001)
287 #define ADC_INTF_RESET  _u(0x00000000)
288 // -----------------------------------------------------------------------------
289 // Field       : ADC_INTF_FIFO
290 // Description : Triggered when the sample FIFO reaches a certain level.
291 //               This level can be programmed via the FCS_THRESH field.
292 #define ADC_INTF_FIFO_RESET  _u(0x0)
293 #define ADC_INTF_FIFO_BITS   _u(0x00000001)
294 #define ADC_INTF_FIFO_MSB    _u(0)
295 #define ADC_INTF_FIFO_LSB    _u(0)
296 #define ADC_INTF_FIFO_ACCESS "RW"
297 // =============================================================================
298 // Register    : ADC_INTS
299 // Description : Interrupt status after masking & forcing
300 #define ADC_INTS_OFFSET _u(0x00000020)
301 #define ADC_INTS_BITS   _u(0x00000001)
302 #define ADC_INTS_RESET  _u(0x00000000)
303 // -----------------------------------------------------------------------------
304 // Field       : ADC_INTS_FIFO
305 // Description : Triggered when the sample FIFO reaches a certain level.
306 //               This level can be programmed via the FCS_THRESH field.
307 #define ADC_INTS_FIFO_RESET  _u(0x0)
308 #define ADC_INTS_FIFO_BITS   _u(0x00000001)
309 #define ADC_INTS_FIFO_MSB    _u(0)
310 #define ADC_INTS_FIFO_LSB    _u(0)
311 #define ADC_INTS_FIFO_ACCESS "RO"
312 // =============================================================================
313 #endif // _HARDWARE_REGS_ADC_H
314 
315