Loading...
Searching...
No Matches
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
23extern "C" {
24#endif
25
29typedef 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;
45 reg32_t STAT0;
46 reg32_t STAT1;
47 reg32_t STAT2;
49
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
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
116#define DDI0_OSC_BASE (PERIPH_BASE + 0xCA000)
120#define DDI0_OSC_BASE_M16 (DDI0_OSC_BASE + DDI_MASK16B)
126#define DDI_0_OSC ((ddi0_osc_regs_t *) (DDI0_OSC_BASE))
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
151void osc_hf_source_switch(uint32_t osc);
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
198#define AON_PMCTL_BASE (PERIPH_BASE + 0x90000)
204#define AON_PMCTL ((aon_pmctl_regs_t *) (AON_PMCTL_BASE))
205
209typedef 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;
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))
245typedef 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];
278 reg32_t CPUCLKDIV;
280 reg32_t __reserved4;
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];
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];
320 reg32_t RFCMODESEL;
322 reg32_t __reserved12[2];
324 reg32_t __reserved13[14];
326 reg32_t __reserved14;
327 reg32_t RAMRETEN;
328 reg32_t __reserved15[27];
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
377#define PRCM_BASE (PERIPH_BASE + 0x82000)
378#define PRCM_BASE_NONBUF (PERIPH_BASE_NONBUF + 0x82000)
381#define PRCM ((prcm_regs_t *) (PRCM_BASE))
382#define PRCM_NONBUF ((prcm_regs_t *) (PRCM_BASE_NONBUF))
384#ifdef __cplusplus
385} /* end extern "C" */
386#endif
387
388#endif /* CC26X2_CC13X2_PRCM_H */
void osc_hf_source_switch(uint32_t osc)
DDI_0_OSC functions.
CC26xx, CC13xx definitions.
volatile uint32_t reg32_t
Unsigned 32-bit register type.
AON_PMCTL registers.
reg32_t PWRSTAT
Power status.
reg32_t __reserved3
Reserved.
reg32_t OSCCFG
Oscillator configuration.
reg32_t __reserved1
Reserved.
reg32_t PWRCTL
Power management control.
reg32_t SLEEPCTL
Reset control.
reg32_t JTAGUSERCODE
JTAG USERCODE.
reg32_t SHUTDOWN
Shutdown control.
reg32_t RESETCTL
Reset control.
reg32_t __reserved4
Reserved.
reg32_t RAMCFG
RAM configuration.
reg32_t RECHARGECFG
Recharge controller configuration.
reg32_t RECHARGESTAT
Recharge controller status.
reg32_t __reserved2
Reserved.
reg32_t AUXSCECLK
AUX SCE management.
reg32_t JTAGCFG
JTAG configuration.
AON_RTC registers.
reg32_t TIME
Current Counter Value.
reg32_t SYNCLF
Synchronization to SCLK_LF.
DDI_0_OSC registers with masked 16-bit access.
reg32_m16_t AMPCOMPCTL
Amplitude Compensation Control.
reg32_m16_t ADCDOUBLERNANOAMPCTL
ADC Doubler Nanoamp Control.
reg32_m16_t AMPCOMPTH2
Amplitude Compensation Threshold 2.
reg32_m16_t ANABYPASSVAL1
Analog Bypass Values 1.
reg32_m16_t XOSCHFCTL
XOSCHF Control.
reg32_m16_t CTL1
Control 1.
reg32_m16_t STAT1
Status 1.
reg32_m16_t CTL0
Control 0.
reg32_m16_t LFOSCCTL
Low Frequency Oscillator Control.
reg32_m16_t STAT2
Status 2.
reg32_m16_t RADCEXTCFG
RADC External Configuration.
reg32_m16_t __reserved1
Reserved.
reg32_m16_t RCOSCMFCTL
RCOSC_MF Control.
reg32_m16_t RCOSCHFCTL
RCOSCHF Control.
reg32_m16_t ATESTCTL
Analog Test Control.
reg32_m16_t STAT0
Status 0.
reg32_m16_t ANABYPASSVAL2
Internal.
reg32_m16_t AMPCOMPTH1
Amplitude Compensation Threshold 1.
DDI_0_OSC registers.
reg32_t RCOSCMFCTL
RCOSC_MF Control.
reg32_t __reserved1
Reserved.
PRCM registers.
reg32_t RESETSSI
Reset SSI.
reg32_t RESETGPIO
Reset GPIO.
reg32_t RESETUART
Reset UART.
reg32_t RFCMODEHWOPT
allowed RFC modes
reg32_t RESETI2S
Reset I2S.
reg32_t OSCIMSC
oscillator interrupt mask
reg32_t OSCRIS
oscillator raw interrupt status
reg32_t RESETSECDMA
Reset SEC and UDMA.
reg32_t RFCBITS
Control to RFC.
reg32_t RESETI2C
Reset I2C.
reg32_t SYSBUSCLKDIV
System bus clock division factor.
reg32_t RESETGPT
Reset GPTs.
reg32_t OSCICR
oscillator raw interrupt clear
reg32_t MCUSRAMCFG
MCU SRAM configuration.
reg32_t PWRPROFSTAT
power profiler register
reg32_t PERDMACLKDIV
DMA clock division factor.
reg32_t PERBUSCPUCLKDIV
Peripheral bus division factor.
Masked 32-bit register.