1 |
581 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// sysctl.h - Prototypes for the system control driver.
|
4 |
|
|
//
|
5 |
|
|
// Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// Software License Agreement
|
8 |
|
|
//
|
9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
10 |
|
|
// exclusively on LMI's Stellaris Family of microcontroller products.
|
11 |
|
|
//
|
12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
13 |
|
|
// applicable copyright laws. All rights are reserved. Any use in violation
|
14 |
|
|
// of the foregoing restrictions may subject the user to criminal sanctions
|
15 |
|
|
// under applicable laws, as well as to civil liability for the breach of the
|
16 |
|
|
// terms and conditions of this license.
|
17 |
|
|
//
|
18 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
19 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
20 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
21 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
22 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
23 |
|
|
//
|
24 |
|
|
// This is part of revision 523 of the Stellaris Driver Library.
|
25 |
|
|
//
|
26 |
|
|
//*****************************************************************************
|
27 |
|
|
|
28 |
|
|
#ifndef __SYSCTL_H__
|
29 |
|
|
#define __SYSCTL_H__
|
30 |
|
|
|
31 |
|
|
#ifdef __cplusplus
|
32 |
|
|
extern "C"
|
33 |
|
|
{
|
34 |
|
|
#endif
|
35 |
|
|
|
36 |
|
|
//*****************************************************************************
|
37 |
|
|
//
|
38 |
|
|
// The following are values that can be passed to the
|
39 |
|
|
// SysCtlPeripheralPresent(), SysCtlPeripheralEnable(),
|
40 |
|
|
// SysCtlPeripheralDisable(), and SysCtlPeripheralReset() APIs as the
|
41 |
|
|
// ulPeripheral parameter. The peripherals in the fourth group (upper nibble
|
42 |
|
|
// is 3) can only be used with the SysCtlPeripheralPresent() API.
|
43 |
|
|
//
|
44 |
|
|
//*****************************************************************************
|
45 |
|
|
#define SYSCTL_PERIPH_WDOG 0x00000008 // Watchdog
|
46 |
|
|
#define SYSCTL_PERIPH_UART0 0x10000001 // UART 0
|
47 |
|
|
#define SYSCTL_PERIPH_SSI 0x10000010 // SSI
|
48 |
|
|
#define SYSCTL_PERIPH_I2C 0x10001000 // I2C
|
49 |
|
|
#define SYSCTL_PERIPH_TIMER0 0x10010000 // Timer 0
|
50 |
|
|
#define SYSCTL_PERIPH_TIMER1 0x10020000 // Timer 1
|
51 |
|
|
#define SYSCTL_PERIPH_COMP0 0x11000000 // Analog comparator 0
|
52 |
|
|
#define SYSCTL_PERIPH_COMP1 0x12000000 // Analog comparator 1
|
53 |
|
|
#define SYSCTL_PERIPH_GPIOA 0x20000001 // GPIO A
|
54 |
|
|
#define SYSCTL_PERIPH_GPIOB 0x20000002 // GPIO B
|
55 |
|
|
#define SYSCTL_PERIPH_GPIOC 0x20000004 // GPIO C
|
56 |
|
|
#define SYSCTL_PERIPH_PLL 0x30000010 // PLL
|
57 |
|
|
|
58 |
|
|
//*****************************************************************************
|
59 |
|
|
//
|
60 |
|
|
// The following are values that can be passed to the SysCtlPinPresent() API
|
61 |
|
|
// as the ulPin parameter.
|
62 |
|
|
//
|
63 |
|
|
//*****************************************************************************
|
64 |
|
|
#define SYSCTL_PIN_C0MINUS 0x00000040 // C0- pin
|
65 |
|
|
#define SYSCTL_PIN_C0PLUS 0x00000080 // C0+ pin
|
66 |
|
|
#define SYSCTL_PIN_C0O 0x00000100 // C0o pin
|
67 |
|
|
#define SYSCTL_PIN_C1MINUS 0x00000200 // C1- pin
|
68 |
|
|
#define SYSCTL_PIN_CCP0 0x01000000 // CCP0 pin
|
69 |
|
|
#define SYSCTL_PIN_CCP1 0x02000000 // CCP1 pin
|
70 |
|
|
#define SYSCTL_PIN_32KHZ 0x80000000 // 32kHz pin
|
71 |
|
|
|
72 |
|
|
//*****************************************************************************
|
73 |
|
|
//
|
74 |
|
|
// The following are values that can be passed to the SysCtlLDOSet() API as
|
75 |
|
|
// the ulVoltage value, or returned by the SysCtlLDOGet() API.
|
76 |
|
|
//
|
77 |
|
|
//*****************************************************************************
|
78 |
|
|
#define SYSCTL_LDO_2_25V 0x00000005 // LDO output of 2.25V
|
79 |
|
|
#define SYSCTL_LDO_2_30V 0x00000004 // LDO output of 2.30V
|
80 |
|
|
#define SYSCTL_LDO_2_35V 0x00000003 // LDO output of 2.35V
|
81 |
|
|
#define SYSCTL_LDO_2_40V 0x00000002 // LDO output of 2.40V
|
82 |
|
|
#define SYSCTL_LDO_2_45V 0x00000001 // LDO output of 2.45V
|
83 |
|
|
#define SYSCTL_LDO_2_50V 0x00000000 // LDO output of 2.50V
|
84 |
|
|
#define SYSCTL_LDO_2_55V 0x0000001f // LDO output of 2.55V
|
85 |
|
|
#define SYSCTL_LDO_2_60V 0x0000001e // LDO output of 2.60V
|
86 |
|
|
#define SYSCTL_LDO_2_65V 0x0000001d // LDO output of 2.65V
|
87 |
|
|
#define SYSCTL_LDO_2_70V 0x0000001c // LDO output of 2.70V
|
88 |
|
|
#define SYSCTL_LDO_2_75V 0x0000001b // LDO output of 2.75V
|
89 |
|
|
|
90 |
|
|
//*****************************************************************************
|
91 |
|
|
//
|
92 |
|
|
// The following are values that can be passed to the SysCtlLDOConfigSet() API.
|
93 |
|
|
//
|
94 |
|
|
//*****************************************************************************
|
95 |
|
|
#define SYSCTL_LDOCFG_ARST 0x00000001 // Allow LDO failure to reset
|
96 |
|
|
#define SYSCTL_LDOCFG_NORST 0x00000000 // Do not reset on LDO failure
|
97 |
|
|
|
98 |
|
|
//*****************************************************************************
|
99 |
|
|
//
|
100 |
|
|
// The following are values that can be passed to the SysCtlIntEnable(),
|
101 |
|
|
// SysCtlIntDisable(), and SysCtlIntClear() APIs, or returned in the bit mask
|
102 |
|
|
// by the SysCtlIntStatus() API.
|
103 |
|
|
//
|
104 |
|
|
//*****************************************************************************
|
105 |
|
|
#define SYSCTL_INT_PLL_LOCK 0x00000040 // PLL lock interrupt
|
106 |
|
|
#define SYSCTL_INT_CUR_LIMIT 0x00000020 // Current limit interrupt
|
107 |
|
|
#define SYSCTL_INT_BOSC_FAIL 0x00000010 // Boot oscillator failure int
|
108 |
|
|
#define SYSCTL_INT_MOSC_FAIL 0x00000008 // Main oscillator failure int
|
109 |
|
|
#define SYSCTL_INT_POR 0x00000004 // Power on reset interrupt
|
110 |
|
|
#define SYSCTL_INT_BOR 0x00000002 // Brown out interrupt
|
111 |
|
|
#define SYSCTL_INT_PLL_FAIL 0x00000001 // PLL failure interrupt
|
112 |
|
|
|
113 |
|
|
//*****************************************************************************
|
114 |
|
|
//
|
115 |
|
|
// The following are values that can be passed to the SysCtlResetCauseClear()
|
116 |
|
|
// API or returned by the SysCtlResetCauseGet() API.
|
117 |
|
|
//
|
118 |
|
|
//*****************************************************************************
|
119 |
|
|
#define SYSCTL_CAUSE_LDO 0x00000020 // LDO power not OK reset
|
120 |
|
|
#define SYSCTL_CAUSE_SW 0x00000010 // Software reset
|
121 |
|
|
#define SYSCTL_CAUSE_WDOG 0x00000008 // Watchdog reset
|
122 |
|
|
#define SYSCTL_CAUSE_BOR 0x00000004 // Brown-out reset
|
123 |
|
|
#define SYSCTL_CAUSE_POR 0x00000002 // Power on reset
|
124 |
|
|
#define SYSCTL_CAUSE_EXT 0x00000001 // External reset
|
125 |
|
|
|
126 |
|
|
//*****************************************************************************
|
127 |
|
|
//
|
128 |
|
|
// The following are values that can be passed to the SysCtlBrownOutConfigSet()
|
129 |
|
|
// API as the ulConfig parameter.
|
130 |
|
|
//
|
131 |
|
|
//*****************************************************************************
|
132 |
|
|
#define SYSCTL_BOR_RESET 0x00000002 // Reset instead of interrupting
|
133 |
|
|
#define SYSCTL_BOR_RESAMPLE 0x00000001 // Resample BOR before asserting
|
134 |
|
|
|
135 |
|
|
//*****************************************************************************
|
136 |
|
|
//
|
137 |
|
|
// The following are values that can be passed to the SysCtlClockSet() API as
|
138 |
|
|
// the ulConfig parameter.
|
139 |
|
|
//
|
140 |
|
|
//*****************************************************************************
|
141 |
|
|
#define SYSCTL_SYSDIV_1 0x07800000 // Processor clock is osc/pll /1
|
142 |
|
|
#define SYSCTL_SYSDIV_2 0x00C00000 // Processor clock is osc/pll /2
|
143 |
|
|
#define SYSCTL_SYSDIV_3 0x01400000 // Processor clock is osc/pll /3
|
144 |
|
|
#define SYSCTL_SYSDIV_4 0x01C00000 // Processor clock is osc/pll /4
|
145 |
|
|
#define SYSCTL_SYSDIV_5 0x02400000 // Processor clock is osc/pll /5
|
146 |
|
|
#define SYSCTL_SYSDIV_6 0x02C00000 // Processor clock is osc/pll /6
|
147 |
|
|
#define SYSCTL_SYSDIV_7 0x03400000 // Processor clock is osc/pll /7
|
148 |
|
|
#define SYSCTL_SYSDIV_8 0x03C00000 // Processor clock is osc/pll /8
|
149 |
|
|
#define SYSCTL_SYSDIV_9 0x04400000 // Processor clock is osc/pll /9
|
150 |
|
|
#define SYSCTL_SYSDIV_10 0x04C00000 // Processor clock is osc/pll /10
|
151 |
|
|
#define SYSCTL_SYSDIV_11 0x05400000 // Processor clock is osc/pll /11
|
152 |
|
|
#define SYSCTL_SYSDIV_12 0x05C00000 // Processor clock is osc/pll /12
|
153 |
|
|
#define SYSCTL_SYSDIV_13 0x06400000 // Processor clock is osc/pll /13
|
154 |
|
|
#define SYSCTL_SYSDIV_14 0x06C00000 // Processor clock is osc/pll /14
|
155 |
|
|
#define SYSCTL_SYSDIV_15 0x07400000 // Processor clock is osc/pll /15
|
156 |
|
|
#define SYSCTL_SYSDIV_16 0x07C00000 // Processor clock is osc/pll /16
|
157 |
|
|
#define SYSCTL_USE_PLL 0x00000000 // System clock is the PLL clock
|
158 |
|
|
#define SYSCTL_USE_OSC 0x00003800 // System clock is the osc clock
|
159 |
|
|
#define SYSCTL_XTAL_3_57MHZ 0x00000100 // External crystal is 3.579545MHz
|
160 |
|
|
#define SYSCTL_XTAL_3_68MHZ 0x00000140 // External crystal is 3.6864MHz
|
161 |
|
|
#define SYSCTL_XTAL_4MHZ 0x00000180 // External crystal is 4MHz
|
162 |
|
|
#define SYSCTL_XTAL_4_09MHZ 0x000001C0 // External crystal is 4.096MHz
|
163 |
|
|
#define SYSCTL_XTAL_4_91MHZ 0x00000200 // External crystal is 4.9152MHz
|
164 |
|
|
#define SYSCTL_XTAL_5MHZ 0x00000240 // External crystal is 5MHz
|
165 |
|
|
#define SYSCTL_XTAL_5_12MHZ 0x00000280 // External crystal is 5.12MHz
|
166 |
|
|
#define SYSCTL_XTAL_6MHZ 0x000002C0 // External crystal is 6MHz
|
167 |
|
|
#define SYSCTL_XTAL_6_14MHZ 0x00000300 // External crystal is 6.144MHz
|
168 |
|
|
#define SYSCTL_XTAL_7_37MHZ 0x00000340 // External crystal is 7.3728MHz
|
169 |
|
|
#define SYSCTL_XTAL_8MHZ 0x00000380 // External crystal is 8MHz
|
170 |
|
|
#define SYSCTL_XTAL_8_19MHZ 0x000003C0 // External crystal is 8.192MHz
|
171 |
|
|
#define SYSCTL_OSC_MAIN 0x00000000 // Oscillator source is main osc
|
172 |
|
|
#define SYSCTL_OSC_BOOT 0x00000010 // Oscillator source is boot osc
|
173 |
|
|
#define SYSCTL_OSC_BOOT4 0x00000020 // Oscillator source is boot osc /4
|
174 |
|
|
#define SYSCTL_BOOT_OSC_DIS 0x00000002 // Disable boot oscillator
|
175 |
|
|
#define SYSCTL_MAIN_OSC_DIS 0x00000001 // Disable main oscillator
|
176 |
|
|
|
177 |
|
|
//*****************************************************************************
|
178 |
|
|
//
|
179 |
|
|
// Prototypes for the APIs.
|
180 |
|
|
//
|
181 |
|
|
//*****************************************************************************
|
182 |
|
|
extern unsigned long SysCtlSRAMSizeGet(void);
|
183 |
|
|
extern unsigned long SysCtlFlashSizeGet(void);
|
184 |
|
|
extern tBoolean SysCtlPinPresent(unsigned long ulPin);
|
185 |
|
|
extern tBoolean SysCtlPeripheralPresent(unsigned long ulPeripheral);
|
186 |
|
|
extern void SysCtlPeripheralReset(unsigned long ulPeripheral);
|
187 |
|
|
extern void SysCtlPeripheralEnable(unsigned long ulPeripheral);
|
188 |
|
|
extern void SysCtlPeripheralDisable(unsigned long ulPeripheral);
|
189 |
|
|
extern void SysCtlPeripheralSleepEnable(unsigned long ulPeripheral);
|
190 |
|
|
extern void SysCtlPeripheralSleepDisable(unsigned long ulPeripheral);
|
191 |
|
|
extern void SysCtlPeripheralDeepSleepEnable(unsigned long ulPeripheral);
|
192 |
|
|
extern void SysCtlPeripheralDeepSleepDisable(unsigned long ulPeripheral);
|
193 |
|
|
extern void SysCtlPeripheralClockGating(tBoolean bEnable);
|
194 |
|
|
extern void SysCtlIntRegister(void (*pfnHandler)(void));
|
195 |
|
|
extern void SysCtlIntUnregister(void);
|
196 |
|
|
extern void SysCtlIntEnable(unsigned long ulInts);
|
197 |
|
|
extern void SysCtlIntDisable(unsigned long ulInts);
|
198 |
|
|
extern void SysCtlIntClear(unsigned long ulInts);
|
199 |
|
|
extern unsigned long SysCtlIntStatus(tBoolean bMasked);
|
200 |
|
|
extern void SysCtlLDOSet(unsigned long ulVoltage);
|
201 |
|
|
extern unsigned long SysCtlLDOGet(void);
|
202 |
|
|
extern void SysCtlLDOConfigSet(unsigned long ulConfig);
|
203 |
|
|
extern void SysCtlReset(void);
|
204 |
|
|
extern void SysCtlSleep(void);
|
205 |
|
|
extern void SysCtlDeepSleep(void);
|
206 |
|
|
extern unsigned long SysCtlResetCauseGet(void);
|
207 |
|
|
extern void SysCtlResetCauseClear(unsigned long ulCauses);
|
208 |
|
|
extern void SysCtlBrownOutConfigSet(unsigned long ulConfig,
|
209 |
|
|
unsigned long ulDelay);
|
210 |
|
|
extern void SysCtlClockSet(unsigned long ulConfig);
|
211 |
|
|
extern unsigned long SysCtlClockGet(void);
|
212 |
|
|
extern void SysCtlBOSCVerificationSet(tBoolean bEnable);
|
213 |
|
|
extern void SysCtlMOSCVerificationSet(tBoolean bEnable);
|
214 |
|
|
extern void SysCtlPLLVerificationSet(tBoolean bEnable);
|
215 |
|
|
extern void SysCtlClkVerificationClear(void);
|
216 |
|
|
|
217 |
|
|
#ifdef __cplusplus
|
218 |
|
|
}
|
219 |
|
|
#endif
|
220 |
|
|
|
221 |
|
|
#endif // __SYSCTL_H__
|