1 /******************************************************************************
2 *  Filename:       sys_ctrl.h
3 *
4 *  Description:    Defines and prototypes for the System Controller.
5 *
6 *  Copyright (c) 2015 - 2022, Texas Instruments Incorporated
7 *  All rights reserved.
8 *
9 *  Redistribution and use in source and binary forms, with or without
10 *  modification, are permitted provided that the following conditions are met:
11 *
12 *  1) Redistributions of source code must retain the above copyright notice,
13 *     this list of conditions and the following disclaimer.
14 *
15 *  2) Redistributions in binary form must reproduce the above copyright notice,
16 *     this list of conditions and the following disclaimer in the documentation
17 *     and/or other materials provided with the distribution.
18 *
19 *  3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 *     be used to endorse or promote products derived from this software without
21 *     specific prior written permission.
22 *
23 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 *  POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 
37 //*****************************************************************************
38 //
39 //! \addtogroup system_control_group
40 //! @{
41 //! \addtogroup sysctrl_api
42 //! @{
43 //
44 //*****************************************************************************
45 
46 #ifndef __SYSCTRL_H__
47 #define __SYSCTRL_H__
48 
49 //*****************************************************************************
50 //
51 // If building with a C++ compiler, make all of the definitions in this header
52 // have a C binding.
53 //
54 //*****************************************************************************
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59 
60 #include <stdbool.h>
61 #include <stdint.h>
62 #include "../inc/hw_types.h"
63 #include "../inc/hw_memmap.h"
64 #include "../inc/hw_ints.h"
65 #include "../inc/hw_sysctl.h"
66 #include "../inc/hw_prcm.h"
67 #include "../inc/hw_nvic.h"
68 #include "../inc/hw_aon_ioc.h"
69 #include "../inc/hw_ddi_0_osc.h"
70 #include "../inc/hw_rfc_pwr.h"
71 #include "../inc/hw_prcm.h"
72 #include "../inc/hw_adi_3_refsys.h"
73 #include "../inc/hw_aon_pmctl.h"
74 #include "../inc/hw_aon_rtc.h"
75 #include "../inc/hw_fcfg1.h"
76 #include "interrupt.h"
77 #include "debug.h"
78 #include "pwr_ctrl.h"
79 #include "osc.h"
80 #include "prcm.h"
81 #include "adi.h"
82 #include "ddi.h"
83 #include "cpu.h"
84 #include "vims.h"
85 
86 //*****************************************************************************
87 //
88 // Support for DriverLib in ROM:
89 // This section renames all functions that are not "static inline", so that
90 // calling these functions will default to implementation in flash. At the end
91 // of this file a second renaming will change the defaults to implementation in
92 // ROM for available functions.
93 //
94 // To force use of the implementation in flash, e.g. for debugging:
95 // - Globally: Define DRIVERLIB_NOROM at project level
96 // - Per function: Use prefix "NOROM_" when calling the function
97 //
98 //*****************************************************************************
99 #if !defined(DOXYGEN)
100     #define SysCtrlIdle                     NOROM_SysCtrlIdle
101     #define SysCtrlShutdownWithAbort        NOROM_SysCtrlShutdownWithAbort
102     #define SysCtrlShutdown                 NOROM_SysCtrlShutdown
103     #define SysCtrlStandby                  NOROM_SysCtrlStandby
104     #define SysCtrlSetRechargeBeforePowerDown NOROM_SysCtrlSetRechargeBeforePowerDown
105     #define SysCtrlAdjustRechargeAfterPowerDown NOROM_SysCtrlAdjustRechargeAfterPowerDown
106     #define SysCtrl_DCDC_VoltageConditionalControl NOROM_SysCtrl_DCDC_VoltageConditionalControl
107     #define SysCtrlResetSourceGet           NOROM_SysCtrlResetSourceGet
108 #endif
109 
110 //*****************************************************************************
111 //
112 // Defines for the settings of the main XOSC
113 //
114 //*****************************************************************************
115 #define SYSCTRL_SYSBUS_ON       0x00000001
116 #define SYSCTRL_SYSBUS_OFF      0x00000000
117 
118 //*****************************************************************************
119 //
120 // Defines for the different power modes of the System CPU
121 //
122 //*****************************************************************************
123 #define CPU_RUN                 0x00000000
124 #define CPU_SLEEP               0x00000001
125 #define CPU_DEEP_SLEEP          0x00000002
126 
127 //*****************************************************************************
128 //
129 // Defines for SysCtrlSetRechargeBeforePowerDown
130 //
131 //*****************************************************************************
132 #define XOSC_IN_HIGH_POWER_MODE 0 // When xosc_hf is in HIGH_POWER_XOSC
133 #define XOSC_IN_LOW_POWER_MODE  1 // When xosc_hf is in LOW_POWER_XOSC
134 
135 //*****************************************************************************
136 //
137 // Defines for the vimsPdMode parameter of SysCtrlIdle and SysCtrlStandby
138 //
139 //*****************************************************************************
140 #define VIMS_ON_CPU_ON_MODE     0 // VIMS power domain is only powered when CPU power domain is powered
141 #define VIMS_ON_BUS_ON_MODE     1 // VIMS power domain is powered whenever the BUS power domain is powered
142 #define VIMS_NO_PWR_UP_MODE     2 // VIMS power domain is not powered up at next wakeup.
143 
144 //*****************************************************************************
145 //
146 // Defines for the rechargeMode parameter of SysCtrlStandby
147 //
148 //*****************************************************************************
149 #define SYSCTRL_PREFERRED_RECHARGE_MODE                                       \
150                                 0xFFFFFFFF // Preferred recharge mode
151 
152 //*****************************************************************************
153 //
154 // API Functions and prototypes
155 //
156 //*****************************************************************************
157 
158 //*****************************************************************************
159 //
160 //! \brief Force the system into idle mode.
161 //!
162 //! This function forces the system into IDLE mode by configuring the requested
163 //! VIMS mode, enabling cache retention and powering off the CPU power domain.
164 //!
165 //! \param vimsPdMode selects the requested VIMS power domain mode
166 //! The parameter must be one of the following:
167 //! - \ref VIMS_ON_CPU_ON_MODE
168 //! - \ref VIMS_ON_BUS_ON_MODE
169 //! - \ref VIMS_NO_PWR_UP_MODE
170 //!
171 //! \return None
172 //
173 //*****************************************************************************
174 extern void SysCtrlIdle(uint32_t vimsPdMode);
175 
176 //*****************************************************************************
177 //
178 //! \brief Try to enter shutdown but abort if wakeup event happened before shutdown.
179 //!
180 //! This function puts the device in shutdown state if no wakeup events are
181 //! detected before shutdown.
182 //!
183 //! Compared to the basic \ref SysCtrlShutdown() function this function makes sure
184 //! that wakeup events that happen before actual shutdown are also detected. This
185 //! function either enters shutdown with a guaranteed wakeup detection or returns
186 //! to the caller function due to a pre-shutdown wakeup event.
187 //!
188 //! See \ref SysCtrlShutdown() for basic information about how to configure the device before
189 //! shutdown and how to wakeup from shutdown.
190 //!
191 //! This function uses IO edge detection in addition to the mandatory wakeup configuration.
192 //! Additional requirements to the application for this function are:
193 //! - \b Before :
194 //!   - When the application configures an IO for wakeup (see \ref IOCIOShutdownSet())
195 //!     the application must also configure the same IO for edge detection
196 //!     (see \ref IOCIOIntSet()).
197 //!   - Edge detection must use the same polarity as the wakeup configuration.
198 //!   - Application must enable peripheral power domain (see \ref PRCMPowerDomainOn())
199 //!     and enable GPIO module in the peripheral power domain (see \ref PRCMPeripheralRunEnable()).
200 //! - \b After :
201 //!   - An edge, with same polarity as a wakeup event, was detected on a wakeup
202 //!     enabled IO before shutdown, and the shutdown was aborted. The application must
203 //!     clear the event generated by the edge detect (see \ref GPIO_clearEventDio()) and
204 //!     decide what happens next.
205 //!
206 //! Useful functions related to shutdown:
207 //! - \ref IOCIOShutdownSet() : Enables wakeup from shutdown.
208 //! - \ref IOCIOIntSet() : Enables IO edge detection.
209 //! - \ref PRCMPowerDomainOn() : Enables peripheral power domain.
210 //! - \ref PRCMPeripheralRunEnable() : Enables GPIO module.
211 //! - \ref SysCtrlResetSourceGet() : Detects wakeup from shutdown.
212 //! - \ref PowerCtrlPadSleepDisable() : Unlatches outputs (disables pad sleep) after
213 //!    wakeup from shutdown.
214 //! - \ref GPIO_clearEventDio() : Clears edge detects.
215 //!
216 //! It is recommended to disable interrupts before calling this function because:
217 //! - Pads are in sleep mode while this function runs.
218 //! - An interrupt routine might be terminated if it is triggered after the decision
219 //!   to enter shutdown.
220 //!
221 //! \return None
222 //
223 //*****************************************************************************
224 extern void SysCtrlShutdownWithAbort(void);
225 
226 //*****************************************************************************
227 //
228 //! \brief Enable shutdown of the device.
229 //!
230 //! This function puts the device in shutdown state. The device automatically
231 //! latches all outputs (pads in sleep) before it turns off all internal power
232 //! supplies.
233 //!
234 //! JTAG must be disconnected and JTAG power domain must be off before device can
235 //! enter shutdown. This function waits until the device satisfies all shutdown
236 //! conditions before it enters shutdown.
237 //!
238 //! \note The application must unlatch the outputs when the device wakes up from shutdown.
239 //! It is recommended that any outputs that need to be restored after a wakeup from
240 //! shutdown are restored before outputs are unlatched in order to avoid glitches.
241 //!
242 //! See \ref PowerCtrlPadSleepDisable() for information about how to unlatch outputs
243 //! (disable pad sleep) after wakeup from shutdown.
244 //!
245 //! \note Wakeup events are only detected after the device enters shutdown.
246 //!
247 //! See \ref IOCIOShutdownSet() for information about how to enable wakeup from shutdown.
248 //!
249 //! See \ref SysCtrlResetSourceGet() for information about how to detect wakeup
250 //! from shutdown.
251 //!
252 //! It is recommended to disable interrupts before calling this function. Shutdown
253 //! happens immediately when the device satisfies all shutdown conditions thus
254 //! interrupt routines triggered after this function is called might be
255 //! aborted.
256 //!
257 //! \return This function does \b not return.
258 //
259 //*****************************************************************************
260 extern void SysCtrlShutdown(void);
261 
262 
263 //*****************************************************************************
264 //
265 //! \brief Force the system into standby mode.
266 //!
267 //! This function forces all power domains (RFCORE, SERIAL, PERIPHERAL) off.
268 //! The VIMS and CPU power domains are turned off by the HW when the
269 //! \ref PRCMDeepSleep() function is called.
270 //! The IOs are latched (frozen) before the power domains are turned off to
271 //! avoid glitches.
272 //! The VIMS retention (cache) and VIMS module are turned off if requested.
273 //! The deep-sleep clock for the crypto and DMA modules are turned off,
274 //! as they must be off in order to enter standby.
275 //! This function assumes that the LF clock has already been switched to
276 //! and that the LF clock qualifiers must have been disabled/bypassed.
277 //!
278 //! In internal regulator mode the adaptive recharge functionality is enabled
279 //! with fixed parameter values.
280 //! In external regulator mode the recharge functionality is disabled.
281 //!
282 //! \note This function is optimized to execute with TI-RTOS. There might be
283 //! application specific prerequisites you would want to do before entering
284 //! standby which deviate from this specific implementation.
285 //!
286 //! \param retainCache selects if VIMS cache shall be retained or not.
287 //! - false : VIMS cache is not retained
288 //! - true : VIMS cache is retained
289 //! \param vimsPdMode selects the VIMS power domain mode.
290 //! The parameter must be one of the following:
291 //! - \ref VIMS_ON_CPU_ON_MODE
292 //! - \ref VIMS_NO_PWR_UP_MODE
293 //! \param rechargeMode specifies the requested recharge mode.
294 //! The parameter must be one of the following:
295 //! - \ref SYSCTRL_PREFERRED_RECHARGE_MODE : Preferred recharge mode specified by TI
296 //!
297 //! \return None
298 //
299 //*****************************************************************************
300 extern void SysCtrlStandby(bool retainCache, uint32_t vimsPdMode, uint32_t rechargeMode);
301 
302 //*****************************************************************************
303 //
304 //! \brief Get the CPU core clock frequency.
305 //!
306 //! Use this function to get the current clock frequency for the CPU.
307 //!
308 //! The CPU can run from 48 MHz and down to 750kHz. The frequency is defined
309 //! by the combined division factor of the SYSBUS and the CPU clock divider.
310 //!
311 //! \return Returns the current CPU core clock frequency.
312 //
313 //*****************************************************************************
314 __STATIC_INLINE uint32_t
SysCtrlClockGet(void)315 SysCtrlClockGet( void )
316 {
317     // Return fixed clock speed
318     return( GET_MCU_CLOCK );
319 }
320 
321 //*****************************************************************************
322 //
323 //! \brief Sync all accesses to the AON register interface.
324 //!
325 //! When this function returns, all writes to the AON register interface are
326 //! guaranteed to have propagated to hardware. The function will return
327 //! immediately if no AON writes are pending; otherwise, it will wait for the next
328 //! AON clock before returning.
329 //!
330 //! \return None
331 //!
332 //! \sa \ref SysCtrlAonUpdate()
333 //
334 //*****************************************************************************
335 __STATIC_INLINE void
SysCtrlAonSync(void)336 SysCtrlAonSync(void)
337 {
338     // Sync the AON interface
339     HWREG(AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SYNC);
340 }
341 
342 //*****************************************************************************
343 //
344 //! \brief Update all interfaces to AON.
345 //!
346 //! When this function returns, at least 1 clock cycle has progressed on the
347 //! AON domain, so that any outstanding updates to and from the AON interface
348 //! is guaranteed to be in sync.
349 //!
350 //! \note This function should primarily be used after wakeup from sleep modes,
351 //! as it will guarantee that all shadow registers on the AON interface are updated
352 //! before reading any AON registers from the MCU domain. If a write has been
353 //! done to the AON interface it is sufficient to call the \ref SysCtrlAonSync().
354 //!
355 //! \return None
356 //!
357 //! \sa \ref SysCtrlAonSync()
358 //
359 //*****************************************************************************
360 __STATIC_INLINE void
SysCtrlAonUpdate(void)361 SysCtrlAonUpdate(void)
362 {
363     // Force a clock cycle on the AON interface to guarantee all registers are
364     // in sync.
365     HWREG(AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SYNC) = 1;
366     HWREG(AON_RTC_BASE + NONSECURE_OFFSET + AON_RTC_O_SYNC);
367 }
368 
369 //*****************************************************************************
370 //
371 //! \brief Set Recharge values before entering Power Down.
372 //!
373 //! This function shall be called just before entering Power Down.
374 //! This function typically does nothing (default setting), but
375 //! if temperature compensated recharge level are enabled (by setting
376 //! CCFG_MODE_CONF_VDDR_TRIM_SLEEP_TC = 0)
377 //! it adds temperature compensation to the recharge level.
378 //!
379 //! \param xoscPowerMode (typically running in XOSC_IN_HIGH_POWER_MODE all the time).
380 //! - \ref XOSC_IN_HIGH_POWER_MODE : When xosc_hf is in HIGH_POWER_XOSC.
381 //! - \ref XOSC_IN_LOW_POWER_MODE  : When xosc_hf is in LOW_POWER_XOSC.
382 //!
383 //! \return None
384 //
385 //*****************************************************************************
386 extern void SysCtrlSetRechargeBeforePowerDown( uint32_t xoscPowerMode );
387 
388 //*****************************************************************************
389 //
390 //! \brief Adjust Recharge calculations to be used next.
391 //!
392 //! Nothing to be done but keeping this function for platform compatibility.
393 //!
394 //! \return None
395 //
396 //*****************************************************************************
397 extern void SysCtrlAdjustRechargeAfterPowerDown( uint32_t vddrRechargeMargin );
398 
399 //*****************************************************************************
400 //
401 //! \brief Turns DCDC on or off depending of what is considered to be optimal usage.
402 //!
403 //! This function controls the DCDC only if both the following CCFG settings are \c true:
404 //! - DCDC is configured to be used.
405 //! - Alternative DCDC settings are defined and enabled.
406 //!
407 //! The DCDC is configured in accordance to the CCFG settings when turned on.
408 //!
409 //! This function should be called periodically.
410 //!
411 //! \return None
412 //
413 //*****************************************************************************
414 extern void SysCtrl_DCDC_VoltageConditionalControl( void );
415 
416 //*****************************************************************************
417 // \name Return values from calling SysCtrlResetSourceGet()
418 //@{
419 //*****************************************************************************
420 #define RSTSRC_PWR_ON                 (( AON_PMCTL_RESETCTL_RESET_SRC_PWR_ON    ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
421 #define RSTSRC_PIN_RESET              (( AON_PMCTL_RESETCTL_RESET_SRC_PIN_RESET ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
422 #define RSTSRC_VDDS_LOSS              (( AON_PMCTL_RESETCTL_RESET_SRC_VDDS_LOSS ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
423 #define RSTSRC_VDDR_LOSS              (( AON_PMCTL_RESETCTL_RESET_SRC_VDDR_LOSS ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
424 #define RSTSRC_CLK_LOSS               (( AON_PMCTL_RESETCTL_RESET_SRC_CLK_LOSS  ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
425 #define RSTSRC_SYSRESET               (( AON_PMCTL_RESETCTL_RESET_SRC_SYSRESET  ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
426 #define RSTSRC_WARMRESET              (( AON_PMCTL_RESETCTL_RESET_SRC_WARMRESET ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S ))
427 #define RSTSRC_WAKEUP_FROM_SHUTDOWN  ((( AON_PMCTL_RESETCTL_RESET_SRC_M         ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S )) + 1 )
428 #define RSTSRC_WAKEUP_FROM_TCK_NOISE ((( AON_PMCTL_RESETCTL_RESET_SRC_M         ) >> ( AON_PMCTL_RESETCTL_RESET_SRC_S )) + 2 )
429 //@}
430 
431 //*****************************************************************************
432 //
433 //! \brief Returns the reset source (including "wakeup from shutdown").
434 //!
435 //! In case of \ref RSTSRC_WAKEUP_FROM_SHUTDOWN the application is
436 //! responsible for unlatching the outputs (disable pad sleep).
437 //! See \ref PowerCtrlPadSleepDisable() for more information.
438 //!
439 //! \return Returns the reset source.
440 //! - \ref RSTSRC_PWR_ON
441 //! - \ref RSTSRC_PIN_RESET
442 //! - \ref RSTSRC_VDDS_LOSS
443 //! - \ref RSTSRC_VDDR_LOSS
444 //! - \ref RSTSRC_CLK_LOSS
445 //! - \ref RSTSRC_SYSRESET
446 //! - \ref RSTSRC_WARMRESET
447 //! - \ref RSTSRC_WAKEUP_FROM_SHUTDOWN
448 //! - \ref RSTSRC_WAKEUP_FROM_TCK_NOISE
449 //
450 //*****************************************************************************
451 extern uint32_t SysCtrlResetSourceGet( void );
452 
453 //*****************************************************************************
454 //
455 //! \brief Perform a full system reset.
456 //!
457 //! \return The chip will reset and hence never return from this call.
458 //
459 //*****************************************************************************
460 __STATIC_INLINE void
SysCtrlSystemReset(void)461 SysCtrlSystemReset( void )
462 {
463    // Disable CPU interrupts
464    CPUcpsid();
465    // Write reset register
466    HWREGBITW( AON_PMCTL_BASE + AON_PMCTL_O_RESETCTL, AON_PMCTL_RESETCTL_SYSRESET_BITN ) = 1;
467    // Finally, wait until the above write propagates
468    while ( 1 ) {
469       // Do nothing, just wait for the reset (and never return from here)
470    }
471 }
472 
473 //*****************************************************************************
474 //
475 //! \brief Enables reset if OSC clock loss event is asserted.
476 //!
477 //! Clock loss circuit in analog domain must be enabled as well in order to
478 //! actually enable for a clock loss reset to occur
479 //! \ref OSCClockLossEventEnable().
480 //!
481 //! \note This function shall typically not be called because the clock loss
482 //! reset functionality is controlled by the boot code (a factory configuration
483 //! defines whether it is set or not).
484 //!
485 //! \return None
486 //!
487 //! \sa \ref SysCtrlClockLossResetDisable(), \ref OSCClockLossEventEnable()
488 //
489 //*****************************************************************************
490 __STATIC_INLINE void
SysCtrlClockLossResetEnable(void)491 SysCtrlClockLossResetEnable(void)
492 {
493     // Set clock loss enable bit in AON_SYSCTRL
494     HWREGBITW(AON_PMCTL_BASE + AON_PMCTL_O_RESETCTL, AON_PMCTL_RESETCTL_CLK_LOSS_EN_BITN) = 1;
495 }
496 
497 //*****************************************************************************
498 //
499 //! \brief Disables reset due to OSC clock loss event.
500 //!
501 //! \note This function shall typically not be called because the clock loss
502 //! reset functionality is controlled by the boot code (a factory configuration
503 //! defines whether it is set or not).
504 //!
505 //! \return None
506 //!
507 //! \sa \ref SysCtrlClockLossResetEnable()
508 //
509 //*****************************************************************************
510 __STATIC_INLINE void
SysCtrlClockLossResetDisable(void)511 SysCtrlClockLossResetDisable(void)
512 {
513     // Clear clock loss enable bit in AON_SYSCTRL
514     HWREGBITW(AON_PMCTL_BASE + AON_PMCTL_O_RESETCTL, AON_PMCTL_RESETCTL_CLK_LOSS_EN_BITN) = 0;
515 }
516 
517 //*****************************************************************************
518 //
519 // Support for DriverLib in ROM:
520 // Redirect to implementation in ROM when available.
521 //
522 //*****************************************************************************
523 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
524     #include "../driverlib/rom.h"
525     #ifdef ROM_SysCtrlIdle
526         #undef  SysCtrlIdle
527         #define SysCtrlIdle                     ROM_SysCtrlIdle
528     #endif
529     #ifdef ROM_SysCtrlShutdownWithAbort
530         #undef  SysCtrlShutdownWithAbort
531         #define SysCtrlShutdownWithAbort        ROM_SysCtrlShutdownWithAbort
532     #endif
533     #ifdef ROM_SysCtrlShutdown
534         #undef  SysCtrlShutdown
535         #define SysCtrlShutdown                 ROM_SysCtrlShutdown
536     #endif
537     #ifdef ROM_SysCtrlStandby
538         #undef  SysCtrlStandby
539         #define SysCtrlStandby                  ROM_SysCtrlStandby
540     #endif
541     #ifdef ROM_SysCtrlSetRechargeBeforePowerDown
542         #undef  SysCtrlSetRechargeBeforePowerDown
543         #define SysCtrlSetRechargeBeforePowerDown ROM_SysCtrlSetRechargeBeforePowerDown
544     #endif
545     #ifdef ROM_SysCtrlAdjustRechargeAfterPowerDown
546         #undef  SysCtrlAdjustRechargeAfterPowerDown
547         #define SysCtrlAdjustRechargeAfterPowerDown ROM_SysCtrlAdjustRechargeAfterPowerDown
548     #endif
549     #ifdef ROM_SysCtrl_DCDC_VoltageConditionalControl
550         #undef  SysCtrl_DCDC_VoltageConditionalControl
551         #define SysCtrl_DCDC_VoltageConditionalControl ROM_SysCtrl_DCDC_VoltageConditionalControl
552     #endif
553     #ifdef ROM_SysCtrlResetSourceGet
554         #undef  SysCtrlResetSourceGet
555         #define SysCtrlResetSourceGet           ROM_SysCtrlResetSourceGet
556     #endif
557 #endif
558 
559 //*****************************************************************************
560 //
561 // Mark the end of the C bindings section for C++ compilers.
562 //
563 //*****************************************************************************
564 #ifdef __cplusplus
565 }
566 #endif
567 
568 #endif //  __SYSCTRL_H__
569 
570 //*****************************************************************************
571 //
572 //! Close the Doxygen group.
573 //! @}
574 //! @}
575 //
576 //*****************************************************************************
577