rosc.h
1// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
2
8#ifndef _HARDWARE_STRUCTS_ROSC_H
9#define _HARDWARE_STRUCTS_ROSC_H
10
12#include "hardware/regs/rosc.h"
13
14// Reference to datasheet: https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf#tab-registerlist_rosc
15//
16// The _REG_ macro is intended to help make the register navigable in your IDE (for example, using the "Go to Definition" feature)
17// _REG_(x) will link to the corresponding register in hardware/regs/rosc.h.
18//
19// Bit-field descriptions are of the form:
20// BITMASK [BITRANGE] FIELDNAME (RESETVALUE) DESCRIPTION
21
22typedef struct {
23 _REG_(ROSC_CTRL_OFFSET) // ROSC_CTRL
24 // Ring Oscillator control
25 // 0x00fff000 [23:12] ENABLE (-) On power-up this field is initialised to ENABLE +
26 // 0x00000fff [11:0] FREQ_RANGE (0xaa0) Controls the number of delay stages in the ROSC ring +
27 io_rw_32 ctrl;
28
29 _REG_(ROSC_FREQA_OFFSET) // ROSC_FREQA
30 // Ring Oscillator frequency control A
31 // 0xffff0000 [31:16] PASSWD (0x0000) Set to 0x9696 to apply the settings +
32 // 0x00007000 [14:12] DS3 (0x0) Stage 3 drive strength
33 // 0x00000700 [10:8] DS2 (0x0) Stage 2 drive strength
34 // 0x00000080 [7] DS1_RANDOM (0) Randomises the stage 1 drive strength
35 // 0x00000070 [6:4] DS1 (0x0) Stage 1 drive strength
36 // 0x00000008 [3] DS0_RANDOM (0) Randomises the stage 0 drive strength
37 // 0x00000007 [2:0] DS0 (0x0) Stage 0 drive strength
38 io_rw_32 freqa;
39
40 _REG_(ROSC_FREQB_OFFSET) // ROSC_FREQB
41 // Ring Oscillator frequency control B
42 // 0xffff0000 [31:16] PASSWD (0x0000) Set to 0x9696 to apply the settings +
43 // 0x00007000 [14:12] DS7 (0x0) Stage 7 drive strength
44 // 0x00000700 [10:8] DS6 (0x0) Stage 6 drive strength
45 // 0x00000070 [6:4] DS5 (0x0) Stage 5 drive strength
46 // 0x00000007 [2:0] DS4 (0x0) Stage 4 drive strength
47 io_rw_32 freqb;
48
49 _REG_(ROSC_RANDOM_OFFSET) // ROSC_RANDOM
50 // Loads a value to the LFSR randomiser
51 // 0xffffffff [31:0] SEED (0x3f04b16d)
52 io_rw_32 random;
53
54 _REG_(ROSC_DORMANT_OFFSET) // ROSC_DORMANT
55 // Ring Oscillator pause control
56 // 0xffffffff [31:0] DORMANT (-) This is used to save power by pausing the ROSC +
57 io_rw_32 dormant;
58
59 _REG_(ROSC_DIV_OFFSET) // ROSC_DIV
60 // Controls the output divider
61 // 0x0000ffff [15:0] DIV (-) set to 0xaa00 + div where +
62 io_rw_32 div;
63
64 _REG_(ROSC_PHASE_OFFSET) // ROSC_PHASE
65 // Controls the phase shifted output
66 // 0x00000ff0 [11:4] PASSWD (0x00) set to 0xaa +
67 // 0x00000008 [3] ENABLE (1) enable the phase-shifted output +
68 // 0x00000004 [2] FLIP (0) invert the phase-shifted output +
69 // 0x00000003 [1:0] SHIFT (0x0) phase shift the phase-shifted output by SHIFT input clocks +
70 io_rw_32 phase;
71
72 _REG_(ROSC_STATUS_OFFSET) // ROSC_STATUS
73 // Ring Oscillator Status
74 // 0x80000000 [31] STABLE (0) Oscillator is running and stable
75 // 0x01000000 [24] BADWRITE (0) An invalid value has been written to CTRL_ENABLE or...
76 // 0x00010000 [16] DIV_RUNNING (-) post-divider is running +
77 // 0x00001000 [12] ENABLED (-) Oscillator is enabled but not necessarily running and stable +
78 io_rw_32 status;
79
80 _REG_(ROSC_RANDOMBIT_OFFSET) // ROSC_RANDOMBIT
81 // Returns a 1 bit random value
82 // 0x00000001 [0] RANDOMBIT (1)
83 io_ro_32 randombit;
84
85 _REG_(ROSC_COUNT_OFFSET) // ROSC_COUNT
86 // A down counter running at the ROSC frequency which counts to zero and stops.
87 // 0x0000ffff [15:0] COUNT (0x0000)
88 io_rw_32 count;
89
90} rosc_hw_t;
91
92#define rosc_hw ((rosc_hw_t *)ROSC_BASE)
93static_assert(sizeof (rosc_hw_t) == 0x0028, "");
94
95#endif // _HARDWARE_STRUCTS_ROSC_H
96
Definition: rosc.h:22