1 /**
2  * \file
3  *
4  * \brief Reset related functionality declaration.
5  *
6  * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
7  *
8  * \asf_license_start
9  *
10  * \page License
11  *
12  * Subject to your compliance with these terms, you may use Microchip
13  * software and any derivatives exclusively with Microchip products.
14  * It is your responsibility to comply with third party license terms applicable
15  * to your use of third party software (including open source software) that
16  * may accompany Microchip software.
17  *
18  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19  * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20  * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21  * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22  * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23  * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24  * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25  * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.  TO THE FULLEST EXTENT
26  * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27  * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28  * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29  *
30  * \asf_license_stop
31  *
32  */
33 
34 #ifndef _HPL_RESET_H_INCLUDED
35 #define _HPL_RESET_H_INCLUDED
36 
37 /**
38  * \addtogroup HPL Reset
39  *
40  * \section hpl_reset_rev Revision History
41  * - v1.0.0 Initial Release
42  *
43  *@{
44  */
45 
46 #ifndef _UNIT_TEST_
47 #include <compiler.h>
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /**
55  * \brief Reset reason enumeration
56  *
57  * The list of possible reset reasons.
58  */
59 enum reset_reason {
60 	RESET_REASON_POR    = 1,
61 	RESET_REASON_BOD12  = 2,
62 	RESET_REASON_BOD33  = 4,
63 	RESET_REASON_NVM    = 8,
64 	RESET_REASON_EXT    = 16,
65 	RESET_REASON_WDT    = 32,
66 	RESET_REASON_SYST   = 64,
67 	RESET_REASON_BACKUP = 128
68 };
69 
70 /**
71  * \name HPL functions
72  */
73 //@{
74 /**
75  * \brief Retrieve the reset reason
76  *
77  * Retrieves the reset reason of the last MCU reset.
78  *
79  *\return An enum value indicating the reason of the last reset.
80  */
81 enum reset_reason _get_reset_reason(void);
82 
83 /**
84  * \brief Reset MCU
85  */
86 void _reset_mcu(void);
87 //@}
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 /**@}*/
93 #endif /* _HPL_RESET_H_INCLUDED */
94