1 // 2 // Copyright (c) 2010-2025 Antmicro 3 // Copyright (c) 2022-2025 Silicon Labs 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 9 using System.Collections.Generic; 10 using Antmicro.Renode.Core.Structure.Registers; 11 using Antmicro.Renode.Peripherals.Bus; 12 using Antmicro.Renode.Peripherals.Memory; 13 using Antmicro.Renode.Peripherals.Miscellaneous; 14 using Antmicro.Renode.Peripherals.Miscellaneous.SiLabs; 15 16 namespace Antmicro.Renode.Peripherals.Miscellaneous.SiLabs 17 { 18 [AllowedTranslations(AllowedTranslation.ByteToDoubleWord | AllowedTranslation.WordToDoubleWord)] 19 public class EFR32xG2_DeviceInformation : DeviceInformation, IDoubleWordPeripheral, IKnownSize 20 { EFR32xG2_DeviceInformation(DeviceFamily deviceFamily, ushort deviceNumber, MappedMemory flashDevice, MappedMemory sramDevice, byte productRevision = 0)21 public EFR32xG2_DeviceInformation(DeviceFamily deviceFamily, ushort deviceNumber, MappedMemory flashDevice, MappedMemory sramDevice, byte productRevision = 0) 22 : base(deviceFamily, deviceNumber, flashDevice, sramDevice, productRevision) 23 { 24 UID = ++count; 25 registers = BuildRegisters(); 26 } 27 Reset()28 public void Reset() 29 { 30 registers.Reset(); 31 } 32 ReadDoubleWord(long offset)33 public uint ReadDoubleWord(long offset) 34 { 35 return registers.Read(offset); 36 } 37 WriteDoubleWord(long offset, uint value)38 public void WriteDoubleWord(long offset, uint value) 39 { 40 registers.Write(offset, value); 41 } 42 43 private static uint count = 0; 44 private ulong UID; 45 public long Size => 0x400; 46 public static readonly ulong OUI64 = 0xCCCCCC0000000000; 47 public ulong EUI48 48 { 49 get 50 { 51 // TODO: for now we just return the UID 52 return (ulong)UID; 53 } 54 } 55 public ulong EUI64 56 { 57 get 58 { 59 return (ulong)(OUI64 + UID); 60 } 61 } 62 BuildRegisters()63 private DoubleWordRegisterCollection BuildRegisters() 64 { 65 var registerDictionary = new Dictionary<long, DoubleWordRegister> 66 { 67 {(long)Registers.ModuleInformation, new DoubleWordRegister(this, 0xFFFFFFFF) 68 }, 69 {(long)Registers.ExtendedUniqueIdentifier48Low, new DoubleWordRegister(this, 0x1) 70 .WithValueField(0, 24, FieldMode.Read, valueProviderCallback: _ => (uint)(EUI48 & 0xFFFFFF), name: "UNIQUEID") 71 .WithValueField(24, 8, FieldMode.Read, valueProviderCallback: _ => (uint)((EUI48 & 0xFFFFFFFF) >> 24), name: "OUI48L") 72 }, 73 {(long)Registers.ExtendedUniqueIdentifier48High, new DoubleWordRegister(this, 0x1) 74 .WithValueField(0, 16, FieldMode.Read, valueProviderCallback: _ => (uint)(EUI48 >> 48), name: "OUI48H") 75 .WithReservedBits(16, 16) 76 }, 77 {(long)Registers.ExtendedUniqueIdentifier64Low, new DoubleWordRegister(this, 0x1) 78 .WithValueField(0, 32, FieldMode.Read, valueProviderCallback: _ => (uint)(EUI64 & 0xFFFFFFFF), name: "UNIQUEL") 79 }, 80 {(long)Registers.ExtendedUniqueIdentifier64High, new DoubleWordRegister(this, 0x1) 81 .WithValueField(0, 8, FieldMode.Read, valueProviderCallback: _ => (uint)((EUI64 >> 32) & 0xFF), name: "UNIQUEH") 82 .WithValueField(8, 24, FieldMode.Read, valueProviderCallback: _ => (uint)(EUI64 >> 40), name: "OUI64") 83 }, 84 {(long)Registers.MemoryInformation, new DoubleWordRegister(this, 0x04000003) 85 .WithTag("FLASH_PAGE_SIZE", 0, 8) 86 .WithTag("USER_DATA_PAGE_SIZE", 8, 8) 87 .WithTag("DI_AREA_LENGTH", 16, 16) 88 }, 89 {(long)Registers.SoftwareRestriction0, new DoubleWordRegister(this, 0x111112) 90 .WithTag("ZIGBEE", 0, 2) 91 .WithReservedBits(2, 2) 92 .WithTag("THREAD", 4, 2) 93 .WithReservedBits(6, 2) 94 .WithTag("RF4CE", 8, 2) 95 .WithReservedBits(10, 2) 96 .WithTag("BTSMART", 12, 2) 97 .WithReservedBits(14, 2) 98 .WithTag("CONNECT", 16, 2) 99 .WithReservedBits(18, 2) 100 .WithTag("SRI", 20, 2) 101 .WithReservedBits(22, 10) 102 }, 103 {(long)Registers.SoftwareRestriction1, new DoubleWordRegister(this, 0x1F) 104 .WithTaggedFlag("RFMCUEN", 0) 105 .WithTaggedFlag("NCPEN", 1) 106 .WithTaggedFlag("GWEN", 2) 107 .WithTaggedFlag("XOUT", 3) 108 .WithTaggedFlag("FENOTCH", 4) 109 .WithReservedBits(5, 27) 110 }, 111 {(long)Registers.MemorySize, new DoubleWordRegister(this) 112 .WithValueField(0, 16, FieldMode.Read, valueProviderCallback: _ => flashSize, name: "FLASH") 113 .WithValueField(16, 11, FieldMode.Read, valueProviderCallback: _ => sramSize, name: "SRAM") 114 .WithReservedBits(27, 5) 115 }, 116 {(long)Registers.PartInformation, new DoubleWordRegister(this) 117 .WithValueField(0, 16, FieldMode.Read, valueProviderCallback: _ => deviceNumber, name: "DEVICE_NUMBER") 118 .WithValueField(16, 6, FieldMode.Read, valueProviderCallback: _ => (uint)deviceFamily, name: "FAMILY_NUMBER") 119 .WithReservedBits(22, 2) 120 .WithValueField(24, 6, FieldMode.Read, valueProviderCallback: _ => productRevision, name: "DEVICE_FAMILY") 121 .WithReservedBits(30, 2) 122 }, 123 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration0, new DoubleWordRegister(this, 0xB040_1E44) 124 .WithTag("TUNING", 0, 7) 125 .WithReservedBits(7, 1) 126 .WithTag("FINETUNING", 8, 6) 127 .WithReservedBits(14, 1) 128 .WithTaggedFlag("LDOHP", 15) 129 .WithTag("FREQRANGE", 16, 5) 130 .WithTag("CMPBIAS", 21, 3) 131 .WithTag("CLKDIV", 24, 2) 132 .WithTag("CMPSEL", 26, 2) 133 .WithTag("IREFTC", 28, 4) 134 }, 135 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration1, new DoubleWordRegister(this, 0xA041_1F3A) 136 .WithTag("TUNING", 0, 7) 137 .WithReservedBits(7, 1) 138 .WithTag("FINETUNING", 8, 6) 139 .WithReservedBits(14, 1) 140 .WithTaggedFlag("LDOHP", 15) 141 .WithTag("FREQRANGE", 16, 5) 142 .WithTag("CMPBIAS", 21, 3) 143 .WithTag("CLKDIV", 24, 2) 144 .WithTag("CMPSEL", 26, 2) 145 .WithTag("IREFTC", 28, 4) 146 }, 147 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration2, new DoubleWordRegister(this, 0xA042_1F3A) 148 .WithTag("TUNING", 0, 7) 149 .WithReservedBits(7, 1) 150 .WithTag("FINETUNING", 8, 6) 151 .WithReservedBits(14, 1) 152 .WithTaggedFlag("LDOHP", 15) 153 .WithTag("FREQRANGE", 16, 5) 154 .WithTag("CMPBIAS", 21, 3) 155 .WithTag("CLKDIV", 24, 2) 156 .WithTag("CMPSEL", 26, 2) 157 .WithTag("IREFTC", 28, 4) 158 }, 159 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration3, new DoubleWordRegister(this, 0xF443_A040) 160 .WithTag("TUNING", 0, 7) 161 .WithReservedBits(7, 1) 162 .WithTag("FINETUNING", 8, 6) 163 .WithReservedBits(14, 1) 164 .WithTaggedFlag("LDOHP", 15) 165 .WithTag("FREQRANGE", 16, 5) 166 .WithTag("CMPBIAS", 21, 3) 167 .WithTag("CLKDIV", 24, 2) 168 .WithTag("CMPSEL", 26, 2) 169 .WithTag("IREFTC", 28, 4) 170 }, 171 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration4, new DoubleWordRegister(this, 0xE444_9F3A) 172 .WithTag("TUNING", 0, 7) 173 .WithReservedBits(7, 1) 174 .WithTag("FINETUNING", 8, 6) 175 .WithReservedBits(14, 1) 176 .WithTaggedFlag("LDOHP", 15) 177 .WithTag("FREQRANGE", 16, 5) 178 .WithTag("CMPBIAS", 21, 3) 179 .WithTag("CLKDIV", 24, 2) 180 .WithTag("CMPSEL", 26, 2) 181 .WithTag("IREFTC", 28, 4) 182 }, 183 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration5, new DoubleWordRegister(this, 0xD445_9F3A) 184 .WithTag("TUNING", 0, 7) 185 .WithReservedBits(7, 1) 186 .WithTag("FINETUNING", 8, 6) 187 .WithReservedBits(14, 1) 188 .WithTaggedFlag("LDOHP", 15) 189 .WithTag("FREQRANGE", 16, 5) 190 .WithTag("CMPBIAS", 21, 3) 191 .WithTag("CLKDIV", 24, 2) 192 .WithTag("CMPSEL", 26, 2) 193 .WithTag("IREFTC", 28, 4) 194 }, 195 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration6, new DoubleWordRegister(this, 0xD466_A23F) 196 .WithTag("TUNING", 0, 7) 197 .WithReservedBits(7, 1) 198 .WithTag("FINETUNING", 8, 6) 199 .WithReservedBits(14, 1) 200 .WithTaggedFlag("LDOHP", 15) 201 .WithTag("FREQRANGE", 16, 5) 202 .WithTag("CMPBIAS", 21, 3) 203 .WithTag("CLKDIV", 24, 2) 204 .WithTag("CMPSEL", 26, 2) 205 .WithTag("IREFTC", 28, 4) 206 }, 207 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration7, new DoubleWordRegister(this, 0xD467_A03F) 208 .WithTag("TUNING", 0, 7) 209 .WithReservedBits(7, 1) 210 .WithTag("FINETUNING", 8, 6) 211 .WithReservedBits(14, 1) 212 .WithTaggedFlag("LDOHP", 15) 213 .WithTag("FREQRANGE", 16, 5) 214 .WithTag("CMPBIAS", 21, 3) 215 .WithTag("CLKDIV", 24, 2) 216 .WithTag("CMPSEL", 26, 2) 217 .WithTag("IREFTC", 28, 4) 218 }, 219 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration8, new DoubleWordRegister(this, 0xD868_9C3C) 220 .WithTag("TUNING", 0, 7) 221 .WithReservedBits(7, 1) 222 .WithTag("FINETUNING", 8, 6) 223 .WithReservedBits(14, 1) 224 .WithTaggedFlag("LDOHP", 15) 225 .WithTag("FREQRANGE", 16, 5) 226 .WithTag("CMPBIAS", 21, 3) 227 .WithTag("CLKDIV", 24, 2) 228 .WithTag("CMPSEL", 26, 2) 229 .WithTag("IREFTC", 28, 4) 230 }, 231 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration9, new DoubleWordRegister(this, 0xC889_9F3A) 232 .WithTag("TUNING", 0, 7) 233 .WithReservedBits(7, 1) 234 .WithTag("FINETUNING", 8, 6) 235 .WithReservedBits(14, 1) 236 .WithTaggedFlag("LDOHP", 15) 237 .WithTag("FREQRANGE", 16, 5) 238 .WithTag("CMPBIAS", 21, 3) 239 .WithTag("CLKDIV", 24, 2) 240 .WithTag("CMPSEL", 26, 2) 241 .WithTag("IREFTC", 28, 4) 242 }, 243 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration10, new DoubleWordRegister(this, 0xC88A_A13E) 244 .WithTag("TUNING", 0, 7) 245 .WithReservedBits(7, 1) 246 .WithTag("FINETUNING", 8, 6) 247 .WithReservedBits(14, 1) 248 .WithTaggedFlag("LDOHP", 15) 249 .WithTag("FREQRANGE", 16, 5) 250 .WithTag("CMPBIAS", 21, 3) 251 .WithTag("CLKDIV", 24, 2) 252 .WithTag("CMPSEL", 26, 2) 253 .WithTag("IREFTC", 28, 4) 254 }, 255 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration11, new DoubleWordRegister(this, 0xC8AB_A042) 256 .WithTag("TUNING", 0, 7) 257 .WithReservedBits(7, 1) 258 .WithTag("FINETUNING", 8, 6) 259 .WithReservedBits(14, 1) 260 .WithTaggedFlag("LDOHP", 15) 261 .WithTag("FREQRANGE", 16, 5) 262 .WithTag("CMPBIAS", 21, 3) 263 .WithTag("CLKDIV", 24, 2) 264 .WithTag("CMPSEL", 26, 2) 265 .WithTag("IREFTC", 28, 4) 266 }, 267 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration12, new DoubleWordRegister(this, 0xC8CC_9D3D) 268 .WithTag("TUNING", 0, 7) 269 .WithReservedBits(7, 1) 270 .WithTag("FINETUNING", 8, 6) 271 .WithReservedBits(14, 1) 272 .WithTaggedFlag("LDOHP", 15) 273 .WithTag("FREQRANGE", 16, 5) 274 .WithTag("CMPBIAS", 21, 3) 275 .WithTag("CLKDIV", 24, 2) 276 .WithTag("CMPSEL", 26, 2) 277 .WithTag("IREFTC", 28, 4) 278 }, 279 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration13, new DoubleWordRegister(this, 0xDCED_9E3E) 280 .WithTag("TUNING", 0, 7) 281 .WithReservedBits(7, 1) 282 .WithTag("FINETUNING", 8, 6) 283 .WithReservedBits(14, 1) 284 .WithTaggedFlag("LDOHP", 15) 285 .WithTag("FREQRANGE", 16, 5) 286 .WithTag("CMPBIAS", 21, 3) 287 .WithTag("CLKDIV", 24, 2) 288 .WithTag("CMPSEL", 26, 2) 289 .WithTag("IREFTC", 28, 4) 290 }, 291 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration14, new DoubleWordRegister(this, 0xDCEE_9F3C) 292 .WithTag("TUNING", 0, 7) 293 .WithReservedBits(7, 1) 294 .WithTag("FINETUNING", 8, 6) 295 .WithReservedBits(14, 1) 296 .WithTaggedFlag("LDOHP", 15) 297 .WithTag("FREQRANGE", 16, 5) 298 .WithTag("CMPBIAS", 21, 3) 299 .WithTag("CLKDIV", 24, 2) 300 .WithTag("CMPSEL", 26, 2) 301 .WithTag("IREFTC", 28, 4) 302 }, 303 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration15, new DoubleWordRegister(this, 0xDCEF_A040) 304 .WithTag("TUNING", 0, 7) 305 .WithReservedBits(7, 1) 306 .WithTag("FINETUNING", 8, 6) 307 .WithReservedBits(14, 1) 308 .WithTaggedFlag("LDOHP", 15) 309 .WithTag("FREQRANGE", 16, 5) 310 .WithTag("CMPBIAS", 21, 3) 311 .WithTag("CLKDIV", 24, 2) 312 .WithTag("CMPSEL", 26, 2) 313 .WithTag("IREFTC", 28, 4) 314 }, 315 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration16, new DoubleWordRegister(this, 0xDCF0_A23B) 316 .WithTag("TUNING", 0, 7) 317 .WithReservedBits(7, 1) 318 .WithTag("FINETUNING", 8, 6) 319 .WithReservedBits(14, 1) 320 .WithTaggedFlag("LDOHP", 15) 321 .WithTag("FREQRANGE", 16, 5) 322 .WithTag("CMPBIAS", 21, 3) 323 .WithTag("CLKDIV", 24, 2) 324 .WithTag("CMPSEL", 26, 2) 325 .WithTag("IREFTC", 28, 4) 326 }, 327 {(long)Registers.HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration17, new DoubleWordRegister(this, 0xDCF1_9F3A) 328 .WithTag("TUNING", 0, 7) 329 .WithReservedBits(7, 1) 330 .WithTag("FINETUNING", 8, 6) 331 .WithReservedBits(14, 1) 332 .WithTaggedFlag("LDOHP", 15) 333 .WithTag("FREQRANGE", 16, 5) 334 .WithTag("CMPBIAS", 21, 3) 335 .WithTag("CLKDIV", 24, 2) 336 .WithTag("CMPSEL", 26, 2) 337 .WithTag("IREFTC", 28, 4) 338 }, 339 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration0, new DoubleWordRegister(this, 0xB040_1C45) 340 .WithTag("TUNING", 0, 7) 341 .WithReservedBits(7, 1) 342 .WithTag("FINETUNING", 8, 6) 343 .WithReservedBits(14, 1) 344 .WithTaggedFlag("LDOHP", 15) 345 .WithTag("FREQRANGE", 16, 5) 346 .WithTag("CMPBIAS", 21, 3) 347 .WithTag("CLKDIV", 24, 2) 348 .WithTag("CMPSEL", 26, 2) 349 .WithTag("IREFTC", 28, 4) 350 }, 351 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration1, new DoubleWordRegister(this, 0xA041_1E3C) 352 .WithTag("TUNING", 0, 7) 353 .WithReservedBits(7, 1) 354 .WithTag("FINETUNING", 8, 6) 355 .WithReservedBits(14, 1) 356 .WithTaggedFlag("LDOHP", 15) 357 .WithTag("FREQRANGE", 16, 5) 358 .WithTag("CMPBIAS", 21, 3) 359 .WithTag("CLKDIV", 24, 2) 360 .WithTag("CMPSEL", 26, 2) 361 .WithTag("IREFTC", 28, 4) 362 }, 363 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration2, new DoubleWordRegister(this, 0xA042_1F3A) 364 .WithTag("TUNING", 0, 7) 365 .WithReservedBits(7, 1) 366 .WithTag("FINETUNING", 8, 6) 367 .WithReservedBits(14, 1) 368 .WithTaggedFlag("LDOHP", 15) 369 .WithTag("FREQRANGE", 16, 5) 370 .WithTag("CMPBIAS", 21, 3) 371 .WithTag("CLKDIV", 24, 2) 372 .WithTag("CMPSEL", 26, 2) 373 .WithTag("IREFTC", 28, 4) 374 }, 375 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration3, new DoubleWordRegister(this, 0xF443_A040) 376 .WithTag("TUNING", 0, 7) 377 .WithReservedBits(7, 1) 378 .WithTag("FINETUNING", 8, 6) 379 .WithReservedBits(14, 1) 380 .WithTaggedFlag("LDOHP", 15) 381 .WithTag("FREQRANGE", 16, 5) 382 .WithTag("CMPBIAS", 21, 3) 383 .WithTag("CLKDIV", 24, 2) 384 .WithTag("CMPSEL", 26, 2) 385 .WithTag("IREFTC", 28, 4) 386 }, 387 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration4, new DoubleWordRegister(this, 0xE444_A02F) 388 .WithTag("TUNING", 0, 7) 389 .WithReservedBits(7, 1) 390 .WithTag("FINETUNING", 8, 6) 391 .WithReservedBits(14, 1) 392 .WithTaggedFlag("LDOHP", 15) 393 .WithTag("FREQRANGE", 16, 5) 394 .WithTag("CMPBIAS", 21, 3) 395 .WithTag("CLKDIV", 24, 2) 396 .WithTag("CMPSEL", 26, 2) 397 .WithTag("IREFTC", 28, 4) 398 }, 399 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration5, new DoubleWordRegister(this, 0xD445_9F3A) 400 .WithTag("TUNING", 0, 7) 401 .WithReservedBits(7, 1) 402 .WithTag("FINETUNING", 8, 6) 403 .WithReservedBits(14, 1) 404 .WithTaggedFlag("LDOHP", 15) 405 .WithTag("FREQRANGE", 16, 5) 406 .WithTag("CMPBIAS", 21, 3) 407 .WithTag("CLKDIV", 24, 2) 408 .WithTag("CMPSEL", 26, 2) 409 .WithTag("IREFTC", 28, 4) 410 }, 411 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration6, new DoubleWordRegister(this, 0xD466_9F40) 412 .WithTag("TUNING", 0, 7) 413 .WithReservedBits(7, 1) 414 .WithTag("FINETUNING", 8, 6) 415 .WithReservedBits(14, 1) 416 .WithTaggedFlag("LDOHP", 15) 417 .WithTag("FREQRANGE", 16, 5) 418 .WithTag("CMPBIAS", 21, 3) 419 .WithTag("CLKDIV", 24, 2) 420 .WithTag("CMPSEL", 26, 2) 421 .WithTag("IREFTC", 28, 4) 422 }, 423 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration7, new DoubleWordRegister(this, 0xD467_9D40) 424 .WithTag("TUNING", 0, 7) 425 .WithReservedBits(7, 1) 426 .WithTag("FINETUNING", 8, 6) 427 .WithReservedBits(14, 1) 428 .WithTaggedFlag("LDOHP", 15) 429 .WithTag("FREQRANGE", 16, 5) 430 .WithTag("CMPBIAS", 21, 3) 431 .WithTag("CLKDIV", 24, 2) 432 .WithTag("CMPSEL", 26, 2) 433 .WithTag("IREFTC", 28, 4) 434 }, 435 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration8, new DoubleWordRegister(this, 0xD868_A23C) 436 .WithTag("TUNING", 0, 7) 437 .WithReservedBits(7, 1) 438 .WithTag("FINETUNING", 8, 6) 439 .WithReservedBits(14, 1) 440 .WithTaggedFlag("LDOHP", 15) 441 .WithTag("FREQRANGE", 16, 5) 442 .WithTag("CMPBIAS", 21, 3) 443 .WithTag("CLKDIV", 24, 2) 444 .WithTag("CMPSEL", 26, 2) 445 .WithTag("IREFTC", 28, 4) 446 }, 447 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration9, new DoubleWordRegister(this, 0xC889_9C54) 448 .WithTag("TUNING", 0, 7) 449 .WithReservedBits(7, 1) 450 .WithTag("FINETUNING", 8, 6) 451 .WithReservedBits(14, 1) 452 .WithTaggedFlag("LDOHP", 15) 453 .WithTag("FREQRANGE", 16, 5) 454 .WithTag("CMPBIAS", 21, 3) 455 .WithTag("CLKDIV", 24, 2) 456 .WithTag("CMPSEL", 26, 2) 457 .WithTag("IREFTC", 28, 4) 458 }, 459 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration10, new DoubleWordRegister(this, 0xC88A_9C40) 460 .WithTag("TUNING", 0, 7) 461 .WithReservedBits(7, 1) 462 .WithTag("FINETUNING", 8, 6) 463 .WithReservedBits(14, 1) 464 .WithTaggedFlag("LDOHP", 15) 465 .WithTag("FREQRANGE", 16, 5) 466 .WithTag("CMPBIAS", 21, 3) 467 .WithTag("CLKDIV", 24, 2) 468 .WithTag("CMPSEL", 26, 2) 469 .WithTag("IREFTC", 28, 4) 470 }, 471 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration11, new DoubleWordRegister(this, 0xC8AB_A043) 472 .WithTag("TUNING", 0, 7) 473 .WithReservedBits(7, 1) 474 .WithTag("FINETUNING", 8, 6) 475 .WithReservedBits(14, 1) 476 .WithTaggedFlag("LDOHP", 15) 477 .WithTag("FREQRANGE", 16, 5) 478 .WithTag("CMPBIAS", 21, 3) 479 .WithTag("CLKDIV", 24, 2) 480 .WithTag("CMPSEL", 26, 2) 481 .WithTag("IREFTC", 28, 4) 482 }, 483 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration12, new DoubleWordRegister(this, 0xC8CC_A136) 484 .WithTag("TUNING", 0, 7) 485 .WithReservedBits(7, 1) 486 .WithTag("FINETUNING", 8, 6) 487 .WithReservedBits(14, 1) 488 .WithTaggedFlag("LDOHP", 15) 489 .WithTag("FREQRANGE", 16, 5) 490 .WithTag("CMPBIAS", 21, 3) 491 .WithTag("CLKDIV", 24, 2) 492 .WithTag("CMPSEL", 26, 2) 493 .WithTag("IREFTC", 28, 4) 494 }, 495 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration13, new DoubleWordRegister(this, 0xDCED_9F3A) 496 .WithTag("TUNING", 0, 7) 497 .WithReservedBits(7, 1) 498 .WithTag("FINETUNING", 8, 6) 499 .WithReservedBits(14, 1) 500 .WithTaggedFlag("LDOHP", 15) 501 .WithTag("FREQRANGE", 16, 5) 502 .WithTag("CMPBIAS", 21, 3) 503 .WithTag("CLKDIV", 24, 2) 504 .WithTag("CMPSEL", 26, 2) 505 .WithTag("IREFTC", 28, 4) 506 }, 507 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration14, new DoubleWordRegister(this, 0xDCEE_9F3A) 508 .WithTag("TUNING", 0, 7) 509 .WithReservedBits(7, 1) 510 .WithTag("FINETUNING", 8, 6) 511 .WithReservedBits(14, 1) 512 .WithTaggedFlag("LDOHP", 15) 513 .WithTag("FREQRANGE", 16, 5) 514 .WithTag("CMPBIAS", 21, 3) 515 .WithTag("CLKDIV", 24, 2) 516 .WithTag("CMPSEL", 26, 2) 517 .WithTag("IREFTC", 28, 4) 518 }, 519 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration15, new DoubleWordRegister(this, 0xDCEF_9F3A) 520 .WithTag("TUNING", 0, 7) 521 .WithReservedBits(7, 1) 522 .WithTag("FINETUNING", 8, 6) 523 .WithReservedBits(14, 1) 524 .WithTaggedFlag("LDOHP", 15) 525 .WithTag("FREQRANGE", 16, 5) 526 .WithTag("CMPBIAS", 21, 3) 527 .WithTag("CLKDIV", 24, 2) 528 .WithTag("CMPSEL", 26, 2) 529 .WithTag("IREFTC", 28, 4) 530 }, 531 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration16, new DoubleWordRegister(this, 0xDCF0_9F3A) 532 .WithTag("TUNING", 0, 7) 533 .WithReservedBits(7, 1) 534 .WithTag("FINETUNING", 8, 6) 535 .WithReservedBits(14, 1) 536 .WithTaggedFlag("LDOHP", 15) 537 .WithTag("FREQRANGE", 16, 5) 538 .WithTag("CMPBIAS", 21, 3) 539 .WithTag("CLKDIV", 24, 2) 540 .WithTag("CMPSEL", 26, 2) 541 .WithTag("IREFTC", 28, 4) 542 }, 543 {(long)Registers.HighFrequencyRcOscillatorEm23Calibration17, new DoubleWordRegister(this, 0xDCF1_9F3A) 544 .WithTag("TUNING", 0, 7) 545 .WithReservedBits(7, 1) 546 .WithTag("FINETUNING", 8, 6) 547 .WithReservedBits(14, 1) 548 .WithTaggedFlag("LDOHP", 15) 549 .WithTag("FREQRANGE", 16, 5) 550 .WithTag("CMPBIAS", 21, 3) 551 .WithTag("CLKDIV", 24, 2) 552 .WithTag("CMPSEL", 26, 2) 553 .WithTag("IREFTC", 28, 4) 554 }, 555 {(long)Registers.LegacyDeviceInformation, new DoubleWordRegister(this, 0x0080_0000) 556 .WithReservedBits(0, 16) 557 .WithTag("DEVICEFAMILY", 16, 8) 558 .WithReservedBits(24, 8) 559 }, 560 }; 561 562 return new DoubleWordRegisterCollection(this, registerDictionary); 563 } 564 565 private readonly DoubleWordRegisterCollection registers; 566 567 private enum Registers 568 { 569 DeviceInformation = 0x000, 570 PartInformation = 0x004, 571 MemoryInformation = 0x008, 572 MemorySize = 0x00C, 573 MiscDeviceInformation = 0x010, 574 CustomPartInformation = 0x014, 575 SoftwareFix = 0x018, 576 SoftwareRestriction0 = 0x01C, 577 SoftwareRestriction1 = 0x020, 578 ExternalComponentInformation = 0x028, 579 ExtendedUniqueIdentifier48Low = 0x040, 580 ExtendedUniqueIdentifier48High = 0x044, 581 ExtendedUniqueIdentifier64Low = 0x048, 582 ExtendedUniqueIdentifier64High = 0x04C, 583 CalibrationTemperature = 0x050, 584 EnergyManagementUnitTemperatureCalibration = 0x054, 585 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration0 = 0x058, 586 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration1 = 0x05C, 587 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration2 = 0x060, 588 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration3 = 0x064, 589 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration4 = 0x068, 590 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration5 = 0x06C, 591 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration6 = 0x070, 592 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration7 = 0x074, 593 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration8 = 0x078, 594 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration9 = 0x07C, 595 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration10 = 0x080, 596 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration11 = 0x084, 597 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration12 = 0x088, 598 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration13 = 0x08C, 599 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration14 = 0x090, 600 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration15 = 0x094, 601 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration16 = 0x098, 602 HighFrequencyRcOscillatorDigitalPhasedLockedLoopCalibration17 = 0x09C, 603 HighFrequencyRcOscillatorEm23Calibration0 = 0x0A0, 604 HighFrequencyRcOscillatorEm23Calibration1 = 0x0A4, 605 HighFrequencyRcOscillatorEm23Calibration2 = 0x0A8, 606 HighFrequencyRcOscillatorEm23Calibration3 = 0x0AC, 607 HighFrequencyRcOscillatorEm23Calibration4 = 0x0B0, 608 HighFrequencyRcOscillatorEm23Calibration5 = 0x0B4, 609 HighFrequencyRcOscillatorEm23Calibration6 = 0x0B8, 610 HighFrequencyRcOscillatorEm23Calibration7 = 0x0BC, 611 HighFrequencyRcOscillatorEm23Calibration8 = 0x0C0, 612 HighFrequencyRcOscillatorEm23Calibration9 = 0x0C4, 613 HighFrequencyRcOscillatorEm23Calibration10 = 0x0C8, 614 HighFrequencyRcOscillatorEm23Calibration11 = 0x0CC, 615 HighFrequencyRcOscillatorEm23Calibration12 = 0x0D0, 616 HighFrequencyRcOscillatorEm23Calibration13 = 0x0D4, 617 HighFrequencyRcOscillatorEm23Calibration14 = 0x0D8, 618 HighFrequencyRcOscillatorEm23Calibration15 = 0x0DC, 619 HighFrequencyRcOscillatorEm23Calibration16 = 0x0E0, 620 HighFrequencyRcOscillatorEm23Calibration17 = 0x0E4, 621 ModuleName0Information = 0x130, 622 ModuleName1Information = 0x134, 623 ModuleName2Information = 0x138, 624 ModuleName3Information = 0x13C, 625 ModuleName4Information = 0x140, 626 ModuleName5Information = 0x144, 627 ModuleName6Information = 0x148, 628 ModuleInformation = 0x14C, 629 ModuleExternalOscillatorCalibrationInformation = 0x150, 630 IncrementalAnalogDigitalConverterGain0Calibration = 0x180, 631 IncrementalAnalogDigitalConverterGain1Calibration = 0x184, 632 IncrementalAnalogDigitalConverterOffsetCalibration = 0x188, 633 IncrementalAnalogDigitalConverterNormalOffsetCalibrarion0 = 0x18C, 634 IncrementalAnalogDigitalConverterNormalOffsetCalibrarion1 = 0x190, 635 IncrementalAnalogDigitalConverterHighSpeedOffsetCalibration0 = 0x194, 636 IncrementalAnalogDigitalConverterHighSpeedOffsetCalibration1 = 0x198, 637 LegacyDeviceInformation = 0x1FC, 638 ThermistorCalibration = 0x25C, 639 FenotchCalibration = 0x264, 640 } 641 } 642 } 643