Tiva Driver Lib
hibernate.h
1 //*****************************************************************************
2 //
3 // hibernate.h - API definition for the Hibernation module.
4 //
5 // Copyright (c) 2007-2013 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the
18 // distribution.
19 //
20 // Neither the name of Texas Instruments Incorporated nor the names of
21 // its contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 //
36 // This is part of revision 1.1 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 #ifndef __DRIVERLIB_HIBERNATE_H__
41 #define __DRIVERLIB_HIBERNATE_H__
42 
43 //*****************************************************************************
44 //
45 // If building with a C++ compiler, make all of the definitions in this header
46 // have a C binding.
47 //
48 //*****************************************************************************
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 //*****************************************************************************
55 //
56 // Macros need to configure wake events for HibernateWakeSet()
57 //
58 //*****************************************************************************
59 #define HIBERNATE_WAKE_PIN 0x00000010
60 #define HIBERNATE_WAKE_RTC 0x00000008
61 #define HIBERNATE_WAKE_LOW_BAT 0x00000200
62 
63 //*****************************************************************************
64 //
65 // Macros needed to configure low battery detect for HibernateLowBatSet()
66 //
67 //*****************************************************************************
68 #define HIBERNATE_LOW_BAT_DETECT \
69  0x00000020
70 #define HIBERNATE_LOW_BAT_ABORT 0x000000A0
71 #define HIBERNATE_LOW_BAT_1_9V 0x00000000
72 #define HIBERNATE_LOW_BAT_2_1V 0x00002000
73 #define HIBERNATE_LOW_BAT_2_3V 0x00004000
74 #define HIBERNATE_LOW_BAT_2_5V 0x00006000
75 
76 //*****************************************************************************
77 //
78 // Macros defining interrupt source bits for the interrupt functions.
79 //
80 //*****************************************************************************
81 #define HIBERNATE_INT_WR_COMPLETE \
82  0x00000010
83 #define HIBERNATE_INT_PIN_WAKE 0x00000008
84 #define HIBERNATE_INT_LOW_BAT 0x00000004
85 #define HIBERNATE_INT_RTC_MATCH_0 \
86  0x00000001
87 
88 //*****************************************************************************
89 //
90 // Macros defining oscillator configuration options for the
91 // HibernateClockConfig() function.
92 //
93 //*****************************************************************************
94 #define HIBERNATE_OSC_LOWDRIVE 0x00000000
95 #define HIBERNATE_OSC_HIGHDRIVE 0x00020000
96 #define HIBERNATE_OSC_DISABLE 0x00010000
97 
98 //*****************************************************************************
99 //
100 // API Function prototypes
101 //
102 //*****************************************************************************
103 extern void HibernateGPIORetentionEnable(void);
104 extern void HibernateGPIORetentionDisable(void);
105 extern bool HibernateGPIORetentionGet(void);
106 extern void HibernateEnableExpClk(uint32_t ui32HibClk);
107 extern void HibernateDisable(void);
108 extern void HibernateRTCEnable(void);
109 extern void HibernateRTCDisable(void);
110 extern void HibernateWakeSet(uint32_t ui32WakeFlags);
111 extern uint32_t HibernateWakeGet(void);
112 extern void HibernateLowBatSet(uint32_t ui32LowBatFlags);
113 extern uint32_t HibernateLowBatGet(void);
114 extern void HibernateRTCSet(uint32_t ui32RTCValue);
115 extern uint32_t HibernateRTCGet(void);
116 extern void HibernateRTCMatchSet(uint32_t ui32Match, uint32_t ui32Value);
117 extern uint32_t HibernateRTCMatchGet(uint32_t ui32Match);
118 extern void HibernateRTCTrimSet(uint32_t ui32Trim);
119 extern uint32_t HibernateRTCTrimGet(void);
120 extern void HibernateDataSet(uint32_t *pui32Data, uint32_t ui32Count);
121 extern void HibernateDataGet(uint32_t *pui32Data, uint32_t ui32Count);
122 extern void HibernateRequest(void);
123 extern void HibernateIntEnable(uint32_t ui32IntFlags);
124 extern void HibernateIntDisable(uint32_t ui32IntFlags);
125 extern void HibernateIntRegister(void (*pfnHandler)(void));
126 extern void HibernateIntUnregister(void);
127 extern uint32_t HibernateIntStatus(bool bMasked);
128 extern void HibernateIntClear(uint32_t ui32IntFlags);
129 extern uint32_t HibernateIsActive(void);
130 extern void HibernateRTCSSMatchSet(uint32_t ui32Match, uint32_t ui32Value);
131 extern uint32_t HibernateRTCSSMatchGet(uint32_t ui32Match);
132 extern uint32_t HibernateRTCSSGet(void);
133 extern void HibernateClockConfig(uint32_t ui32Config);
134 extern void HibernateBatCheckStart(void);
135 extern uint32_t HibernateBatCheckDone(void);
136 
137 //*****************************************************************************
138 //
139 // Mark the end of the C bindings section for C++ compilers.
140 //
141 //*****************************************************************************
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif // __DRIVERLIB_HIBERNATE_H__
uint32_t HibernateWakeGet(void)
Definition: hibernate.c:392
void HibernateRTCDisable(void)
Definition: hibernate.c:259
uint32_t HibernateIsActive(void)
Definition: hibernate.c:1140
void HibernateRTCSSMatchSet(uint32_t ui32Match, uint32_t ui32Value)
Definition: hibernate.c:601
void HibernateRequest(void)
Definition: hibernate.c:843
bool HibernateGPIORetentionGet(void)
Definition: hibernate.c:1228
void HibernateIntEnable(uint32_t ui32IntFlags)
Definition: hibernate.c:877
void HibernateIntDisable(uint32_t ui32IntFlags)
Definition: hibernate.c:913
void HibernateDataGet(uint32_t *pui32Data, uint32_t ui32Count)
Definition: hibernate.c:784
uint32_t HibernateIntStatus(bool bMasked)
Definition: hibernate.c:1057
uint32_t HibernateBatCheckDone(void)
Definition: hibernate.c:322
void HibernateGPIORetentionDisable(void)
Definition: hibernate.c:1199
void HibernateClockConfig(uint32_t ui32Config)
Definition: hibernate.c:188
void HibernateDisable(void)
Definition: hibernate.c:144
void HibernateRTCMatchSet(uint32_t ui32Match, uint32_t ui32Value)
Definition: hibernate.c:544
void HibernateIntUnregister(void)
Definition: hibernate.c:1019
uint32_t HibernateRTCTrimGet(void)
Definition: hibernate.c:711
void HibernateGPIORetentionEnable(void)
Definition: hibernate.c:1168
void HibernateRTCEnable(void)
Definition: hibernate.c:234
uint32_t HibernateRTCSSGet(void)
Definition: hibernate.c:654
void HibernateLowBatSet(uint32_t ui32LowBatFlags)
Definition: hibernate.c:438
void HibernateDataSet(uint32_t *pui32Data, uint32_t ui32Count)
Definition: hibernate.c:738
void HibernateWakeSet(uint32_t ui32WakeFlags)
Definition: hibernate.c:349
uint32_t HibernateRTCSSMatchGet(uint32_t ui32Match)
Definition: hibernate.c:631
uint32_t HibernateRTCGet(void)
Definition: hibernate.c:520
uint32_t HibernateRTCMatchGet(uint32_t ui32Match)
Definition: hibernate.c:573
uint32_t HibernateLowBatGet(void)
Definition: hibernate.c:474
void HibernateEnableExpClk(uint32_t ui32HibClk)
Definition: hibernate.c:120
void HibernateBatCheckStart(void)
Definition: hibernate.c:292
void HibernateRTCTrimSet(uint32_t ui32Trim)
Definition: hibernate.c:681
void HibernateIntRegister(void(*pfnHandler)(void))
Definition: hibernate.c:982
void HibernateRTCSet(uint32_t ui32RTCValue)
Definition: hibernate.c:497
void HibernateIntClear(uint32_t ui32IntFlags)
Definition: hibernate.c:1098