2 * -------------------------------------------
3 * MSP432 DriverLib - v3_10_00_09
4 * -------------------------------------------
6 * --COPYRIGHT--,BSD,BSD
7 * Copyright (c) 2014, Texas Instruments Incorporated
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
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.
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.
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.
40 //*****************************************************************************
42 //! \addtogroup reset_api
45 //*****************************************************************************
47 //*****************************************************************************
49 // If building with a C++ compiler, make all of the definitions in this header
52 //*****************************************************************************
61 //*****************************************************************************
63 // Control specific variables
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
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
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
91 #define RESET_LPM35 RSTCTL_PCMRESET_CLR_LPM35
92 #define RESET_LPM45 RSTCTL_PCMRESET_CLR_LPM45
94 //*****************************************************************************
96 // Prototypes for the APIs.
98 //*****************************************************************************
100 //*****************************************************************************
102 //! Initiates a soft system reset.
106 //*****************************************************************************
107 extern void ResetCtl_initiateSoftReset(void);
109 //*****************************************************************************
111 //! Initiates a soft system reset with a particular source given. This source
112 //! is generic and can be assigned by the user.
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
134 //*****************************************************************************
135 extern void ResetCtl_initiateSoftResetWithSource(uint32_t source);
137 //*****************************************************************************
139 //! Retrieves previous soft reset sources
141 //! \return the bitwise or of previous reset sources. These sources must be
142 //! cleared using the \link ResetCtl_clearSoftResetSource \endlink function to
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
162 //*****************************************************************************
163 extern uint32_t ResetCtl_getSoftResetSource(void);
165 //*****************************************************************************
167 //! Clears the reset sources associated with at soft reset
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
189 //*****************************************************************************
190 extern void ResetCtl_clearSoftResetSource(uint32_t mask);
192 //*****************************************************************************
194 //! Initiates a hard system reset.
198 //*****************************************************************************
199 extern void ResetCtl_initiateHardReset(void);
201 //*****************************************************************************
203 //! Initiates a hard system reset with a particular source given. This source
204 //! is generic and can be assigned by the user.
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
225 //*****************************************************************************
226 extern void ResetCtl_initiateHardResetWithSource(uint32_t source);
228 //*****************************************************************************
230 //! Retrieves previous hard reset sources
232 //! \return the bitwise or of previous reset sources. These sources must be
233 //! cleared using the \link ResetCtl_clearHardResetSource \endlink function to
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
253 //*****************************************************************************
254 extern uint32_t ResetCtl_getHardResetSource(void);
256 //*****************************************************************************
258 //! Clears the reset sources associated with at hard reset
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
280 //*****************************************************************************
281 extern void ResetCtl_clearHardResetSource(uint32_t mask);
283 //*****************************************************************************
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.
290 //! \return Bitwise OR of any of the following values:
292 //! - RESET_SVSH_TRIP,
293 //! - RESET_BGREF_BAD
295 //*****************************************************************************
296 extern uint32_t ResetCtl_getPSSSource(void);
298 //*****************************************************************************
300 //! Clears the PSS reset source flags
304 //*****************************************************************************
305 extern void ResetCtl_clearPSSFlags(void);
307 //*****************************************************************************
309 //! Indicates the last cause of a power-on reset (POR) due to PCM operation.
311 //! \return Bitwise OR of any of the following values:
315 //*****************************************************************************
316 extern uint32_t ResetCtl_getPCMSource(void);
318 //*****************************************************************************
320 //! Clears the corresponding PCM reset source flags
324 //*****************************************************************************
325 extern void ResetCtl_clearPCMFlags(void);
327 //*****************************************************************************
329 // Mark the end of the C bindings section for C++ compilers.
331 //*****************************************************************************
336 //*****************************************************************************
338 // Close the Doxygen group.
341 //*****************************************************************************
343 #endif // __RESET_H__