CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/Linux_HAL_Essentials/pru/rangefinderpru/pru_ctrl.h
Views: 1800
1
2
3
/* PRU_CTRL register set */
4
typedef struct{
5
6
/* PRU_CTRL_CONTROL register bit field */
7
union {
8
volatile uint32_t CTRL;
9
10
volatile struct{
11
unsigned SOFT_RST_N : 1;
12
unsigned EN : 1;
13
unsigned SLEEPING : 1;
14
unsigned CTR_EN : 1;
15
unsigned rsvd4 : 4;
16
unsigned SINGLE_STEP : 1;
17
unsigned rsvd9 : 6;
18
unsigned RUNSTATE : 1;
19
unsigned PCTR_RST_VAL : 16;
20
} CONTROL_bit;
21
} ; // 0x0
22
23
24
/* PRU_CTRL_STATUS register bit field */
25
union {
26
volatile uint32_t STS;
27
28
volatile struct{
29
unsigned PCTR : 16;
30
unsigned rsvd16 : 16;
31
} STATUS_bit;
32
} ; // 0x4
33
34
35
/* PRU_CTRL_WAKEUP_EN register bit field */
36
union {
37
volatile uint32_t WAKEUP_EN;
38
39
volatile struct{
40
unsigned BITWISE_ENS : 32;
41
} WAKEUP_EN_bit;
42
} ; // 0x8
43
44
45
/* PRU_CTRL_CYCLE register bit field */
46
union {
47
volatile uint32_t CYCLE;
48
49
volatile struct{
50
unsigned CYCLECOUNT : 32;
51
} CYCLE_bit;
52
} ; // 0xC
53
54
55
/* PRU_CTRL_STALL register bit field */
56
union {
57
volatile uint32_t STALL;
58
59
volatile struct{
60
unsigned STALLCOUNT : 32;
61
} STALL_bit;
62
} ; // 0x10
63
64
65
uint32_t rsvd14[3]; // 0x14 - 0x1C
66
67
68
/* PRU_CTRL_CTBIR0 register bit field */
69
union {
70
volatile uint32_t CTBIR0;
71
72
volatile struct{
73
unsigned C24_BLK_IDX : 8;
74
unsigned rsvd8 : 8;
75
unsigned C25_BLK_IDX : 8;
76
unsigned rsvd24 : 8;
77
} CTBIR0_bit;
78
} ; // 0x20
79
80
81
/* PRU_CTRL_CTBIR1 register bit field */
82
union {
83
volatile uint32_t CTBIR1;
84
85
volatile struct{
86
unsigned C26_BLK_IDX : 8;
87
unsigned rsvd8 : 8;
88
unsigned C27_BLK_IDX : 8;
89
unsigned rsvd24 : 8;
90
} CTBIR1_bit;
91
} ; // 0x24
92
93
94
/* PRU_CTRL_CTPPR0 register bit field */
95
union {
96
volatile uint32_t CTPPR0;
97
98
volatile struct{
99
unsigned C28_BLK_POINTER : 16;
100
unsigned C29_BLK_POINTER : 16;
101
} CTPPR0_bit;
102
} ; // 0x28
103
104
105
/* PRU_CTRL_CTPPR1 register bit field */
106
union {
107
volatile uint32_t CTPPR1;
108
109
volatile struct{
110
unsigned C30_BLK_POINTER : 16;
111
unsigned C31_BLK_POINTER : 16;
112
} CTPPR1_bit;
113
} ; // 0x2C
114
115
} pruCtrl;
116
117
/* Definition of control register structures. */
118
#define PRU0_CTRL (*((volatile pruCtrl*)0x22000))
119
#define PRU1_CTRL (*((volatile pruCtrl*)0x24000))
120
121