]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/reset.h
Update MSP432 projects to use updated driver library files.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / reset.h
1 /*
2  * -------------------------------------------
3  *    MSP432 DriverLib - v3_10_00_09 
4  * -------------------------------------------
5  *
6  * --COPYRIGHT--,BSD,BSD
7  * Copyright (c) 2014, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * *  Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  *
17  * *  Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * *  Neither the name of Texas Instruments Incorporated nor the names of
22  *    its contributors may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  * --/COPYRIGHT--*/
37 #ifndef __RESET_H__
38 #define __RESET_H__
39
40 //*****************************************************************************
41 //
42 //! \addtogroup reset_api
43 //! @{
44 //
45 //*****************************************************************************
46
47 //*****************************************************************************
48 //
49 // If building with a C++ compiler, make all of the definitions in this header
50 // have a C binding.
51 //
52 //*****************************************************************************
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57
58 #include <msp.h>
59 #include <stdint.h>
60
61 //*****************************************************************************
62 //
63 // Control specific variables 
64 //
65 //*****************************************************************************
66 #define RESET_KEY   0x6900
67 #define RESET_HARD_RESET RSTCTL_RESET_REQ_HARD_REQ
68 #define RESET_SOFT_RESET RSTCTL_RESET_REQ_SOFT_REQ
69
70 #define RESET_SRC_0 RSTCTL_HARDRESET_CLR_SRC0
71 #define RESET_SRC_1 RSTCTL_HARDRESET_CLR_SRC1
72 #define RESET_SRC_2 RSTCTL_HARDRESET_CLR_SRC2
73 #define RESET_SRC_3 RSTCTL_HARDRESET_CLR_SRC3
74 #define RESET_SRC_4 RSTCTL_HARDRESET_CLR_SRC4
75 #define RESET_SRC_5 RSTCTL_HARDRESET_CLR_SRC5
76 #define RESET_SRC_6 RSTCTL_HARDRESET_CLR_SRC6
77 #define RESET_SRC_7 RSTCTL_HARDRESET_CLR_SRC7
78 #define RESET_SRC_8 RSTCTL_HARDRESET_CLR_SRC8
79 #define RESET_SRC_9 RSTCTL_HARDRESET_CLR_SRC9
80 #define RESET_SRC_10 RSTCTL_HARDRESET_CLR_SRC10
81 #define RESET_SRC_11 RSTCTL_HARDRESET_CLR_SRC11
82 #define RESET_SRC_12 RSTCTL_HARDRESET_CLR_SRC12
83 #define RESET_SRC_13 RSTCTL_HARDRESET_CLR_SRC13
84 #define RESET_SRC_14 RSTCTL_HARDRESET_CLR_SRC14
85 #define RESET_SRC_15 RSTCTL_HARDRESET_CLR_SRC15
86
87 #define RESET_VCCDET    RSTCTL_PSSRESET_CLR_BGREF
88 #define RESET_SVSH_TRIP RSTCTL_PSSRESET_CLR_SVSMH
89 #define RESET_BGREF_BAD RSTCTL_PSSRESET_CLR_BGREF
90
91 #define RESET_LPM35   RSTCTL_PCMRESET_CLR_LPM35
92 #define RESET_LPM45   RSTCTL_PCMRESET_CLR_LPM45
93
94 //*****************************************************************************
95 //
96 // Prototypes for the APIs.
97 //
98 //*****************************************************************************
99
100 //*****************************************************************************
101 //
102 //! Initiates a soft system reset.
103 //!
104 //! \return none
105 //
106 //*****************************************************************************
107 extern void ResetCtl_initiateSoftReset(void);
108
109 //*****************************************************************************
110 //
111 //! Initiates a soft system reset with a particular source given. This source
112 //! is generic and can be assigned by the user.
113 //!
114 //! \param source Source of the reset. Valid values are:
115 //!             - \b RESET_SRC_0,
116 //!             - \b RESET_SRC_1,
117 //!             - \b RESET_SRC_2,
118 //!             - \b RESET_SRC_3,
119 //!             - \b RESET_SRC_4,
120 //!             - \b RESET_SRC_5,
121 //!             - \b RESET_SRC_6,
122 //!             - \b RESET_SRC_7,
123 //!             - \b RESET_SRC_8,
124 //!             - \b RESET_SRC_9,
125 //!             - \b RESET_SRC_10,
126 //!             - \b RESET_SRC_11,
127 //!             - \b RESET_SRC_12,
128 //!             - \b RESET_SRC_13,
129 //!             - \b RESET_SRC_14,
130 //!             - \b RESET_SRC_15
131 //!
132 //! \return none
133 //
134 //*****************************************************************************
135 extern void ResetCtl_initiateSoftResetWithSource(uint32_t source);
136
137 //*****************************************************************************
138 //
139 //! Retrieves previous soft reset sources
140 //!
141 //! \return the bitwise or of previous reset sources. These sources must be
142 //! cleared using the \link ResetCtl_clearSoftResetSource \endlink function to
143 //! be cleared.
144 //! Possible values include:
145 //!             - \b RESET_SRC_0,
146 //!             - \b RESET_SRC_1,
147 //!             - \b RESET_SRC_2,
148 //!             - \b RESET_SRC_3,
149 //!             - \b RESET_SRC_4,
150 //!             - \b RESET_SRC_5,
151 //!             - \b RESET_SRC_6,
152 //!             - \b RESET_SRC_7,
153 //!             - \b RESET_SRC_8,
154 //!             - \b RESET_SRC_9,
155 //!             - \b RESET_SRC_10,
156 //!             - \b RESET_SRC_11,
157 //!             - \b RESET_SRC_12,
158 //!             - \b RESET_SRC_13,
159 //!             - \b RESET_SRC_14,
160 //!             - \b RESET_SRC_15
161 //
162 //*****************************************************************************
163 extern uint32_t ResetCtl_getSoftResetSource(void);
164
165 //*****************************************************************************
166 //
167 //! Clears the reset sources associated with at soft reset
168 //!
169 //! \param mask - Bitwise OR of any of the following values:
170 //!             - \b RESET_SRC_0,
171 //!             - \b RESET_SRC_1,
172 //!             - \b RESET_SRC_2,
173 //!             - \b RESET_SRC_3,
174 //!             - \b RESET_SRC_4,
175 //!             - \b RESET_SRC_5,
176 //!             - \b RESET_SRC_6,
177 //!             - \b RESET_SRC_7,
178 //!             - \b RESET_SRC_8,
179 //!             - \b RESET_SRC_9,
180 //!             - \b RESET_SRC_10,
181 //!             - \b RESET_SRC_11,
182 //!             - \b RESET_SRC_12,
183 //!             - \b RESET_SRC_13,
184 //!             - \b RESET_SRC_14,
185 //!             - \b RESET_SRC_15
186 //!
187 //! \return none
188 //
189 //*****************************************************************************
190 extern void ResetCtl_clearSoftResetSource(uint32_t mask);
191
192 //*****************************************************************************
193 //
194 //! Initiates a hard system reset.
195 //!
196 //! \return none
197 //
198 //*****************************************************************************
199 extern void ResetCtl_initiateHardReset(void);
200
201 //*****************************************************************************
202 //
203 //! Initiates a hard system reset with a particular source given. This source
204 //! is generic and can be assigned by the user.
205 //!
206 //! \param source - Valid values are one the following values:
207 //!             - \b RESET_SRC_0,
208 //!             - \b RESET_SRC_1,
209 //!             - \b RESET_SRC_2,
210 //!             - \b RESET_SRC_3,
211 //!             - \b RESET_SRC_4,
212 //!             - \b RESET_SRC_5,
213 //!             - \b RESET_SRC_6,
214 //!             - \b RESET_SRC_7,
215 //!             - \b RESET_SRC_8,
216 //!             - \b RESET_SRC_9,
217 //!             - \b RESET_SRC_10,
218 //!             - \b RESET_SRC_11,
219 //!             - \b RESET_SRC_12,
220 //!             - \b RESET_SRC_13,
221 //!             - \b RESET_SRC_14,
222 //!             - \b RESET_SRC_15
223 //! \return none
224 //
225 //*****************************************************************************
226 extern void ResetCtl_initiateHardResetWithSource(uint32_t source);
227
228 //*****************************************************************************
229 //
230 //! Retrieves previous hard reset sources
231 //!
232 //! \return the bitwise or of previous reset sources. These sources must be
233 //! cleared using the \link ResetCtl_clearHardResetSource \endlink function to
234 //! be cleared.
235 //! Possible values include:
236 //!             - \b RESET_SRC_0,
237 //!             - \b RESET_SRC_1,
238 //!             - \b RESET_SRC_2,
239 //!             - \b RESET_SRC_3,
240 //!             - \b RESET_SRC_4,
241 //!             - \b RESET_SRC_5,
242 //!             - \b RESET_SRC_6,
243 //!             - \b RESET_SRC_7,
244 //!             - \b RESET_SRC_8,
245 //!             - \b RESET_SRC_9,
246 //!             - \b RESET_SRC_10,
247 //!             - \b RESET_SRC_11,
248 //!             - \b RESET_SRC_12,
249 //!             - \b RESET_SRC_13,
250 //!             - \b RESET_SRC_14,
251 //!             - \b RESET_SRC_15
252 //
253 //*****************************************************************************
254 extern uint32_t ResetCtl_getHardResetSource(void);
255
256 //*****************************************************************************
257 //
258 //! Clears the reset sources associated with at hard reset
259 //!
260 //! \param mask - Bitwise OR of any of the following values:
261 //!             - \b RESET_SRC_0,
262 //!             - \b RESET_SRC_1,
263 //!             - \b RESET_SRC_2,
264 //!             - \b RESET_SRC_3,
265 //!             - \b RESET_SRC_4,
266 //!             - \b RESET_SRC_5,
267 //!             - \b RESET_SRC_6,
268 //!             - \b RESET_SRC_7,
269 //!             - \b RESET_SRC_8,
270 //!             - \b RESET_SRC_9,
271 //!             - \b RESET_SRC_10,
272 //!             - \b RESET_SRC_11,
273 //!             - \b RESET_SRC_12,
274 //!             - \b RESET_SRC_13,
275 //!             - \b RESET_SRC_14,
276 //!             - \b RESET_SRC_15
277 //!
278 //! \return none
279 //
280 //*****************************************************************************
281 extern void ResetCtl_clearHardResetSource(uint32_t mask);
282
283 //*****************************************************************************
284 //
285 //! Indicates the last cause of a power-on reset (POR) due to PSS operation.
286 //! Note that the bits returned from this function may be set in different
287 //! combinations. When a cold power up occurs, the value of all the values ORed
288 //! together could be returned as a cold power up causes these conditions.
289 //!
290 //! \return  Bitwise OR of any of the following values:
291 //!                 - RESET_VCCDET,
292 //!                 - RESET_SVSH_TRIP,
293 //!                 - RESET_BGREF_BAD
294 //
295 //*****************************************************************************
296 extern uint32_t ResetCtl_getPSSSource(void);
297
298 //*****************************************************************************
299 //
300 //! Clears the  PSS reset source flags
301 //!
302 //! \return none
303 //
304 //*****************************************************************************
305 extern void ResetCtl_clearPSSFlags(void);
306
307 //*****************************************************************************
308 //
309 //! Indicates the last cause of a power-on reset (POR) due to PCM operation.
310 //!
311 //! \return  Bitwise OR of any of the following values:
312 //!                 - RESET_LPM35,
313 //!                 - RESET_LPM45
314 //
315 //*****************************************************************************
316 extern uint32_t ResetCtl_getPCMSource(void);
317
318 //*****************************************************************************
319 //
320 //! Clears the corresponding PCM reset source flags
321 //!
322 //! \return none
323 //
324 //*****************************************************************************
325 extern void ResetCtl_clearPCMFlags(void);
326
327 //*****************************************************************************
328 //
329 // Mark the end of the C bindings section for C++ compilers.
330 //
331 //*****************************************************************************
332 #ifdef __cplusplus
333 }
334 #endif
335
336 //*****************************************************************************
337 //
338 // Close the Doxygen group.
339 //! @}
340 //
341 //*****************************************************************************
342
343 #endif // __RESET_H__