cc26x2_cc13x2_prcm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Leon George
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
17 #ifndef CC26X2_CC13X2_PRCM_H
18 #define CC26X2_CC13X2_PRCM_H
19 
20 #include <cc26xx_cc13xx.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
29 typedef struct {
30  reg32_t CTL0;
31  reg32_t CTL1;
32  reg32_t RADCEXTCFG;
33  reg32_t AMPCOMPCTL;
34  reg32_t AMPCOMPTH1;
35  reg32_t AMPCOMPTH2;
36  reg32_t ANABYPASSVAL1;
37  reg32_t ANABYPASSVAL2;
38  reg32_t ATESTCTL;
39  reg32_t ADCDOUBLERNANOAMPCTL;
40  reg32_t XOSCHFCTL;
41  reg32_t LFOSCCTL;
42  reg32_t RCOSCHFCTL;
43  reg32_t RCOSCMFCTL;
44  reg32_t __reserved1;
45  reg32_t STAT0;
46  reg32_t STAT1;
47  reg32_t STAT2;
49 
53 typedef struct {
73 
78 #define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_m 0x00000001
79 #define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_s 0
80 #define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_XOSC 0x00000001
81 #define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_RCOSC 0x00000000
82 #define DDI_0_OSC_CTL0_SCLK_LF_SRC_SEL_m 0x0000000C
83 #define DDI_0_OSC_CTL0_SCLK_LF_SRC_SEL_s 2
84 #define DDI_0_OSC_CTL0_ACLK_TDC_SRC_SEL 0x00000180
85 #define DDI_0_OSC_CTL0_CLK_LOSS_EN 0x00000200
86 #define DDI_0_OSC_CTL0_XOSC_LF_DIG_BYPASS 0x00000400
87 #define DDI_0_OSC_CTL0_XOSC_HF_POWER_MODE 0x00000800
88 #define DDI_0_OSC_CTL0_RCOSC_LF_TRIMMED 0x00001000
89 #define DDI_0_OSC_CTL0_HPOSC_MODE_EN 0x00004000
90 #define DDI_0_OSC_CTL0_CLK_DCDC_SRC_SEL_m 0x01000000
91 #define DDI_0_OSC_CTL0_DOUBLER_RESET_DURATION 0x02000000
92 #define DDI_0_OSC_CTL0_DOUBLER_START_DURATION 0x0C000000
93 #define DDI_0_OSC_CTL0_BYPASS_RCOSC_LF_CLK_QUAL 0x10000000
94 #define DDI_0_OSC_CTL0_BYPASS_XOSC_LF_CLK_QUAL 0x20000000
95 #define DDI_0_OSC_CTL0_XTAL_IS_24M 0x80000000
96 #define DDI_0_OSC_STAT0_PENDINGSCLKHFSWITCHING 0x00000001
97 #define DDI_0_OSC_STAT0_SCLK_HF_SRC_m 0x10000000
98 #define DDI_0_OSC_STAT0_SCLK_HF_SRC_s 28
99 #define DDI_0_OSC_STAT0_SCLK_LF_SRC_m 0x60000000
100 #define DDI_0_OSC_STAT0_SCLK_LF_SRC_s 29
101 
107 #define DDI_DIR 0x00000000
108 #define DDI_SET 0x00000080
109 #define DDI_CLR 0x00000100
110 #define DDI_MASK4B 0x00000200
111 #define DDI_MASK8B 0x00000300
112 #define DDI_MASK16B 0x00000400
113 
116 #define DDI0_OSC_BASE (PERIPH_BASE + 0xCA000)
117 
120 #define DDI0_OSC_BASE_M16 (DDI0_OSC_BASE + DDI_MASK16B)
121 
126 #define DDI_0_OSC ((ddi0_osc_regs_t *) (DDI0_OSC_BASE))
127 
130 #define DDI_0_OSC_M16 ((ddi0_osc_regs_m16_t *) (DDI0_OSC_BASE_M16))
131 
136 #define OSC_RCOSC_HF 0x00000000
137 #define OSC_XOSC_HF 0x00000001
151 void osc_hf_source_switch(uint32_t osc);
152 
157 typedef struct {
158  reg32_t __reserved1;
159  reg32_t AUXSCECLK;
160  reg32_t RAMCFG;
161  reg32_t __reserved2;
162  reg32_t PWRCTL;
163  reg32_t PWRSTAT;
164  reg32_t SHUTDOWN;
165  reg32_t RECHARGECFG;
166  reg32_t RECHARGESTAT;
167  reg32_t OSCCFG;
168  reg32_t RESETCTL;
169  reg32_t SLEEPCTL;
170  reg32_t __reserved3;
171  reg32_t JTAGCFG;
172  reg32_t __reserved4;
173  reg32_t JTAGUSERCODE;
175 
180 #define AON_PMCTL_SLEEPCTL_IO_PAD_SLEEP_DIS 0x00000001
181 #define AON_PMCTL_RESETCTL_BOOT_DET_1_CLR_m 0x02000000
182 #define AON_PMCTL_RESETCTL_BOOT_DET_0_CLR_m 0x01000000
183 #define AON_PMCTL_RESETCTL_BOOT_DET_1_SET_m 0x00020000
184 #define AON_PMCTL_RESETCTL_BOOT_DET_0_SET_m 0x00010000
185 #define AON_PMCTL_RESETCTL_BOOT_DET_1_m 0x00002000
186 #define AON_PMCTL_RESETCTL_BOOT_DET_0_m 0x00001000
187 #define AON_PMCTL_RESETCTL_BOOT_DET_0_s 12
188 #define AON_PMCTL_RESETCTL_MCU_WARM_RESET_m 0x00000010
189 
198 #define AON_PMCTL_BASE (PERIPH_BASE + 0x90000)
199 
204 #define AON_PMCTL ((aon_pmctl_regs_t *) (AON_PMCTL_BASE))
205 
209 typedef struct {
210  reg32_t CTL;
211  reg32_t EVFLAGS;
212  reg32_t SEC;
213  reg32_t SUBSEC;
214  reg32_t SUBSECINC;
215  reg32_t CHCTL;
216  reg32_t CH0CMP;
217  reg32_t CH1CMP;
218  reg32_t CH2CMP;
219  reg32_t CH2CMPINC;
220  reg32_t CH1CAPT;
221  reg32_t SYNC;
222  reg32_t TIME;
223  reg32_t SYNCLF;
225 
232 #define AON_RTC_CTL_RTC_UPD_EN 0x00000002
233 
237 #define AON_RTC_BASE (PERIPH_BASE + 0x92000)
240 #define AON_RTC ((aon_rtc_regs_t *) (AON_RTC_BASE))
245 typedef struct {
246  reg32_t INFRCLKDIVR;
247  reg32_t INFRCLKDIVS;
248  reg32_t INFRCLKDIVDS;
249  reg32_t VDCTL;
250  reg32_t __reserved1[6];
251  reg32_t CLKLOADCTL;
252  reg32_t RFCCLKG;
253  reg32_t VIMSCLKG;
254  reg32_t __reserved2[2];
255  reg32_t SECDMACLKGR;
256  reg32_t SECDMACLKGS;
257  reg32_t SECDMACLKGDS;
258  reg32_t GPIOCLKGR;
259  reg32_t GPIOCLKGS;
260  reg32_t GPIOCLKGDS;
261  reg32_t GPTCLKGR;
262  reg32_t GPTCLKGS;
263  reg32_t GPTCLKGDS;
264  reg32_t I2CCLKGR;
265  reg32_t I2CCLKGS;
266  reg32_t I2CCLKGDS;
267  reg32_t UARTCLKGR;
268  reg32_t UARTCLKGS;
269  reg32_t UARTCLKGDS;
270  reg32_t SSICLKGR;
271  reg32_t SSICLKGS;
272  reg32_t SSICLKGDS;
273  reg32_t I2SCLKGR;
274  reg32_t I2SCLKGS;
275  reg32_t I2SCLKGDS;
276  reg32_t __reserved3[9];
277  reg32_t SYSBUSCLKDIV;
278  reg32_t CPUCLKDIV;
279  reg32_t PERBUSCPUCLKDIV;
280  reg32_t __reserved4;
281  reg32_t PERDMACLKDIV;
282  reg32_t I2SBCLKSEL;
283  reg32_t GPTCLKDIV;
284  reg32_t I2SCLKCTL;
285  reg32_t I2SMCLKDIV;
286  reg32_t I2SBCLKDIV;
287  reg32_t I2SWCLKDIV;
288  reg32_t __reserved5[4];
289  reg32_t RESETSECDMA;
290  reg32_t RESETGPIO;
291  reg32_t RESETGPT;
292  reg32_t RESETI2C;
293  reg32_t RESETUART;
294  reg32_t RESETSSI;
295  reg32_t RESETI2S;
296  reg32_t __reserved6[8];
297  reg32_t PDCTL0;
298  reg32_t PDCTL0RFC;
299  reg32_t PDCTL0SERIAL;
300  reg32_t PDCTL0PERIPH;
301  reg32_t __reserved7;
302  reg32_t PDSTAT0;
303  reg32_t PDSTAT0RFC;
304  reg32_t PDSTAT0SERIAL;
305  reg32_t PDSTAT0PERIPH;
306  reg32_t __reserved8[11];
307  reg32_t PDCTL1;
308  reg32_t __reserved9;
309  reg32_t PDCTL1CPU;
310  reg32_t PDCTL1RFC;
311  reg32_t PDCTL1VIMS;
312  reg32_t __reserved10;
313  reg32_t PDSTAT1;
314  reg32_t PDSTAT1BUS;
315  reg32_t PDSTAT1RFC;
316  reg32_t PDSTAT1CPU;
317  reg32_t PDSTAT1VIMS;
318  reg32_t __reserved11[9];
319  reg32_t RFCBITS;
320  reg32_t RFCMODESEL;
321  reg32_t RFCMODEHWOPT;
322  reg32_t __reserved12[2];
323  reg32_t PWRPROFSTAT;
324  reg32_t __reserved13[14];
325  reg32_t MCUSRAMCFG;
326  reg32_t __reserved14;
327  reg32_t RAMRETEN;
328  reg32_t __reserved15[27];
329  reg32_t OSCIMSC;
330  reg32_t OSCRIS;
331  reg32_t OSCICR;
332 } prcm_regs_t;
333 
338 #define CLKLOADCTL_LOAD 0x1
339 #define CLKLOADCTL_LOADDONE 0x2
340 
341 #define PDCTL0_RFC_ON 0x1
342 #define PDCTL0_SERIAL_ON 0x2
343 #define PDCTL0_PERIPH_ON 0x4
344 
345 #define PDSTAT0_RFC_ON 0x1
346 #define PDSTAT0_SERIAL_ON 0x2
347 #define PDSTAT0_PERIPH_ON 0x4
348 
349 #define PDCTL1_CPU_ON 0x2
350 #define PDCTL1_RFC_ON 0x4
351 #define PDCTL1_VIMS_ON 0x8
352 
353 #define PDSTAT1_CPU_ON 0x2
354 #define PDSTAT1_RFC_ON 0x4
355 #define PDSTAT1_VIMS_ON 0x8
356 
357 #define GPIOCLKGR_CLK_EN 0x1
358 #define I2CCLKGR_CLK_EN 0x1
359 #define UARTCLKGR_CLK_EN_UART0 0x1
360 #define UARTCLKGR_CLK_EN_UART1 0x2
361 
362 #define GPIOCLKGS_CLK_EN 0x1
363 #define I2CCLKGS_CLK_EN 0x1
364 #define UARTCLKGS_CLK_EN_UART0 0x1
365 #define UARTCLKGS_CLK_EN_UART1 0x2
366 
367 #define GPIOCLKGDS_CLK_EN 0x1
368 #define I2CCLKGDS_CLK_EN 0x1
369 #define UARTCLKGDS_CLK_EN_UART0 0x1
370 #define UARTCLKGDS_CLK_EN_UART1 0x2
371 
376 #define PRCM_BASE (PERIPH_BASE + 0x82000)
377 #define PRCM_BASE_NONBUF (PERIPH_BASE_NONBUF + 0x82000)
379 
380 #define PRCM ((prcm_regs_t *) (PRCM_BASE))
381 #define PRCM_NONBUF ((prcm_regs_t *) (PRCM_BASE_NONBUF))
383 #ifdef __cplusplus
384 } /* end extern "C" */
385 #endif
386 
387 #endif /* CC26X2_CC13X2_PRCM_H */
388 
prcm_regs_t::RESETGPIO
reg32_t RESETGPIO
Reset GPIO.
Definition: cc26x2_cc13x2_prcm.h:290
ddi0_osc_regs_m16_t::__reserved1
reg32_m16_t __reserved1
Reserved.
Definition: cc26x2_cc13x2_prcm.h:68
prcm_regs_t::RFCBITS
reg32_t RFCBITS
Control to RFC.
Definition: cc26x2_cc13x2_prcm.h:319
prcm_regs_t::PERBUSCPUCLKDIV
reg32_t PERBUSCPUCLKDIV
Peripheral bus division factor.
Definition: cc26x2_cc13x2_prcm.h:279
ddi0_osc_regs_m16_t::RADCEXTCFG
reg32_m16_t RADCEXTCFG
RADC External Configuration.
Definition: cc26x2_cc13x2_prcm.h:56
aon_pmctl_regs_t::RECHARGECFG
reg32_t RECHARGECFG
Recharge controller configuration.
Definition: cc26x2_cc13x2_prcm.h:165
prcm_regs_t::RESETI2C
reg32_t RESETI2C
Reset I2C.
Definition: cc26x2_cc13x2_prcm.h:292
aon_pmctl_regs_t::PWRCTL
reg32_t PWRCTL
Power management control.
Definition: cc26x2_cc13x2_prcm.h:162
ddi0_osc_regs_m16_t::AMPCOMPCTL
reg32_m16_t AMPCOMPCTL
Amplitude Compensation Control.
Definition: cc26x2_cc13x2_prcm.h:57
aon_pmctl_regs_t::SLEEPCTL
reg32_t SLEEPCTL
Reset control.
Definition: cc26x2_cc13x2_prcm.h:169
ddi0_osc_regs_m16_t::AMPCOMPTH2
reg32_m16_t AMPCOMPTH2
Amplitude Compensation Threshold 2.
Definition: cc26x2_cc13x2_prcm.h:59
ddi0_osc_regs_t
DDI_0_OSC registers.
Definition: cc26x0_prcm.h:30
prcm_regs_t::RFCMODEHWOPT
reg32_t RFCMODEHWOPT
allowed RFC modes
Definition: cc26x2_cc13x2_prcm.h:321
prcm_regs_t
PRCM registers.
Definition: cc26x0_prcm.h:233
aon_pmctl_regs_t::RECHARGESTAT
reg32_t RECHARGESTAT
Recharge controller status.
Definition: cc26x2_cc13x2_prcm.h:166
prcm_regs_t::RESETGPT
reg32_t RESETGPT
Reset GPTs.
Definition: cc26x2_cc13x2_prcm.h:291
aon_pmctl_regs_t::RAMCFG
reg32_t RAMCFG
RAM configuration.
Definition: cc26x2_cc13x2_prcm.h:160
prcm_regs_t::OSCICR
reg32_t OSCICR
oscillator raw interrupt clear
Definition: cc26x2_cc13x2_prcm.h:331
ddi0_osc_regs_m16_t::CTL1
reg32_m16_t CTL1
Control 1.
Definition: cc26x2_cc13x2_prcm.h:55
aon_pmctl_regs_t::JTAGCFG
reg32_t JTAGCFG
JTAG configuration.
Definition: cc26x2_cc13x2_prcm.h:171
ddi0_osc_regs_m16_t::XOSCHFCTL
reg32_m16_t XOSCHFCTL
XOSCHF Control.
Definition: cc26x2_cc13x2_prcm.h:64
prcm_regs_t::RESETSSI
reg32_t RESETSSI
Reset SSI.
Definition: cc26x2_cc13x2_prcm.h:294
ddi0_osc_regs_m16_t::RCOSCMFCTL
reg32_m16_t RCOSCMFCTL
RCOSC_MF Control.
Definition: cc26x2_cc13x2_prcm.h:67
ddi0_osc_regs_m16_t::ANABYPASSVAL1
reg32_m16_t ANABYPASSVAL1
Analog Bypass Values 1.
Definition: cc26x2_cc13x2_prcm.h:60
ddi0_osc_regs_m16_t::RCOSCHFCTL
reg32_m16_t RCOSCHFCTL
RCOSCHF Control.
Definition: cc26x2_cc13x2_prcm.h:66
ddi0_osc_regs_m16_t::CTL0
reg32_m16_t CTL0
Control 0.
Definition: cc26x2_cc13x2_prcm.h:54
prcm_regs_t::PWRPROFSTAT
reg32_t PWRPROFSTAT
power profiler register
Definition: cc26x2_cc13x2_prcm.h:323
aon_pmctl_regs_t
AON_PMCTL registers.
Definition: cc26x2_cc13x2_prcm.h:157
prcm_regs_t::RESETSECDMA
reg32_t RESETSECDMA
Reset SEC and UDMA.
Definition: cc26x2_cc13x2_prcm.h:289
ddi0_osc_regs_m16_t::LFOSCCTL
reg32_m16_t LFOSCCTL
Low Frequency Oscillator Control.
Definition: cc26x2_cc13x2_prcm.h:65
aon_rtc_regs_t
AON_RTC registers.
Definition: cc26x0_prcm.h:198
ddi0_osc_regs_m16_t::STAT0
reg32_m16_t STAT0
Status 0.
Definition: cc26x2_cc13x2_prcm.h:69
prcm_regs_t::OSCIMSC
reg32_t OSCIMSC
oscillator interrupt mask
Definition: cc26x2_cc13x2_prcm.h:329
ddi0_osc_regs_m16_t::AMPCOMPTH1
reg32_m16_t AMPCOMPTH1
Amplitude Compensation Threshold 1.
Definition: cc26x2_cc13x2_prcm.h:58
aon_pmctl_regs_t::AUXSCECLK
reg32_t AUXSCECLK
AUX SCE management.
Definition: cc26x2_cc13x2_prcm.h:159
aon_pmctl_regs_t::PWRSTAT
reg32_t PWRSTAT
Power status.
Definition: cc26x2_cc13x2_prcm.h:163
aon_pmctl_regs_t::SHUTDOWN
reg32_t SHUTDOWN
Shutdown control.
Definition: cc26x2_cc13x2_prcm.h:164
cc26xx_cc13xx.h
CC26xx, CC13xx definitions.
prcm_regs_t::MCUSRAMCFG
reg32_t MCUSRAMCFG
MCU SRAM configuration.
Definition: cc26x2_cc13x2_prcm.h:325
reg32_m16_t
Masked 32-bit register.
Definition: cc26xx_cc13xx.h:49
aon_rtc_regs_t::SYNCLF
reg32_t SYNCLF
Synchronization to SCLK_LF.
Definition: cc26x2_cc13x2_prcm.h:223
aon_pmctl_regs_t::__reserved4
reg32_t __reserved4
Reserved.
Definition: cc26x2_cc13x2_prcm.h:172
aon_pmctl_regs_t::JTAGUSERCODE
reg32_t JTAGUSERCODE
JTAG USERCODE.
Definition: cc26x2_cc13x2_prcm.h:173
prcm_regs_t::OSCRIS
reg32_t OSCRIS
oscillator raw interrupt status
Definition: cc26x2_cc13x2_prcm.h:330
aon_pmctl_regs_t::RESETCTL
reg32_t RESETCTL
Reset control.
Definition: cc26x2_cc13x2_prcm.h:168
aon_pmctl_regs_t::__reserved3
reg32_t __reserved3
Reserved.
Definition: cc26x2_cc13x2_prcm.h:170
prcm_regs_t::PERDMACLKDIV
reg32_t PERDMACLKDIV
DMA clock division factor.
Definition: cc26x2_cc13x2_prcm.h:281
aon_pmctl_regs_t::__reserved1
reg32_t __reserved1
Reserved.
Definition: cc26x2_cc13x2_prcm.h:158
ddi0_osc_regs_m16_t::STAT1
reg32_m16_t STAT1
Status 1.
Definition: cc26x2_cc13x2_prcm.h:70
aon_pmctl_regs_t::__reserved2
reg32_t __reserved2
Reserved.
Definition: cc26x2_cc13x2_prcm.h:161
prcm_regs_t::RESETUART
reg32_t RESETUART
Reset UART.
Definition: cc26x2_cc13x2_prcm.h:293
ddi0_osc_regs_m16_t::ATESTCTL
reg32_m16_t ATESTCTL
Analog Test Control.
Definition: cc26x2_cc13x2_prcm.h:62
aon_rtc_regs_t::TIME
reg32_t TIME
Current Counter Value.
Definition: cc26x2_cc13x2_prcm.h:222
prcm_regs_t::SYSBUSCLKDIV
reg32_t SYSBUSCLKDIV
System bus clock division factor.
Definition: cc26x2_cc13x2_prcm.h:277
ddi0_osc_regs_t::RCOSCMFCTL
reg32_t RCOSCMFCTL
RCOSC_MF Control.
Definition: cc26x2_cc13x2_prcm.h:43
prcm_regs_t::RESETI2S
reg32_t RESETI2S
Reset I2S.
Definition: cc26x2_cc13x2_prcm.h:295
ddi0_osc_regs_m16_t
DDI_0_OSC registers with masked 16-bit access.
Definition: cc26x2_cc13x2_prcm.h:53
ddi0_osc_regs_t::__reserved1
reg32_t __reserved1
Reserved.
Definition: cc26x2_cc13x2_prcm.h:44
ddi0_osc_regs_m16_t::ADCDOUBLERNANOAMPCTL
reg32_m16_t ADCDOUBLERNANOAMPCTL
ADC Doubler Nanoamp Control.
Definition: cc26x2_cc13x2_prcm.h:63
aon_pmctl_regs_t::OSCCFG
reg32_t OSCCFG
Oscillator configuration.
Definition: cc26x2_cc13x2_prcm.h:167
ddi0_osc_regs_m16_t::STAT2
reg32_m16_t STAT2
Status 2.
Definition: cc26x2_cc13x2_prcm.h:71
ddi0_osc_regs_m16_t::ANABYPASSVAL2
reg32_m16_t ANABYPASSVAL2
Internal.
Definition: cc26x2_cc13x2_prcm.h:61