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