reset.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef __RESET_H__
33 #define __RESET_H__
34 
35 //*****************************************************************************
36 //
39 //
40 //*****************************************************************************
41 
42 //*****************************************************************************
43 //
44 // If building with a C++ compiler, make all of the definitions in this header
45 // have a C binding.
46 //
47 //*****************************************************************************
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52 
53 #include <ti/devices/msp432p4xx/inc/msp.h>
54 #include <stdint.h>
55 
56 //*****************************************************************************
57 //
58 // Control specific variables
59 //
60 //*****************************************************************************
61 #define RESET_KEY 0x6900
62 #define RESET_HARD_RESET RSTCTL_RESET_REQ_HARD_REQ
63 #define RESET_SOFT_RESET RSTCTL_RESET_REQ_SOFT_REQ
64 
65 #define RESET_SRC_0 RSTCTL_HARDRESET_CLR_SRC0
66 #define RESET_SRC_1 RSTCTL_HARDRESET_CLR_SRC1
67 #define RESET_SRC_2 RSTCTL_HARDRESET_CLR_SRC2
68 #define RESET_SRC_3 RSTCTL_HARDRESET_CLR_SRC3
69 #define RESET_SRC_4 RSTCTL_HARDRESET_CLR_SRC4
70 #define RESET_SRC_5 RSTCTL_HARDRESET_CLR_SRC5
71 #define RESET_SRC_6 RSTCTL_HARDRESET_CLR_SRC6
72 #define RESET_SRC_7 RSTCTL_HARDRESET_CLR_SRC7
73 #define RESET_SRC_8 RSTCTL_HARDRESET_CLR_SRC8
74 #define RESET_SRC_9 RSTCTL_HARDRESET_CLR_SRC9
75 #define RESET_SRC_10 RSTCTL_HARDRESET_CLR_SRC10
76 #define RESET_SRC_11 RSTCTL_HARDRESET_CLR_SRC11
77 #define RESET_SRC_12 RSTCTL_HARDRESET_CLR_SRC12
78 #define RESET_SRC_13 RSTCTL_HARDRESET_CLR_SRC13
79 #define RESET_SRC_14 RSTCTL_HARDRESET_CLR_SRC14
80 #define RESET_SRC_15 RSTCTL_HARDRESET_CLR_SRC15
81 
82 #define RESET_VCCDET RSTCTL_PSSRESET_STAT_VCCDET
83 #define RESET_SVSH_TRIP RSTCTL_PSSRESET_STAT_SVSMH
84 #define RESET_BGREF_BAD RSTCTL_PSSRESET_STAT_BGREF
85 
86 #define RESET_LPM35 RSTCTL_PCMRESET_STAT_LPM35
87 #define RESET_LPM45 RSTCTL_PCMRESET_STAT_LPM45
88 
89 //*****************************************************************************
90 //
91 // Prototypes for the APIs.
92 //
93 //*****************************************************************************
94 
95 //*****************************************************************************
96 //
100 //
101 //*****************************************************************************
102 extern void ResetCtl_initiateSoftReset(void);
103 
104 //*****************************************************************************
105 //
128 //
129 //*****************************************************************************
130 extern void ResetCtl_initiateSoftResetWithSource(uint32_t source);
131 
132 //*****************************************************************************
133 //
156 //
157 //*****************************************************************************
158 extern uint32_t ResetCtl_getSoftResetSource(void);
159 
160 //*****************************************************************************
161 //
183 //
184 //*****************************************************************************
185 extern void ResetCtl_clearSoftResetSource(uint32_t mask);
186 
187 //*****************************************************************************
188 //
192 //
193 //*****************************************************************************
194 extern void ResetCtl_initiateHardReset(void);
195 
196 //*****************************************************************************
197 //
219 //
220 //*****************************************************************************
221 extern void ResetCtl_initiateHardResetWithSource(uint32_t source);
222 
223 //*****************************************************************************
224 //
247 //
248 //*****************************************************************************
249 extern uint32_t ResetCtl_getHardResetSource(void);
250 
251 //*****************************************************************************
252 //
274 //
275 //*****************************************************************************
276 extern void ResetCtl_clearHardResetSource(uint32_t mask);
277 
278 //*****************************************************************************
279 //
289 //
290 //*****************************************************************************
291 extern uint32_t ResetCtl_getPSSSource(void);
292 
293 //*****************************************************************************
294 //
298 //
299 //*****************************************************************************
300 extern void ResetCtl_clearPSSFlags(void);
301 
302 //*****************************************************************************
303 //
309 //
310 //*****************************************************************************
311 extern uint32_t ResetCtl_getPCMSource(void);
312 
313 //*****************************************************************************
314 //
318 //
319 //*****************************************************************************
320 extern void ResetCtl_clearPCMFlags(void);
321 
322 //*****************************************************************************
323 //
324 // Mark the end of the C bindings section for C++ compilers.
325 //
326 //*****************************************************************************
327 #ifdef __cplusplus
328 }
329 #endif
330 
331 //*****************************************************************************
332 //
333 // Close the Doxygen group.
335 //
336 //*****************************************************************************
337 
338 #endif // __RESET_H__
void ResetCtl_clearSoftResetSource(uint32_t mask)
Definition: reset.c:50
void ResetCtl_clearHardResetSource(uint32_t mask)
Definition: reset.c:70
uint32_t ResetCtl_getHardResetSource(void)
Definition: reset.c:65
void ResetCtl_initiateSoftResetWithSource(uint32_t source)
Definition: reset.c:40
void ResetCtl_initiateHardReset(void)
Definition: reset.c:55
uint32_t ResetCtl_getPCMSource(void)
Definition: reset.c:85
uint32_t ResetCtl_getSoftResetSource(void)
Definition: reset.c:45
void ResetCtl_initiateHardResetWithSource(uint32_t source)
Definition: reset.c:60
void ResetCtl_clearPSSFlags(void)
Definition: reset.c:80
void ResetCtl_initiateSoftReset(void)
Definition: reset.c:35
uint32_t ResetCtl_getPSSSource(void)
Definition: reset.c:75
void ResetCtl_clearPCMFlags(void)
Definition: reset.c:90

Copyright 2018, Texas Instruments Incorporated