See Quick start guide for reset cause service.
This is a generic interface for getting and clearing the chip reset causes.
The reset cause interface does not depend on any other modules, as it only accesses a few registers in the device core.
On the other hand, the software reset call might depend on System Clock Management to enable the clock to the debug system, for devices doing software reset through the on-chip debug system. This applies only to the 32-bit AVR devices.
See Quick start guide for reset cause service
Modules | |
XMEGA reset cause | |
See Quick start guide for reset cause service. | |
Macros | |
#define | CHIP_RESET_CAUSE_CPU_ERROR 0 |
CPU error 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_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... | |
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... | |
Management | |
static void | reset_do_soft_reset (void) |
Perform a software reset of the device. More... | |
static reset_cause_t | reset_cause_get_causes (void) |
Get all reset causes. More... | |
static void | reset_cause_clear_causes (reset_cause_t causes) |
Clear a bit-mask of reset causes. More... | |
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... | |
#define CHIP_RESET_CAUSE_CPU_ERROR 0 |
CPU error reset cause not available on this chip.
#define CHIP_RESET_CAUSE_JTAG 0 |
JTAG reset cause not available on this chip.
#define CHIP_RESET_CAUSE_POR_IO 0 |
Power-on-reset on I/O power domain reset cause not available on this chip.
#define CHIP_RESET_CAUSE_SLEEP 0 |
Wake from Shutdown sleep mode reset cause not available on this chip.
enum reset_cause |
List of reset causes in bit-mask format.
|
inlinestatic |
Clear a bit-mask of reset causes.
This function will clear the provided reset causes in the reset cause register.
causes | bit-mask of reset causes to clear |
Referenced by main().
|
inlinestatic |
Get all reset causes.
This function will return a value containing the currently triggered reset cause(s).
Referenced by main(), reset_cause_is_cpu_brown_out_detected(), reset_cause_is_cpu_error(), reset_cause_is_external_reset(), reset_cause_is_io_brown_out_detected(), reset_cause_is_io_power_on_reset(), reset_cause_is_jtag(), reset_cause_is_ocd(), reset_cause_is_power_on_reset(), reset_cause_is_software_reset(), reset_cause_is_spike_detected(), reset_cause_is_wake_from_shutdown_sleep(), and reset_cause_is_watchdog().
|
inlinestatic |
Check if chip reset was caused by a brown-out detection on any power domain.
References reset_cause_is_cpu_brown_out_detected(), and reset_cause_is_io_brown_out_detected().
|
inlinestatic |
Check if chip reset was caused by a CPU power brown-out detection.
References RESET_CAUSE_BOD_CPU, and reset_cause_get_causes().
Referenced by reset_cause_is_brown_out_detected().
|
inlinestatic |
Check if chip reset was caused by a CPU error, illegal access.
References RESET_CAUSE_CPU_ERROR, and reset_cause_get_causes().
|
inlinestatic |
Check if chip reset was caused by an external reset.
References RESET_CAUSE_EXTRST, and reset_cause_get_causes().
|
inlinestatic |
Check if chip reset was caused by an I/O power brown-out detection.
References RESET_CAUSE_BOD_IO, and reset_cause_get_causes().
Referenced by reset_cause_is_brown_out_detected().
|
inlinestatic |
Check if chip reset was caused by an I/O power-on-reset.
References reset_cause_get_causes(), and RESET_CAUSE_POR_IO.
|
inlinestatic |
Check if chip reset was caused by a JTAG reset.
References reset_cause_get_causes(), and RESET_CAUSE_JTAG.
|
inlinestatic |
Check if chip reset was caused by the on-chip debug system.
References reset_cause_get_causes(), and RESET_CAUSE_OCD.
|
inlinestatic |
Check if chip reset was caused by a power-on-reset.
References reset_cause_get_causes(), and RESET_CAUSE_POR.
|
inlinestatic |
Check if chip reset was caused by a software reset.
References reset_cause_get_causes(), and RESET_CAUSE_SOFT.
|
inlinestatic |
Check if chip reset was caused by a power spike detection.
References reset_cause_get_causes(), and RESET_CAUSE_SPIKE.
|
inlinestatic |
Check if chip reset was caused by a wake up from shutdown sleep mode.
References reset_cause_get_causes(), and RESET_CAUSE_SLEEP.
|
inlinestatic |
Check if chip reset was caused by a watchdog timeout.
References reset_cause_get_causes(), and RESET_CAUSE_WDT.
|
inlinestatic |
Perform a software reset of the device.
References ccp_write_io().