00001 /****************************************************************************/ 00018 #ifndef _RESETREASON_H 00019 #define _RESETREASON_H 00020 00021 // \cond 00022 /****************************************************************************** 00023 Define(s) section 00024 ******************************************************************************/ 00025 #define TEMP_WARM_RESET 0x12 00026 // \endcond 00027 00028 /****************************************************************************** 00029 Types section 00030 ******************************************************************************/ 00032 #if defined(AT91SAM7X256) 00033 typedef enum 00034 { 00036 POWER_ON_RESET = 0x00, 00038 WDT_RESET = 0x02, 00040 WARM_RESET = 0x03, 00042 EXTERNAL_RESET = 0x04, 00044 BROWN_OUT_RESET = 0x05, 00046 UNKNOWN_RESET = 0x07 00047 } HAL_ResetReason_t; 00048 #elif defined(ATMEGA1281) || defined(ATMEGA2561) || defined(ATMEGA1284) || defined(AT90USB1287) 00049 typedef enum 00050 { 00052 NULL_PTR_DEREF_RESET = 0x0, 00054 POWER_ON_RESET = 0x1, 00056 EXTERNAL_RESET = 0x2, 00058 BROWN_OUT_RESET = 0x4, 00060 WDT_RESET = 0x8, 00062 JTAG_RESET = 0x10, 00064 WARM_RESET = 0x11 00065 } HAL_ResetReason_t; 00066 #endif 00067 00068 /****************************************************************************** 00069 Prototypes section 00070 ******************************************************************************/ 00071 /****************************************************************************** 00072 Returns the reset reason. 00073 Parameters: 00074 none. 00075 Returns: 00076 The reason of reset. 00077 00078 \brief Returns the reset reason. 00079 00080 \return 00081 The reason of reset. 00082 ******************************************************************************/ 00083 HAL_ResetReason_t HAL_ReadResetReason(void); 00084 00085 /**************************************************************************/ 00088 void HAL_WarmReset(void); 00089 00090 #endif /*_RESETREASON_H*/ 00091 // resetReason.h