Atmel Software Framework

reset_cause.h File Reference

CPU reset cause functions.

Copyright (c) 2010-2015 Atmel Corporation. All rights reserved.

#include <parts.h>
#include <stdbool.h>

Macros

#define CHIP_RESET_CAUSE_BOD_CPU   0
 Brown-out detected on CPU power domain reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_BOD_IO   0
 Brown-out detected on I/O power domain reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_CPU_ERROR   0
 CPU error reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_EXTRST   0
 External reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_JTAG   0
 JTAG reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_OCD   0
 On-chip debug system reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_POR   0
 Power-on-reset reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_POR_IO   0
 Power-on-reset on I/O power domain reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_SLEEP   0
 Wake from Shutdown sleep mode reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_SOFT   0
 Software reset reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_SPIKE   0
 Spike detected reset cause not available on this chip. More...
 
#define CHIP_RESET_CAUSE_WDT   0
 Watchdog timeout reset cause not available on this chip. More...
 

Enumerations

enum  reset_cause {
  RESET_CAUSE_BOD_CPU = CHIP_RESET_CAUSE_BOD_CPU,
  RESET_CAUSE_BOD_IO = CHIP_RESET_CAUSE_BOD_IO,
  RESET_CAUSE_CPU_ERROR = CHIP_RESET_CAUSE_CPU_ERROR,
  RESET_CAUSE_EXTRST = CHIP_RESET_CAUSE_EXTRST,
  RESET_CAUSE_JTAG = CHIP_RESET_CAUSE_JTAG,
  RESET_CAUSE_OCD = CHIP_RESET_CAUSE_OCD,
  RESET_CAUSE_POR = CHIP_RESET_CAUSE_POR,
  RESET_CAUSE_POR_IO = CHIP_RESET_CAUSE_POR_IO,
  RESET_CAUSE_SLEEP = CHIP_RESET_CAUSE_SLEEP,
  RESET_CAUSE_SOFT = CHIP_RESET_CAUSE_SOFT,
  RESET_CAUSE_SPIKE = CHIP_RESET_CAUSE_SPIKE,
  RESET_CAUSE_WDT = CHIP_RESET_CAUSE_WDT
}
 List of reset causes in bit-mask format. More...
 

Functions

Specific reset cause helper functions
static bool reset_cause_is_cpu_brown_out_detected (void)
 Check if chip reset was caused by a CPU power brown-out detection. More...
 
static bool reset_cause_is_io_brown_out_detected (void)
 Check if chip reset was caused by an I/O power brown-out detection. More...
 
static bool reset_cause_is_brown_out_detected (void)
 Check if chip reset was caused by a brown-out detection on any power domain. More...
 
static bool reset_cause_is_cpu_error (void)
 Check if chip reset was caused by a CPU error, illegal access. More...
 
static bool reset_cause_is_external_reset (void)
 Check if chip reset was caused by an external reset. More...
 
static bool reset_cause_is_jtag (void)
 Check if chip reset was caused by a JTAG reset. More...
 
static bool reset_cause_is_ocd (void)
 Check if chip reset was caused by the on-chip debug system. More...
 
static bool reset_cause_is_power_on_reset (void)
 Check if chip reset was caused by a power-on-reset. More...
 
static bool reset_cause_is_io_power_on_reset (void)
 Check if chip reset was caused by an I/O power-on-reset. More...
 
static bool reset_cause_is_wake_from_shutdown_sleep (void)
 Check if chip reset was caused by a wake up from shutdown sleep mode. More...
 
static bool reset_cause_is_software_reset (void)
 Check if chip reset was caused by a software reset. More...
 
static bool reset_cause_is_spike_detected (void)
 Check if chip reset was caused by a power spike detection. More...
 
static bool reset_cause_is_watchdog (void)
 Check if chip reset was caused by a watchdog timeout. More...