2 * -------------------------------------------
3 * MSP432 DriverLib - v01_04_00_18
4 * -------------------------------------------
6 * --COPYRIGHT--,BSD,BSD
7 * Copyright (c) 2015, 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_SVSL_TRIP RSTCTL_PSSRESET_CLR_SVSL
90 #define RESET_BGREF_BAD RSTCTL_PSSRESET_CLR_BGREF
92 #define RESET_SD0 RSTCTL_PCMRESET_CLR_LPM35
93 #define RESET_SD1 RSTCTL_PCMRESET_CLR_LPM45
95 //*****************************************************************************
97 // Prototypes for the APIs.
99 //*****************************************************************************
101 //*****************************************************************************
103 //! Initiates a soft system reset.
107 //*****************************************************************************
108 extern void ResetCtl_initiateSoftReset(void);
110 //*****************************************************************************
112 //! Initiates a soft system reset with a particular source given. This source
113 //! is generic and can be assigned by the user.
115 //! \param source Source of the reset. Valid values are:
116 //! - \b RESET_SRC_0,
117 //! - \b RESET_SRC_1,
118 //! - \b RESET_SRC_2,
119 //! - \b RESET_SRC_3,
120 //! - \b RESET_SRC_4,
121 //! - \b RESET_SRC_5,
122 //! - \b RESET_SRC_6,
123 //! - \b RESET_SRC_7,
124 //! - \b RESET_SRC_8,
125 //! - \b RESET_SRC_9,
126 //! - \b RESET_SRC_10,
127 //! - \b RESET_SRC_11,
128 //! - \b RESET_SRC_12,
129 //! - \b RESET_SRC_13,
130 //! - \b RESET_SRC_14,
131 //! - \b RESET_SRC_15
135 //*****************************************************************************
136 extern void ResetCtl_initiateSoftResetWithSource(uint32_t source);
138 //*****************************************************************************
140 //! Retrieves previous soft reset sources
142 //! \return the bitwise or of previous reset sources. These sources must be
143 //! cleared using the \link ResetCtl_clearSoftResetSource \endlink function to
145 //! Possible values include:
146 //! - \b RESET_SRC_0,
147 //! - \b RESET_SRC_1,
148 //! - \b RESET_SRC_2,
149 //! - \b RESET_SRC_3,
150 //! - \b RESET_SRC_4,
151 //! - \b RESET_SRC_5,
152 //! - \b RESET_SRC_6,
153 //! - \b RESET_SRC_7,
154 //! - \b RESET_SRC_8,
155 //! - \b RESET_SRC_9,
156 //! - \b RESET_SRC_10,
157 //! - \b RESET_SRC_11,
158 //! - \b RESET_SRC_12,
159 //! - \b RESET_SRC_13,
160 //! - \b RESET_SRC_14,
161 //! - \b RESET_SRC_15
163 //*****************************************************************************
164 extern uint32_t ResetCtl_getSoftResetSource(void);
166 //*****************************************************************************
168 //! Clears the reset sources associated with at soft reset
170 //! \param mask - Bitwise OR of any of the following values:
171 //! - \b RESET_SRC_0,
172 //! - \b RESET_SRC_1,
173 //! - \b RESET_SRC_2,
174 //! - \b RESET_SRC_3,
175 //! - \b RESET_SRC_4,
176 //! - \b RESET_SRC_5,
177 //! - \b RESET_SRC_6,
178 //! - \b RESET_SRC_7,
179 //! - \b RESET_SRC_8,
180 //! - \b RESET_SRC_9,
181 //! - \b RESET_SRC_10,
182 //! - \b RESET_SRC_11,
183 //! - \b RESET_SRC_12,
184 //! - \b RESET_SRC_13,
185 //! - \b RESET_SRC_14,
186 //! - \b RESET_SRC_15
190 //*****************************************************************************
191 extern void ResetCtl_clearSoftResetSource(uint32_t mask);
193 //*****************************************************************************
195 //! Initiates a hard system reset.
199 //*****************************************************************************
200 extern void ResetCtl_initiateHardReset(void);
202 //*****************************************************************************
204 //! Initiates a hard system reset with a particular source given. This source
205 //! is generic and can be assigned by the user.
207 //! \param source - Valid values are one the following values:
208 //! - \b RESET_SRC_0,
209 //! - \b RESET_SRC_1,
210 //! - \b RESET_SRC_2,
211 //! - \b RESET_SRC_3,
212 //! - \b RESET_SRC_4,
213 //! - \b RESET_SRC_5,
214 //! - \b RESET_SRC_6,
215 //! - \b RESET_SRC_7,
216 //! - \b RESET_SRC_8,
217 //! - \b RESET_SRC_9,
218 //! - \b RESET_SRC_10,
219 //! - \b RESET_SRC_11,
220 //! - \b RESET_SRC_12,
221 //! - \b RESET_SRC_13,
222 //! - \b RESET_SRC_14,
223 //! - \b RESET_SRC_15
226 //*****************************************************************************
227 extern void ResetCtl_initiateHardResetWithSource(uint32_t source);
229 //*****************************************************************************
231 //! Retrieves previous hard reset sources
233 //! \return the bitwise or of previous reset sources. These sources must be
234 //! cleared using the \link ResetCtl_clearHardResetSource \endlink function to
236 //! Possible values include:
237 //! - \b RESET_SRC_0,
238 //! - \b RESET_SRC_1,
239 //! - \b RESET_SRC_2,
240 //! - \b RESET_SRC_3,
241 //! - \b RESET_SRC_4,
242 //! - \b RESET_SRC_5,
243 //! - \b RESET_SRC_6,
244 //! - \b RESET_SRC_7,
245 //! - \b RESET_SRC_8,
246 //! - \b RESET_SRC_9,
247 //! - \b RESET_SRC_10,
248 //! - \b RESET_SRC_11,
249 //! - \b RESET_SRC_12,
250 //! - \b RESET_SRC_13,
251 //! - \b RESET_SRC_14,
252 //! - \b RESET_SRC_15
254 //*****************************************************************************
255 extern uint32_t ResetCtl_getHardResetSource(void);
257 //*****************************************************************************
259 //! Clears the reset sources associated with at hard reset
261 //! \param mask - Bitwise OR of any of the following values:
262 //! - \b RESET_SRC_0,
263 //! - \b RESET_SRC_1,
264 //! - \b RESET_SRC_2,
265 //! - \b RESET_SRC_3,
266 //! - \b RESET_SRC_4,
267 //! - \b RESET_SRC_5,
268 //! - \b RESET_SRC_6,
269 //! - \b RESET_SRC_7,
270 //! - \b RESET_SRC_8,
271 //! - \b RESET_SRC_9,
272 //! - \b RESET_SRC_10,
273 //! - \b RESET_SRC_11,
274 //! - \b RESET_SRC_12,
275 //! - \b RESET_SRC_13,
276 //! - \b RESET_SRC_14,
277 //! - \b RESET_SRC_15
281 //*****************************************************************************
282 extern void ResetCtl_clearHardResetSource(uint32_t mask);
284 //*****************************************************************************
286 //! Indicates the last cause of a power-on reset (POR) due to PSS operation.
287 //! Note that the bits returned from this function may be set in different
288 //! combinations. When a cold power up occurs, the value of all the values ORed
289 //! together could be returned as a cold power up causes these conditions.
291 //! \return Bitwise OR of any of the following values:
293 //! - RESET_SVSH_TRIP,
294 //! - RESET_SVSL_TRIP,
295 //! - RESET_BGREF_BAD
297 //*****************************************************************************
298 extern uint32_t ResetCtl_getPSSSource(void);
300 //*****************************************************************************
302 //! Clears the PSS reset source flags
306 //*****************************************************************************
307 extern void ResetCtl_clearPSSFlags(void);
309 //*****************************************************************************
311 //! Indicates the last cause of a power-on reset (POR) due to PCM operation.
313 //! \return Bitwise OR of any of the following values:
317 //*****************************************************************************
318 extern uint32_t ResetCtl_getPCMSource(void);
320 //*****************************************************************************
322 //! Clears the corresponding PCM reset source flags
326 //*****************************************************************************
327 extern void ResetCtl_clearPCMFlags(void);
329 //*****************************************************************************
331 // Mark the end of the C bindings section for C++ compilers.
333 //*****************************************************************************
338 //*****************************************************************************
340 // Close the Doxygen group.
343 //*****************************************************************************
345 #endif // __RESET_H__