1 //*****************************************************************************
3 // sysctl.c - Driver for the system controller.
5 // Copyright (c) 2005,2006 Luminary Micro, Inc. ALl rights reserved.
7 // Software License Agreement
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
10 // exclusively on LMI's Stellaris Family of microcontroller products.
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.
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.
24 // This is part of revision 991 of the Stellaris Driver Library.
26 //*****************************************************************************
28 //*****************************************************************************
30 //! \addtogroup sysctl_api
33 //*****************************************************************************
35 #include "../hw_ints.h"
36 #include "../hw_memmap.h"
37 #include "../hw_nvic.h"
38 #include "../hw_sysctl.h"
39 #include "../hw_types.h"
42 #include "interrupt.h"
45 //*****************************************************************************
47 // An array that maps the "peripheral set" number (which is stored in the upper
48 // nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL DC? register that
49 // contains the peripheral present bit for that peripheral.
51 //*****************************************************************************
52 #if defined(GROUP_puldcregs) || defined(BUILD_ALL)
53 const unsigned long g_pulDCRegs[] =
61 extern const unsigned long g_pulDCRegs[];
64 //*****************************************************************************
66 // An array that maps the "peripheral set" number (which is stored in the upper
67 // nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_SRCR? register that
68 // controls the software reset for that peripheral.
70 //*****************************************************************************
71 #if defined(GROUP_pulsrcrregs) || defined(BUILD_ALL)
72 const unsigned long g_pulSRCRRegs[] =
79 extern const unsigned long g_pulSRCRRegs[];
82 //*****************************************************************************
84 // An array that maps the "peripheral set" number (which is stored in the upper
85 // nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_RCGC? register that
86 // controls the run-mode enable for that peripheral.
88 //*****************************************************************************
89 #if defined(GROUP_pulrcgcregs) || defined(BUILD_ALL)
90 const unsigned long g_pulRCGCRegs[] =
97 extern const unsigned long g_pulRCGCRegs[];
100 //*****************************************************************************
102 // An array that maps the "peripheral set" number (which is stored in the upper
103 // nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_SCGC? register that
104 // controls the sleep-mode enable for that peripheral.
106 //*****************************************************************************
107 #if defined(GROUP_pulscgcregs) || defined(BUILD_ALL)
108 const unsigned long g_pulSCGCRegs[] =
115 extern const unsigned long g_pulSCGCRegs[];
118 //*****************************************************************************
120 // An array that maps the "peripheral set" number (which is stored in the upper
121 // nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_DCGC? register that
122 // controls the deep-sleep-mode enable for that peripheral.
124 //*****************************************************************************
125 #if defined(GROUP_pulDCGCregs) || defined(BUILD_ALL)
126 const unsigned long g_pulDCGCRegs[] =
133 extern const unsigned long g_pulDCGCRegs[];
136 //*****************************************************************************
138 // An array that maps the crystal number in RCC to a frequency.
140 //*****************************************************************************
141 #if defined(GROUP_pulxtals) || defined(BUILD_ALL)
142 const unsigned long g_pulXtals[] =
158 extern const unsigned long g_pulXtals[];
161 //*****************************************************************************
163 //! Gets the size of the SRAM.
165 //! This function determines the size of the SRAM on the Stellaris device.
167 //! \return The total number of bytes of SRAM.
169 //*****************************************************************************
170 #if defined(GROUP_sramsizeget) || defined(BUILD_ALL) || defined(DOXYGEN)
172 SysCtlSRAMSizeGet(void)
175 // Compute the size of the SRAM.
177 return(((HWREG(SYSCTL_DC0) & SYSCTL_DC0_SRAMSZ_MASK) >> 8) + 0x100);
181 //*****************************************************************************
183 //! Gets the size of the flash.
185 //! This function determines the size of the flash on the Stellaris device.
187 //! \return The total number of bytes of flash.
189 //*****************************************************************************
190 #if defined(GROUP_flashsizeget) || defined(BUILD_ALL) || defined(DOXYGEN)
192 SysCtlFlashSizeGet(void)
195 // Compute the size of the flash.
197 return(((HWREG(SYSCTL_DC0) & SYSCTL_DC0_FLASHSZ_MASK) << 11) + 0x800);
201 //*****************************************************************************
203 //! Determines if a pin is present.
205 //! \param ulPin is the pin in question.
207 //! Determines if a particular pin is present in the device. The PWM, analog
208 //! comparators, ADC, and timers have a varying number of pins across members
209 //! of the Stellaris family; this will determine which are present on this
212 //! The \b ulPin argument must be only one of the following values:
213 //! \b SYSCTL_PIN_PWM0, \b SYSCTL_PIN_PWM1, \b SYSCTL_PIN_PWM2,
214 //! \b SYSCTL_PIN_PWM3, \b SYSCTL_PIN_PWM4, \b SYSCTL_PIN_PWM5,
215 //! \b SYSCTL_PIN_C0MINUS, \b SYSCTL_PIN_C0PLUS, \b SYSCTL_PIN_C0O,
216 //! \b SYSCTL_PIN_C1MINUS, \b SYSCTL_PIN_C1PLUS, \b SYSCTL_PIN_C1O,
217 //! \b SYSCTL_PIN_C2MINUS, \b SYSCTL_PIN_C2PLUS, \b SYSCTL_PIN_C2O,
218 //! \b SYSCTL_PIN_ADC0, \b SYSCTL_PIN_ADC1, \b SYSCTL_PIN_ADC2,
219 //! \b SYSCTL_PIN_ADC3, \b SYSCTL_PIN_ADC4, \b SYSCTL_PIN_ADC5,
220 //! \b SYSCTL_PIN_ADC6, \b SYSCTL_PIN_ADC7, \b SYSCTL_PIN_CCP0,
221 //! \b SYSCTL_PIN_CCP1, \b SYSCTL_PIN_CCP2, \b SYSCTL_PIN_CCP3,
222 //! \b SYSCTL_PIN_CCP4, \b SYSCTL_PIN_CCP5, or \b SYSCTL_PIN_32KHZ.
224 //! \return Returns \b true if the specified pin is present and \b false if it
227 //*****************************************************************************
228 #if defined(GROUP_pinpresent) || defined(BUILD_ALL) || defined(DOXYGEN)
230 SysCtlPinPresent(unsigned long ulPin)
233 // Check the arguments.
235 ASSERT((ulPin == SYSCTL_PIN_PWM0) ||
236 (ulPin == SYSCTL_PIN_PWM1) ||
237 (ulPin == SYSCTL_PIN_PWM2) ||
238 (ulPin == SYSCTL_PIN_PWM3) ||
239 (ulPin == SYSCTL_PIN_PWM4) ||
240 (ulPin == SYSCTL_PIN_PWM5) ||
241 (ulPin == SYSCTL_PIN_C0MINUS) ||
242 (ulPin == SYSCTL_PIN_C0PLUS) ||
243 (ulPin == SYSCTL_PIN_C0O) ||
244 (ulPin == SYSCTL_PIN_C1MINUS) ||
245 (ulPin == SYSCTL_PIN_C1PLUS) ||
246 (ulPin == SYSCTL_PIN_C1O) ||
247 (ulPin == SYSCTL_PIN_C2MINUS) ||
248 (ulPin == SYSCTL_PIN_C2PLUS) ||
249 (ulPin == SYSCTL_PIN_C2O) ||
250 (ulPin == SYSCTL_PIN_ADC0) ||
251 (ulPin == SYSCTL_PIN_ADC1) ||
252 (ulPin == SYSCTL_PIN_ADC2) ||
253 (ulPin == SYSCTL_PIN_ADC3) ||
254 (ulPin == SYSCTL_PIN_ADC4) ||
255 (ulPin == SYSCTL_PIN_ADC5) ||
256 (ulPin == SYSCTL_PIN_ADC6) ||
257 (ulPin == SYSCTL_PIN_ADC7) ||
258 (ulPin == SYSCTL_PIN_CCP0) ||
259 (ulPin == SYSCTL_PIN_CCP1) ||
260 (ulPin == SYSCTL_PIN_CCP2) ||
261 (ulPin == SYSCTL_PIN_CCP3) ||
262 (ulPin == SYSCTL_PIN_CCP4) ||
263 (ulPin == SYSCTL_PIN_CCP5) ||
264 (ulPin == SYSCTL_PIN_32KHZ))
267 // Determine if this pin is present.
269 if(HWREG(SYSCTL_DC3) & ulPin)
280 //*****************************************************************************
282 //! Determines if a peripheral is present.
284 //! \param ulPeripheral is the peripheral in question.
286 //! Determines if a particular peripheral is present in the device. Each
287 //! member of the Stellaris family has a different peripheral set; this will
288 //! determine which are present on this device.
290 //! The \b ulPeripheral argument must be only one of the following values:
291 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
292 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
293 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
294 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
295 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
296 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD,
297 //! \b SYSCTL_PERIPH_GPIOE, \b SYSCTL_PERIPH_MPU, \b SYSCTL_PERIPH_TEMP, or
298 //! \b SYSCTL_PERIPH_PLL.
300 //! \return Returns \b true if the specified peripheral is present and \b false
303 //*****************************************************************************
304 #if defined(GROUP_peripheralpresent) || defined(BUILD_ALL) || defined(DOXYGEN)
306 SysCtlPeripheralPresent(unsigned long ulPeripheral)
309 // Check the arguments.
311 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
312 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
313 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
314 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
315 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
316 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
317 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
318 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
319 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
320 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
321 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
322 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
323 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
324 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
325 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
326 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
327 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
328 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
329 (ulPeripheral == SYSCTL_PERIPH_GPIOE) ||
330 (ulPeripheral == SYSCTL_PERIPH_MPU) ||
331 (ulPeripheral == SYSCTL_PERIPH_TEMP) ||
332 (ulPeripheral == SYSCTL_PERIPH_PLL));
335 // Read the correct DC register and determine if this peripheral exists.
337 if(HWREG(g_pulDCRegs[ulPeripheral >> 28]) & ulPeripheral & 0x0fffffff)
348 //*****************************************************************************
350 //! Performs a software reset of a peripheral.
352 //! \param ulPeripheral is the peripheral to reset.
354 //! This function performs a software reset of the specified peripheral. An
355 //! individual peripheral reset signal is asserted for a brief period and then
356 //! deasserted, leaving the peripheral in a operating state but in its reset
359 //! The \b ulPeripheral argument must be only one of the following values:
360 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
361 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
362 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
363 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
364 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
365 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
366 //! \b SYSCTL_PERIPH_GPIOE.
370 //*****************************************************************************
371 #if defined(GROUP_peripheralreset) || defined(BUILD_ALL) || defined(DOXYGEN)
373 SysCtlPeripheralReset(unsigned long ulPeripheral)
375 volatile unsigned long ulDelay;
378 // Check the arguments.
380 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
381 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
382 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
383 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
384 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
385 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
386 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
387 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
388 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
389 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
390 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
391 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
392 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
393 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
394 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
395 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
396 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
397 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
398 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
401 // Put the peripheral into the reset state.
403 HWREG(g_pulSRCRRegs[ulPeripheral >> 28]) |= ulPeripheral & 0x0fffffff;
406 // Delay for a little bit.
408 for(ulDelay = 0; ulDelay < 16; ulDelay++)
413 // Take the peripheral out of the reset state.
415 HWREG(g_pulSRCRRegs[ulPeripheral >> 28]) &= ~(ulPeripheral);
419 //*****************************************************************************
421 //! Enables a peripheral.
423 //! \param ulPeripheral is the peripheral to enable.
425 //! Peripherals are enabled with this function. At power-up, all peripherals
426 //! are disabled; they must be enabled in order to operate or respond to
427 //! register reads/writes.
429 //! The \b ulPeripheral argument must be only one of the following values:
430 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
431 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
432 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
433 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
434 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
435 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
436 //! \b SYSCTL_PERIPH_GPIOE.
440 //*****************************************************************************
441 #if defined(GROUP_peripheralenable) || defined(BUILD_ALL) || defined(DOXYGEN)
443 SysCtlPeripheralEnable(unsigned long ulPeripheral)
446 // Check the arguments.
448 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
449 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
450 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
451 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
452 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
453 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
454 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
455 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
456 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
457 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
458 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
459 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
460 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
461 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
462 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
463 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
464 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
465 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
466 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
469 // Enable this peripheral.
471 HWREG(g_pulRCGCRegs[ulPeripheral >> 28]) |= ulPeripheral & 0x0fffffff;
475 //*****************************************************************************
477 //! Disables a peripheral.
479 //! \param ulPeripheral is the peripheral to disable.
481 //! Peripherals are disabled with this function. Once disabled, they will not
482 //! operate or respond to register reads/writes.
484 //! The \b ulPeripheral argument must be only one of the following values:
485 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
486 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
487 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
488 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
489 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
490 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
491 //! \b SYSCTL_PERIPH_GPIOE.
495 //*****************************************************************************
496 #if defined(GROUP_peripheraldisable) || defined(BUILD_ALL) || defined(DOXYGEN)
498 SysCtlPeripheralDisable(unsigned long ulPeripheral)
501 // Check the arguments.
503 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
504 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
505 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
506 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
507 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
508 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
509 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
510 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
511 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
512 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
513 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
514 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
515 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
516 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
517 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
518 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
519 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
520 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
521 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
524 // Disable this peripheral.
526 HWREG(g_pulRCGCRegs[ulPeripheral >> 28]) &= ~(ulPeripheral & 0x0fffffff);
530 //*****************************************************************************
532 //! Enables a peripheral in sleep mode.
534 //! \param ulPeripheral is the peripheral to enable in sleep mode.
536 //! This function allows a peripheral to continue operating when the processor
537 //! goes into sleep mode. Since the clocking configuration of the device does
538 //! not change, any peripheral can safely continue operating while the
539 //! processor is in sleep mode, and can therefore wake the processor from sleep
542 //! Sleep mode clocking of peripherals must be enabled via
543 //! SysCtlPeripheralClockGating(); if disabled, the peripheral sleep mode
544 //! configuration is maintained but has no effect when sleep mode is entered.
546 //! The \b ulPeripheral argument must be only one of the following values:
547 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
548 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
549 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
550 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
551 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
552 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
553 //! \b SYSCTL_PERIPH_GPIOE.
557 //*****************************************************************************
558 #if defined(GROUP_peripheralsleepenable) || defined(BUILD_ALL) || \
561 SysCtlPeripheralSleepEnable(unsigned long ulPeripheral)
564 // Check the arguments.
566 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
567 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
568 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
569 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
570 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
571 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
572 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
573 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
574 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
575 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
576 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
577 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
578 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
579 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
580 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
581 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
582 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
583 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
584 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
587 // Enable this peripheral in sleep mode.
589 HWREG(g_pulSCGCRegs[ulPeripheral >> 28]) |= ulPeripheral & 0x0fffffff;
593 //*****************************************************************************
595 //! Disables a peripheral in sleep mode.
597 //! \param ulPeripheral is the peripheral to disable in sleep mode.
599 //! This function causes a peripheral to stop operating when the processor goes
600 //! into sleep mode. Disabling peripherals while in sleep mode helps to lower
601 //! the current draw of the device. If enabled (via SysCtlPeripheralEnable()),
602 //! the peripheral will automatically resume operation when the processor
603 //! leaves sleep mode, maintaining its entire state from before sleep mode was
606 //! Sleep mode clocking of peripherals must be enabled via
607 //! SysCtlPeripheralClockGating(); if disabled, the peripheral sleep mode
608 //! configuration is maintained but has no effect when sleep mode is entered.
610 //! The \b ulPeripheral argument must be only one of the following values:
611 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
612 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
613 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
614 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
615 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
616 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
617 //! \b SYSCTL_PERIPH_GPIOE.
621 //*****************************************************************************
622 #if defined(GROUP_peripheralsleepdisable) || defined(BUILD_ALL) || \
625 SysCtlPeripheralSleepDisable(unsigned long ulPeripheral)
628 // Check the arguments.
630 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
631 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
632 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
633 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
634 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
635 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
636 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
637 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
638 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
639 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
640 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
641 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
642 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
643 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
644 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
645 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
646 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
647 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
648 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
651 // Disable this peripheral in sleep mode.
653 HWREG(g_pulSCGCRegs[ulPeripheral >> 28]) &= ~(ulPeripheral & 0x0fffffff);
657 //*****************************************************************************
659 //! Enables a peripheral in deep-sleep mode.
661 //! \param ulPeripheral is the peripheral to enable in deep-sleep mode.
663 //! This function allows a peripheral to continue operating when the processor
664 //! goes into deep-sleep mode. Since the clocking configuration of the device
665 //! may change, not all peripherals can safely continue operating while the
666 //! processor is in sleep mode. Those that must run at a particular frequency
667 //! (such as a UART) will not work as expected if the clock changes. It is the
668 //! responsibility of the caller to make sensible choices.
670 //! Deep-sleep mode clocking of peripherals must be enabled via
671 //! SysCtlPeripheralClockGating(); if disabled, the peripheral deep-sleep mode
672 //! configuration is maintained but has no effect when deep-sleep mode is
675 //! The \b ulPeripheral argument must be one of the following values:
676 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
677 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
678 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
679 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
680 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
681 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
682 //! \b SYSCTL_PERIPH_GPIOE.
686 //*****************************************************************************
687 #if defined(GROUP_peripheraldeepsleepenable) || defined(BUILD_ALL) || \
690 SysCtlPeripheralDeepSleepEnable(unsigned long ulPeripheral)
693 // Check the arguments.
695 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
696 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
697 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
698 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
699 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
700 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
701 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
702 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
703 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
704 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
705 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
706 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
707 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
708 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
709 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
710 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
711 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
712 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
713 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
716 // Enable this peripheral in deep-sleep mode.
718 HWREG(g_pulDCGCRegs[ulPeripheral >> 28]) |= ulPeripheral & 0x0fffffff;
722 //*****************************************************************************
724 //! Disables a peripheral in deep-sleep mode.
726 //! \param ulPeripheral is the peripheral to disable in deep-sleep mode.
728 //! This function causes a peripheral to stop operating when the processor goes
729 //! into deep-sleep mode. Disabling peripherals while in deep-sleep mode helps
730 //! to lower the current draw of the device, and can keep peripherals that
731 //! require a particular clock frequency from operating when the clock changes
732 //! as a result of entering deep-sleep mode. If enabled (via
733 //! SysCtlPeripheralEnable()), the peripheral will automatically resume
734 //! operation when the processor leaves deep-sleep mode, maintaining its entire
735 //! state from before deep-sleep mode was entered.
737 //! Deep-sleep mode clocking of peripherals must be enabled via
738 //! SysCtlPeripheralClockGating(); if disabled, the peripheral deep-sleep mode
739 //! configuration is maintained but has no effect when deep-sleep mode is
742 //! The \b ulPeripheral argument must be one of the following values:
743 //! \b SYSCTL_PERIPH_PWM, \b SYSCTL_PERIPH_ADC, \b SYSCTL_PERIPH_WDOG,
744 //! \b SYSCTL_PERIPH_UART0, \b SYSCTL_PERIPH_UART1, \b SYSCTL_PERIPH_SSI,
745 //! \b SYSCTL_PERIPH_QEI, \b SYSCTL_PERIPH_I2C, \b SYSCTL_PERIPH_TIMER0,
746 //! \b SYSCTL_PERIPH_TIMER1, \b SYSCTL_PERIPH_TIMER2, \b SYSCTL_PERIPH_COMP0,
747 //! \b SYSCTL_PERIPH_COMP1, \b SYSCTL_PERIPH_COMP2, \b SYSCTL_PERIPH_GPIOA,
748 //! \b SYSCTL_PERIPH_GPIOB, \b SYSCTL_PERIPH_GPIOC, \b SYSCTL_PERIPH_GPIOD, or
749 //! \b SYSCTL_PERIPH_GPIOE.
753 //*****************************************************************************
754 #if defined(GROUP_peripheraldeepsleepdisable) || defined(BUILD_ALL) || \
757 SysCtlPeripheralDeepSleepDisable(unsigned long ulPeripheral)
760 // Check the arguments.
762 ASSERT((ulPeripheral == SYSCTL_PERIPH_PWM) ||
763 (ulPeripheral == SYSCTL_PERIPH_ADC) ||
764 (ulPeripheral == SYSCTL_PERIPH_WDOG) ||
765 (ulPeripheral == SYSCTL_PERIPH_UART0) ||
766 (ulPeripheral == SYSCTL_PERIPH_UART1) ||
767 (ulPeripheral == SYSCTL_PERIPH_SSI) ||
768 (ulPeripheral == SYSCTL_PERIPH_QEI) ||
769 (ulPeripheral == SYSCTL_PERIPH_I2C) ||
770 (ulPeripheral == SYSCTL_PERIPH_TIMER0) ||
771 (ulPeripheral == SYSCTL_PERIPH_TIMER1) ||
772 (ulPeripheral == SYSCTL_PERIPH_TIMER2) ||
773 (ulPeripheral == SYSCTL_PERIPH_COMP0) ||
774 (ulPeripheral == SYSCTL_PERIPH_COMP1) ||
775 (ulPeripheral == SYSCTL_PERIPH_COMP2) ||
776 (ulPeripheral == SYSCTL_PERIPH_GPIOA) ||
777 (ulPeripheral == SYSCTL_PERIPH_GPIOB) ||
778 (ulPeripheral == SYSCTL_PERIPH_GPIOC) ||
779 (ulPeripheral == SYSCTL_PERIPH_GPIOD) ||
780 (ulPeripheral == SYSCTL_PERIPH_GPIOE));
783 // Disable this peripheral in deep-sleep mode.
785 HWREG(g_pulDCGCRegs[ulPeripheral >> 28]) &= ~(ulPeripheral & 0x0fffffff);
789 //*****************************************************************************
791 //! Controls peripheral clock gating in sleep and deep-sleep mode.
793 //! \param bEnable is a boolean that is \b true if the sleep and deep-sleep
794 //! peripheral configuration should be used and \b false if not.
796 //! This function controls how peripherals are clocked when the processor goes
797 //! into sleep or deep-sleep mode. By default, the peripherals are clocked the
798 //! same as in run mode; if peripheral clock gating is enabled they are clocked
799 //! according to the configuration set by SysCtlPeripheralSleepEnable(),
800 //! SysCtlPeripheralSleepDisable(), SysCtlPeripheralDeepSleepEnable(), and
801 //! SysCtlPeripheralDeepSleepDisable().
805 //*****************************************************************************
806 #if defined(GROUP_peripheralclockgating) || defined(BUILD_ALL) || \
809 SysCtlPeripheralClockGating(tBoolean bEnable)
812 // Enable peripheral clock gating as requested.
816 HWREG(SYSCTL_RCC) |= SYSCTL_RCC_ACG;
820 HWREG(SYSCTL_RCC) &= ~(SYSCTL_RCC_ACG);
825 //*****************************************************************************
827 //! Registers an interrupt handler for the system control interrupt.
829 //! \param pfnHandler is a pointer to the function to be called when the system
830 //! control interrupt occurs.
832 //! This sets the handler to be called when a system control interrupt occurs.
833 //! This will enable the global interrupt in the interrupt controller; specific
834 //! system control interrupts must be enabled via SysCtlIntEnable(). It is the
835 //! interrupt handler's responsibility to clear the interrupt source via
836 //! SysCtlIntClear().
838 //! System control can generate interrupts when the PLL achieves lock, if the
839 //! internal LDO current limit is exceeded, if the internal oscillator fails,
840 //! if the main oscillator fails, if the internal LDO output voltage droops too
841 //! much, if the external voltage droops too much, or if the PLL fails.
843 //! \sa IntRegister() for important information about registering interrupt
848 //*****************************************************************************
849 #if defined(GROUP_intregister) || defined(BUILD_ALL) || defined(DOXYGEN)
851 SysCtlIntRegister(void (*pfnHandler)(void))
854 // Register the interrupt handler, returning an error if an error occurs.
856 IntRegister(INT_SYSCTL, pfnHandler);
859 // Enable the system control interrupt.
861 IntEnable(INT_SYSCTL);
865 //*****************************************************************************
867 //! Unregisters the interrupt handler for the system control interrupt.
869 //! This function will clear the handler to be called when a system control
870 //! interrupt occurs. This will also mask off the interrupt in the interrupt
871 //! controller so that the interrupt handler no longer is called.
873 //! \sa IntRegister() for important information about registering interrupt
878 //*****************************************************************************
879 #if defined(GROUP_intunregister) || defined(BUILD_ALL) || defined(DOXYGEN)
881 SysCtlIntUnregister(void)
884 // Disable the interrupt.
886 IntDisable(INT_SYSCTL);
889 // Unregister the interrupt handler.
891 IntUnregister(INT_SYSCTL);
895 //*****************************************************************************
897 //! Enables individual system control interrupt sources.
899 //! \param ulInts is a bit mask of the interrupt sources to be enabled. Must
900 //! be a logical OR of \b SYSCTL_INT_PLL_LOCK, \b SYSCTL_INT_CUR_LIMIT,
901 //! \b SYSCTL_INT_IOSC_FAIL, \b SYSCTL_INT_MOSC_FAIL, \b SYSCTL_INT_POR,
902 //! \b SYSCTL_INT_BOR, and/or \b SYSCTL_INT_PLL_FAIL.
904 //! Enables the indicated system control interrupt sources. Only the sources
905 //! that are enabled can be reflected to the processor interrupt; disabled
906 //! sources have no effect on the processor.
910 //*****************************************************************************
911 #if defined(GROUP_intenable) || defined(BUILD_ALL) || defined(DOXYGEN)
913 SysCtlIntEnable(unsigned long ulInts)
916 // Enable the specified interrupts.
918 HWREG(SYSCTL_IMC) |= ulInts;
922 //*****************************************************************************
924 //! Disables individual system control interrupt sources.
926 //! \param ulInts is a bit mask of the interrupt sources to be disabled. Must
927 //! be a logical OR of \b SYSCTL_INT_PLL_LOCK, \b SYSCTL_INT_CUR_LIMIT,
928 //! \b SYSCTL_INT_IOSC_FAIL, \b SYSCTL_INT_MOSC_FAIL, \b SYSCTL_INT_POR,
929 //! \b SYSCTL_INT_BOR, and/or \b SYSCTL_INT_PLL_FAIL.
931 //! Disables the indicated system control interrupt sources. Only the sources
932 //! that are enabled can be reflected to the processor interrupt; disabled
933 //! sources have no effect on the processor.
937 //*****************************************************************************
938 #if defined(GROUP_intdisable) || defined(BUILD_ALL) || defined(DOXYGEN)
940 SysCtlIntDisable(unsigned long ulInts)
943 // Disable the specified interrupts.
945 HWREG(SYSCTL_IMC) &= ~(ulInts);
949 //*****************************************************************************
951 //! Clears system control interrupt sources.
953 //! \param ulInts is a bit mask of the interrupt sources to be cleared. Must
954 //! be a logical OR of \b SYSCTL_INT_PLL_LOCK, \b SYSCTL_INT_CUR_LIMIT,
955 //! \b SYSCTL_INT_IOSC_FAIL, \b SYSCTL_INT_MOSC_FAIL, \b SYSCTL_INT_POR,
956 //! \b SYSCTL_INT_BOR, and/or \b SYSCTL_INT_PLL_FAIL.
958 //! The specified system control interrupt sources are cleared, so that they no
959 //! longer assert. This must be done in the interrupt handler to keep it from
960 //! being called again immediately upon exit.
964 //*****************************************************************************
965 #if defined(GROUP_intclear) || defined(BUILD_ALL) || defined(DOXYGEN)
967 SysCtlIntClear(unsigned long ulInts)
970 // Clear the requested interrupt sources.
972 HWREG(SYSCTL_MISC) = ulInts;
976 //*****************************************************************************
978 //! Gets the current interrupt status.
980 //! \param bMasked is false if the raw interrupt status is required and true if
981 //! the masked interrupt status is required.
983 //! This returns the interrupt status for the system controller. Either the
984 //! raw interrupt status or the status of interrupts that are allowed to
985 //! reflect to the processor can be returned.
987 //! \return The current interrupt status, enumerated as a bit field of
988 //! \b SYSCTL_INT_PLL_LOCK, \b SYSCTL_INT_CUR_LIMIT, \b SYSCTL_INT_IOSC_FAIL,
989 //! \b SYSCTL_INT_MOSC_FAIL, \b SYSCTL_INT_POR, \b SYSCTL_INT_BOR, and
990 //! \b SYSCTL_INT_PLL_FAIL.
992 //*****************************************************************************
993 #if defined(GROUP_intstatus) || defined(BUILD_ALL) || defined(DOXYGEN)
995 SysCtlIntStatus(tBoolean bMasked)
998 // Return either the interrupt status or the raw interrupt status as
1003 return(HWREG(SYSCTL_MISC));
1007 return(HWREG(SYSCTL_RIS));
1012 //*****************************************************************************
1014 //! Sets the output voltage of the LDO.
1016 //! \param ulVoltage is the required output voltage from the LDO. Must be one
1017 //! of \b SYSCTL_LDO_2_25V, \b SYSCTL_LDO_2_30V, \b SYSCTL_LDO_2_35V,
1018 //! \b SYSCTL_LDO_2_40V, \b SYSCTL_LDO_2_45V, \b SYSCTL_LDO_2_50V,
1019 //! \b SYSCTL_LDO_2_55V, \b SYSCTL_LDO_2_60V, \b SYSCTL_LDO_2_65V,
1020 //! \b SYSCTL_LDO_2_70V, or \b SYSCTL_LDO_2_75V.
1022 //! This function sets the output voltage of the LDO. The default voltage is
1023 //! 2.5 V; it can be adjusted +/- 10%.
1027 //*****************************************************************************
1028 #if defined(GROUP_ldoset) || defined(BUILD_ALL) || defined(DOXYGEN)
1030 SysCtlLDOSet(unsigned long ulVoltage)
1033 // Check the arguments.
1035 ASSERT((ulVoltage == SYSCTL_LDO_2_25V) ||
1036 (ulVoltage == SYSCTL_LDO_2_30V) ||
1037 (ulVoltage == SYSCTL_LDO_2_35V) ||
1038 (ulVoltage == SYSCTL_LDO_2_40V) ||
1039 (ulVoltage == SYSCTL_LDO_2_45V) ||
1040 (ulVoltage == SYSCTL_LDO_2_50V) ||
1041 (ulVoltage == SYSCTL_LDO_2_55V) ||
1042 (ulVoltage == SYSCTL_LDO_2_60V) ||
1043 (ulVoltage == SYSCTL_LDO_2_65V) ||
1044 (ulVoltage == SYSCTL_LDO_2_70V) ||
1045 (ulVoltage == SYSCTL_LDO_2_75V));
1048 // Set the LDO voltage to the requested value.
1050 HWREG(SYSCTL_LDOPCTL) = ulVoltage;
1054 //*****************************************************************************
1056 //! Gets the output voltage of the LDO.
1058 //! This function determines the output voltage of the LDO, as specified by the
1059 //! control register.
1061 //! \return Returns the current voltage of the LDO; will be one of
1062 //! \b SYSCTL_LDO_2_25V, \b SYSCTL_LDO_2_30V, \b SYSCTL_LDO_2_35V,
1063 //! \b SYSCTL_LDO_2_40V, \b SYSCTL_LDO_2_45V, \b SYSCTL_LDO_2_50V,
1064 //! \b SYSCTL_LDO_2_55V, \b SYSCTL_LDO_2_60V, \b SYSCTL_LDO_2_65V,
1065 //! \b SYSCTL_LDO_2_70V, or \b SYSCTL_LDO_2_75V.
1067 //*****************************************************************************
1068 #if defined(GROUP_ldoget) || defined(BUILD_ALL) || defined(DOXYGEN)
1073 // Return the LDO voltage setting.
1075 return(HWREG(SYSCTL_LDOPCTL));
1079 //*****************************************************************************
1081 //! Configures the LDO failure control.
1083 //! \param ulConfig is the required LDO failure control setting; can be either
1084 //! \b SYSCTL_LDOCFG_ARST or \b SYSCTL_LDOCFG_NORST.
1086 //! This function allows the LDO to be configured to cause a processor reset
1087 //! when the output voltage becomes unregulated.
1091 //*****************************************************************************
1092 #if defined(GROUP_ldoconfigset) || defined(BUILD_ALL) || defined(DOXYGEN)
1094 SysCtlLDOConfigSet(unsigned long ulConfig)
1097 // Check hte arguments.
1099 ASSERT((ulConfig == SYSCTL_LDOCFG_ARST) ||
1100 (ulConfig == SYSCTL_LDOCFG_NORST));
1103 // Set the reset control as requested.
1105 HWREG(SYSCTL_LDOARST) = ulConfig;
1109 //*****************************************************************************
1111 //! Resets the device.
1113 //! This function will perform a software reset of the entire device. The
1114 //! processor and all peripherals will be reset and all device registers will
1115 //! return to their default values (with the exception of the reset cause
1116 //! register, which will maintain its current value but have the software reset
1117 //! bit set as well).
1119 //! \return This function does not return.
1121 //*****************************************************************************
1122 #if defined(GROUP_reset) || defined(BUILD_ALL) || defined(DOXYGEN)
1127 // Perform a software reset request. This will cause the device to reset,
1128 // no further code will be executed.
1130 HWREG(NVIC_APINT) = NVIC_APINT_VECTKEY | NVIC_APINT_SYSRESETREQ;
1133 // The device should have reset, so this should never be reached. Just in
1134 // case, loop forever.
1142 //*****************************************************************************
1144 //! Puts the processor into sleep mode.
1146 //! This function places the processor into sleep mode; it will not return
1147 //! until the processor returns to run mode. The peripherals that are enabled
1148 //! via SysCtlPeripheralSleepEnable() continue to operate and can wake up the
1149 //! processor (if automatic clock gating is enabled with
1150 //! SysCtlPeripheralClockGating(), otherwise all peripherals continue to
1155 //*****************************************************************************
1156 #if defined(GROUP_sleep) || defined(BUILD_ALL) || defined(DOXYGEN)
1161 // Wait for an interrupt.
1167 //*****************************************************************************
1169 //! Puts the processor into deep-sleep mode.
1171 //! This function places the processor into deep-sleep mode; it will not return
1172 //! until the processor returns to run mode. The peripherals that are enabled
1173 //! via SysCtlPeripheralDeepSleepEnable() continue to operate and can wake up
1174 //! the processor (if automatic clock gating is enabled with
1175 //! SysCtlPeripheralClockGating(), otherwise all peripherals continue to
1180 //*****************************************************************************
1181 #if defined(GROUP_deepsleep) || defined(BUILD_ALL) || defined(DOXYGEN)
1183 SysCtlDeepSleep(void)
1186 // Enable deep-sleep.
1188 HWREG(NVIC_SYS_CTRL) |= NVIC_SYS_CTRL_SLEEPDEEP;
1191 // Wait for an interrupt.
1196 // Disable deep-sleep so that a future sleep will work correctly.
1198 HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
1202 //*****************************************************************************
1204 //! Gets the reason for a reset.
1206 //! This function will return the reason(s) for a reset. Since the reset
1207 //! reasons are sticky until either cleared by software or an external reset,
1208 //! multiple reset reasons may be returned if multiple resets have occurred.
1209 //! The reset reason will be a logical OR of \b SYSCTL_CAUSE_LDO,
1210 //! \b SYSCTL_CAUSE_SW, \b SYSCTL_CAUSE_WDOG, \b SYSCTL_CAUSE_BOR,
1211 //! \b SYSCTL_CAUSE_POR, and/or \b SYSCTL_CAUSE_EXT.
1213 //! \return The reason(s) for a reset.
1215 //*****************************************************************************
1216 #if defined(GROUP_resetcauseget) || defined(BUILD_ALL) || defined(DOXYGEN)
1218 SysCtlResetCauseGet(void)
1221 // Return the reset reasons.
1223 return(HWREG(SYSCTL_RESC));
1227 //*****************************************************************************
1229 //! Clears reset reasons.
1231 //! \param ulCauses are the reset causes to be cleared; must be a logical OR of
1232 //! \b SYSCTL_CAUSE_LDO, \b SYSCTL_CAUSE_SW, \b SYSCTL_CAUSE_WDOG,
1233 //! \b SYSCTL_CAUSE_BOR, \b SYSCTL_CAUSE_POR, and/or \b SYSCTL_CAUSE_EXT.
1235 //! This function clears the specified sticky reset reasons. Once cleared,
1236 //! another reset for the same reason can be detected, and a reset for a
1237 //! different reason can be distinguished (instead of having two reset causes
1238 //! set). If the reset reason is used by an application, all reset causes
1239 //! should be cleared after they are retrieved with SysCtlResetCauseGet().
1243 //*****************************************************************************
1244 #if defined(GROUP_resetcauseclear) || defined(BUILD_ALL) || defined(DOXYGEN)
1246 SysCtlResetCauseClear(unsigned long ulCauses)
1249 // Clear the given reset reasons.
1251 HWREG(SYSCTL_RESC) &= ~(ulCauses);
1255 //*****************************************************************************
1257 //! Configures the brown-out control.
1259 //! \param ulConfig is the desired configuration of the brown-out control.
1260 //! Must be the logical OR of \b SYSCTL_BOR_RESET and/or
1261 //! \b SYSCTL_BOR_RESAMPLE.
1262 //! \param ulDelay is the number of internal oscillator cycles to wait before
1263 //! resampling an asserted brown-out signal. This value only has meaning when
1264 //! \b SYSCTL_BOR_RESAMPLE is set and must be less than 8192.
1266 //! This function configures how the brown-out control operates. It can detect
1267 //! a brown-out by looking at only the brown-out output, or it can wait for it
1268 //! to be active for two consecutive samples separated by a configurable time.
1269 //! When it detects a brown-out condition, it can either reset the device or
1270 //! generate a processor interrupt.
1274 //*****************************************************************************
1275 #if defined(GROUP_brownoutconfigset) || defined(BUILD_ALL) || defined(DOXYGEN)
1277 SysCtlBrownOutConfigSet(unsigned long ulConfig, unsigned long ulDelay)
1280 // Check the arguments.
1282 ASSERT(!(ulConfig & ~(SYSCTL_BOR_RESET | SYSCTL_BOR_RESAMPLE)));
1283 ASSERT(ulDelay < 8192);
1286 // Configure the brown-out reset control.
1288 HWREG(SYSCTL_PBORCTL) = (ulDelay << SYSCTL_PBORCTL_BOR_SH) | ulConfig;
1292 //*****************************************************************************
1294 //! Sets the clocking of the device.
1296 //! \param ulConfig is the required configuration of the device clocking.
1298 //! This function configures the clocking of the device. The input crystal
1299 //! frequency, oscillator to be used, use of the PLL, and the system clock
1300 //! divider are all configured with this function.
1302 //! The \b ulConfig parameter is the logical OR of several different values,
1303 //! many of which are grouped into sets where only one can be chosen.
1305 //! The system clock divider is chosen with one of the following values:
1306 //! \b SYSCTL_SYSDIV_1, \b SYSCTL_SYSDIV_2, \b SYSCTL_SYSDIV_3,
1307 //! \b SYSCTL_SYSDIV_4, \b SYSCTL_SYSDIV_5, \b SYSCTL_SYSDIV_6,
1308 //! \b SYSCTL_SYSDIV_7, \b SYSCTL_SYSDIV_8, \b SYSCTL_SYSDIV_9,
1309 //! \b SYSCTL_SYSDIV_10, \b SYSCTL_SYSDIV_11, \b SYSCTL_SYSDIV_12,
1310 //! \b SYSCTL_SYSDIV_13, \b SYSCTL_SYSDIV_14, \b SYSCTL_SYSDIV_15, or
1311 //! \b SYSCTL_SYSDIV_16.
1313 //! The use of the PLL is chosen with either \b SYSCTL_USE_PLL or
1314 //! \b SYSCTL_USE_OSC.
1316 //! The external crystal frequency is chosen with one of the following values:
1317 //! \b SYSCTL_XTAL_3_57MHZ, \b SYSCTL_XTAL_3_68MHZ, \b SYSCTL_XTAL_4MHZ,
1318 //! \b SYSCTL_XTAL_4_09MHZ, \b SYSCTL_XTAL_4_91MHZ, \b SYSCTL_XTAL_5MHZ,
1319 //! \b SYSCTL_XTAL_5_12MHZ, \b SYSCTL_XTAL_6MHZ, \b SYSCTL_XTAL_6_14MHZ,
1320 //! \b SYSCTL_XTAL_7_37MHZ, \b SYSCTL_XTAL_8MHZ, or \b SYSCTL_XTAL_8_19MHZ.
1322 //! The oscillator source is chosen with one of the following values:
1323 //! \b SYSCTL_OSC_MAIN, \b SYSCTL_OSC_INT, or \b SYSCTL_OSC_INT4.
1325 //! The internal and main oscillators are disabled with the
1326 //! \b SYSCTL_INT_OSC_DIS and \b SYSCTL_MAIN_OSC_DIS flags, respectively.
1327 //! The external oscillator must be enabled in order to use an external clock
1328 //! source. Note that attempts to disable the oscillator used to clock the
1329 //! device will be prevented by the hardware.
1331 //! To clock the system from an external source (such as an external crystal
1332 //! oscillator), use \b SYSCTL_USE_OSC \b | \b SYSCTL_OSC_MAIN. To clock the
1333 //! system from the main oscillator, use \b SYSCTL_USE_OSC \b |
1334 //! \b SYSCTL_OSC_MAIN. To clock the system from the PLL, use
1335 //! \b SYSCTL_USE_PLL \b | \b SYSCTL_OSC_MAIN, and select the appropriate
1336 //! crystal with one of the \b SYSCTL_XTAL_xxx values.
1338 //! \note If selecting the PLL as the system clock source (i.e. via
1339 //! \b SYSCTL_USE_PLL), this function will poll the PLL lock interrupt to
1340 //! determine when the PLL has locked. If an interrupt handler for the
1341 //! system control interrupt is in place, and it responds to and clears the
1342 //! PLL lock interrupt, this function will delay until its timeout has occurred
1343 //! instead of completing as soon as PLL lock is achieved.
1347 //*****************************************************************************
1348 #if defined(GROUP_clockset) || defined(BUILD_ALL) || defined(DOXYGEN)
1350 SysCtlClockSet(unsigned long ulConfig)
1352 volatile unsigned long ulDelay;
1353 unsigned long ulRCC;
1356 // Get the current value of the RCC register.
1358 ulRCC = HWREG(SYSCTL_RCC);
1361 // Bypass the PLL and system clock dividers for now.
1363 ulRCC |= SYSCTL_RCC_BYPASS;
1364 ulRCC &= ~(SYSCTL_RCC_USE_SYSDIV);
1367 // Write the new RCC value.
1369 HWREG(SYSCTL_RCC) = ulRCC;
1372 // Make sure that the PLL and system clock dividers are bypassed for now.
1374 ulRCC |= SYSCTL_RCC_BYPASS;
1375 ulRCC &= ~(SYSCTL_RCC_USE_SYSDIV);
1378 // Make sure that the required oscillators are enabled. For now, the
1379 // previously enabled oscillators must be enabled along with the newly
1380 // requested oscillators.
1382 ulRCC &= (~(SYSCTL_RCC_IOSCDIS | SYSCTL_RCC_MOSCDIS) |
1383 (ulConfig & (SYSCTL_RCC_IOSCDIS | SYSCTL_RCC_MOSCDIS)));
1386 // Set the new crystal value, oscillator source, and PLL configuration.
1388 ulRCC &= ~(SYSCTL_RCC_XTAL_MASK | SYSCTL_RCC_OSCSRC_MASK |
1389 SYSCTL_RCC_PWRDN | SYSCTL_RCC_OE);
1390 ulRCC |= ulConfig & (SYSCTL_RCC_XTAL_MASK | SYSCTL_RCC_OSCSRC_MASK |
1391 SYSCTL_RCC_PWRDN | SYSCTL_RCC_OE);
1394 // Clear the PLL lock interrupt.
1396 HWREG(SYSCTL_MISC) = SYSCTL_INT_PLL_LOCK;
1399 // Write the new RCC value.
1401 HWREG(SYSCTL_RCC) = ulRCC;
1404 // Wait for a bit so that new crystal value and oscillator source can take
1405 // effect. One of the oscillators may need to be started as well.
1407 for(ulDelay = 0; ulDelay < 16; ulDelay++)
1412 // Disable the appropriate oscillators.
1414 ulRCC &= ~(SYSCTL_RCC_IOSCDIS | SYSCTL_RCC_MOSCDIS);
1415 ulRCC |= ulConfig & (SYSCTL_RCC_IOSCDIS | SYSCTL_RCC_MOSCDIS);
1418 // Write the new RCC value.
1420 HWREG(SYSCTL_RCC) = ulRCC;
1423 // Set the requested system divider. This will not get written
1426 ulRCC &= ~(SYSCTL_RCC_SYSDIV_MASK | SYSCTL_RCC_USE_SYSDIV);
1427 ulRCC |= ulConfig & (SYSCTL_RCC_SYSDIV_MASK | SYSCTL_RCC_USE_SYSDIV);
1430 // See if the PLL output is being used to clock the system.
1432 if(!(ulConfig & SYSCTL_RCC_BYPASS))
1435 // Wait until the PLL has locked.
1437 for(ulDelay = 32768; ulDelay > 0; ulDelay--)
1439 if(HWREG(SYSCTL_RIS) & SYSCTL_INT_PLL_LOCK)
1446 // Enable use of the PLL.
1448 ulRCC &= ~(SYSCTL_RCC_BYPASS);
1452 // Write the final RCC value.
1454 HWREG(SYSCTL_RCC) = ulRCC;
1457 // Delay for a little bit so that the system divider takes effect.
1459 for(ulDelay = 0; ulDelay < 16; ulDelay++)
1465 //*****************************************************************************
1467 //! Gets the processor clock rate.
1469 //! This function determines the clock rate of the processor clock. This is
1470 //! also the clock rate of all the peripheral modules (with the exception of
1471 //! PWM, which has its own clock divider).
1473 //! \note This will not return accurate results if SysCtlClockSet() has not
1474 //! been called to configure the clocking of the device, or if the device is
1475 //! directly clocked from a crystal (or a clock source) that is not one of the
1476 //! supported crystal frequencies. In the later case, this function should be
1477 //! modified to directly return the correct system clock rate.
1479 //! \return The processor clock rate.
1481 //*****************************************************************************
1482 #if defined(GROUP_clockget) || defined(BUILD_ALL) || defined(DOXYGEN)
1484 SysCtlClockGet(void)
1486 unsigned long ulRCC, ulPLL, ulClk;
1491 ulRCC = HWREG(SYSCTL_RCC);
1494 // Get the base clock rate.
1496 switch(ulRCC & SYSCTL_RCC_OSCSRC_MASK)
1499 // The main oscillator is the clock source. Determine its rate from
1500 // the crystal setting field.
1502 case SYSCTL_RCC_OSCSRC_MAIN:
1504 ulClk = g_pulXtals[((ulRCC & SYSCTL_RCC_XTAL_MASK) >>
1505 SYSCTL_RCC_XTAL_SHIFT) -
1506 (SYSCTL_RCC_XTAL_3_57MHZ >>
1507 SYSCTL_RCC_XTAL_SHIFT)];
1512 // The internal oscillator is the source clock. This is not an
1513 // accurate clock (it is +/- 50%); what is used is the nominal.
1515 case SYSCTL_RCC_OSCSRC_INT:
1522 // The internal oscillator divided by four is the source clock. This
1523 // is not an accurate clock (it is +/- 50%); what is used is the
1526 case SYSCTL_RCC_OSCSRC_INT4:
1528 ulClk = 15000000 / 4;
1533 // An unknown setting, so return a zero clock (i.e. an unknown clock
1543 // See if the PLL is being used.
1545 if(!(ulRCC & SYSCTL_RCC_BYPASS))
1548 // Get the PLL configuration.
1550 ulPLL = HWREG(SYSCTL_PLLCFG);
1553 // Compute the PLL output frequency based on its input frequency.
1555 ulClk = ((ulClk * (((ulPLL & SYSCTL_PLLCFG_F_MASK) >>
1556 SYSCTL_PLLCFG_F_SHIFT) + 2)) /
1557 (((ulPLL & SYSCTL_PLLCFG_R_MASK) >>
1558 SYSCTL_PLLCFG_R_SHIFT) + 2));
1561 // See if the optional output divide by 2 is being used.
1563 if(ulPLL & SYSCTL_PLLCFG_OD_2)
1569 // See if the optional output divide by 4 is being used.
1571 if(ulPLL & SYSCTL_PLLCFG_OD_4)
1578 // See if the system divider is being used.
1580 if(ulRCC & SYSCTL_RCC_USE_SYSDIV)
1583 // Adjust the clock rate by the system clock divider.
1585 ulClk /= ((ulRCC & SYSCTL_RCC_SYSDIV_MASK) >>
1586 SYSCTL_RCC_SYSDIV_SHIFT) + 1;
1590 // Return the computed clock rate.
1596 //*****************************************************************************
1598 //! Sets the PWM clock configuration.
1600 //! \param ulConfig is the configuration for the PWM clock; it must be one of
1601 //! \b SYSCTL_PWMDIV_1, \b SYSCTL_PWMDIV_2, \b SYSCTL_PWMDIV_4,
1602 //! \b SYSCTL_PWMDIV_8, \b SYSCTL_PWMDIV_16, \b SYSCTL_PWMDIV_32, or
1603 //! \b SYSCTL_PWMDIV_64.
1605 //! This function sets the rate of the clock provided to the PWM module as a
1606 //! ratio of the processor clock. This clock is used by the PWM module to
1607 //! generate PWM signals; its rate forms the basis for all PWM signals.
1609 //! \note The clocking of the PWM is dependent upon the system clock rate as
1610 //! configured by SysCtlClockSet().
1614 //*****************************************************************************
1615 #if defined(GROUP_pwmclockset) || defined(BUILD_ALL) || defined(DOXYGEN)
1617 SysCtlPWMClockSet(unsigned long ulConfig)
1620 // Check the arguments.
1622 ASSERT((ulConfig == SYSCTL_PWMDIV_1) ||
1623 (ulConfig == SYSCTL_PWMDIV_2) ||
1624 (ulConfig == SYSCTL_PWMDIV_4) ||
1625 (ulConfig == SYSCTL_PWMDIV_8) ||
1626 (ulConfig == SYSCTL_PWMDIV_16) ||
1627 (ulConfig == SYSCTL_PWMDIV_32) ||
1628 (ulConfig == SYSCTL_PWMDIV_64));
1631 // Check that there is a PWM block on this part.
1633 ASSERT(HWREG(SYSCTL_DC1) & SYSCTL_DC1_PWM);
1636 // Set the PWM clock configuration into the run-mode clock configuration
1639 HWREG(SYSCTL_RCC) = ((HWREG(SYSCTL_RCC) &
1640 ~(SYSCTL_RCC_USE_PWMDIV | SYSCTL_RCC_PWMDIV_MASK)) |
1645 //*****************************************************************************
1647 //! Gets the current PWM clock configuration.
1649 //! This function returns the current PWM clock configuration.
1651 //! \return The current PWM clock configuration; will be one of
1652 //! \b SYSCTL_PWMDIV_1, \b SYSCTL_PWMDIV_2, \b SYSCTL_PWMDIV_4,
1653 //! \b SYSCTL_PWMDIV_8, \b SYSCTL_PWMDIV_16, \b SYSCTL_PWMDIV_32, or
1654 //! \b SYSCTL_PWMDIV_64.
1656 //*****************************************************************************
1657 #if defined(GROUP_pwmclockget) || defined(BUILD_ALL) || defined(DOXYGEN)
1659 SysCtlPWMClockGet(void)
1662 // Check that there is a PWM block on this part.
1664 ASSERT(HWREG(SYSCTL_DC1) & SYSCTL_DC1_PWM);
1667 // Return the current PWM clock configuration.
1669 return(HWREG(SYSCTL_RCC) &
1670 (SYSCTL_RCC_USE_PWMDIV | SYSCTL_RCC_PWMDIV_MASK));
1674 //*****************************************************************************
1676 //! Sets the sample rate of the ADC.
1678 //! \param ulSpeed is the desired sample rate of the ADC; must be one of
1679 //! \b SYSCTL_ADCSPEED_1MSPS, \b SYSCTL_ADCSPEED_500KSPS,
1680 //! \b SYSCTL_ADCSPEED_250KSPS, or \b SYSCTL_ADCSPEED_125KSPS.
1682 //! This function sets the rate at which the ADC samples are captured by the
1683 //! ADC block. The sampling speed may be limited by the hardware, so the
1684 //! sample rate may end up being slower than requested. SysCtlADCSpeedGet()
1685 //! will return the actual speed in use.
1689 //*****************************************************************************
1690 #if defined(GROUP_adcspeedset) || defined(BUILD_ALL) || defined(DOXYGEN)
1692 SysCtlADCSpeedSet(unsigned long ulSpeed)
1695 // Check the arguments.
1697 ASSERT((ulSpeed == SYSCTL_ADCSPEED_1MSPS) ||
1698 (ulSpeed == SYSCTL_ADCSPEED_500KSPS) ||
1699 (ulSpeed == SYSCTL_ADCSPEED_250KSPS) ||
1700 (ulSpeed == SYSCTL_ADCSPEED_125KSPS));
1703 // Check that there is an ADC block on this part.
1705 ASSERT(HWREG(SYSCTL_DC1) & SYSCTL_DC1_ADC);
1708 // Set the ADC speed in run, sleep, and deep-sleep mode.
1710 HWREG(SYSCTL_RCGC0) = ((HWREG(SYSCTL_RCGC0) & ~(SYSCTL_SET0_ADCSPD_MASK)) |
1712 HWREG(SYSCTL_SCGC0) = ((HWREG(SYSCTL_SCGC0) & ~(SYSCTL_SET0_ADCSPD_MASK)) |
1714 HWREG(SYSCTL_DCGC0) = ((HWREG(SYSCTL_DCGC0) & ~(SYSCTL_SET0_ADCSPD_MASK)) |
1719 //*****************************************************************************
1721 //! Gets the sample rate of the ADC.
1723 //! This function gets the current sample rate of the ADC.
1725 //! \return Returns the current ADC sample rate; will be one of
1726 //! \b SYSCTL_ADCSPEED_1MSPS, \b SYSCTL_ADCSPEED_500KSPS,
1727 //! \b SYSCTL_ADCSPEED_250KSPS, or \b SYSCTL_ADCSPEED_125KSPS.
1729 //*****************************************************************************
1730 #if defined(GROUP_adcspeedget) || defined(BUILD_ALL) || defined(DOXYGEN)
1732 SysCtlADCSpeedGet(void)
1735 // Check that there is an ADC block on this part.
1737 ASSERT(HWREG(SYSCTL_DC1) & SYSCTL_DC1_ADC);
1740 // Return the current ADC speed.
1742 return(HWREG(SYSCTL_RCGC0) & SYSCTL_SET0_ADCSPD_MASK);
1746 //*****************************************************************************
1748 //! Configures the internal oscillator verification timer.
1750 //! \param bEnable is a boolean that is \b true if the internal oscillator
1751 //! verification timer should be enabled.
1753 //! This function allows the internal oscillator verification timer to be
1754 //! enabled or disabled. When enabled, an interrupt will be generated if the
1755 //! internal oscillator ceases to operate.
1757 //! \note Both oscillators (main and internal) must be enabled for this
1758 //! verification timer to operate as the main oscillator will verify the
1759 //! internal oscillator.
1763 //*****************************************************************************
1764 #if defined(GROUP_boscverificationset) || defined(BUILD_ALL) || \
1767 SysCtlIOSCVerificationSet(tBoolean bEnable)
1770 // Enable or disable the internal oscillator verification timer as
1775 HWREG(SYSCTL_RCC) |= SYSCTL_RCC_IOSCVER;
1779 HWREG(SYSCTL_RCC) &= ~(SYSCTL_RCC_IOSCVER);
1784 //*****************************************************************************
1786 //! Configures the main oscillator verification timer.
1788 //! \param bEnable is a boolean that is \b true if the main oscillator
1789 //! verification timer should be enabled.
1791 //! This function allows the main oscillator verification timer to be enabled
1792 //! or disabled. When enabled, an interrupt will be generated if the main
1793 //! oscillator ceases to operate.
1795 //! \note Both oscillators (main and internal) must be enabled for this
1796 //! verification timer to operate as the internal oscillator will verify the
1797 //! main oscillator.
1801 //*****************************************************************************
1802 #if defined(GROUP_moscverificationset) || defined(BUILD_ALL) || \
1805 SysCtlMOSCVerificationSet(tBoolean bEnable)
1808 // Enable or disable the main oscillator verification timer as requested.
1812 HWREG(SYSCTL_RCC) |= SYSCTL_RCC_MOSCVER;
1816 HWREG(SYSCTL_RCC) &= ~(SYSCTL_RCC_MOSCVER);
1821 //*****************************************************************************
1823 //! Configures the PLL verification timer.
1825 //! \param bEnable is a boolean that is \b true if the PLL verification timer
1826 //! should be enabled.
1828 //! This function allows the PLL verification timer to be enabled or disabled.
1829 //! When enabled, an interrupt will be generated if the PLL ceases to operate.
1831 //! \note The main oscillator must be enabled for this verification timer to
1832 //! operate as it is used to check the PLL. Also, the verification timer
1833 //! should be disabled while the PLL is being reconfigured via
1834 //! SysCtlClockSet().
1838 //*****************************************************************************
1839 #if defined(GROUP_pllverificationset) || defined(BUILD_ALL) || defined(DOXYGEN)
1841 SysCtlPLLVerificationSet(tBoolean bEnable)
1844 // Enable or disable the PLL verification timer as requested.
1848 HWREG(SYSCTL_RCC) |= SYSCTL_RCC_PLLVER;
1852 HWREG(SYSCTL_RCC) &= ~(SYSCTL_RCC_PLLVER);
1857 //*****************************************************************************
1859 //! Clears the clock verification status.
1861 //! This function clears the status of the clock verification timers, allowing
1862 //! them to assert another failure if detected.
1866 //*****************************************************************************
1867 #if defined(GROUP_clkverificationclear) || defined(BUILD_ALL) || \
1870 SysCtlClkVerificationClear(void)
1873 // Clear the clock verification.
1875 HWREG(SYSCTL_CLKVCLR) = SYSCTL_CLKVCLR_CLR;
1878 // The bit does not self-reset, so clear it.
1880 HWREG(SYSCTL_CLKVCLR) = 0;
1884 //*****************************************************************************
1886 // Close the Doxygen group.
1889 //*****************************************************************************