Low-level interface to the ResetReason of a target. More...
Modules | |
ResetReason HAL tests | |
Greentea tests for the ResetReason HAL. | |
Data Structures | |
struct | reset_reason_capabilities_t |
Reset reason capabilities of the platform. More... | |
Enumerations |
Functions | |
reset_reason_t | hal_reset_reason_get (void) |
Fetch the reset reason for the last system reset. More... | |
uint32_t | hal_reset_reason_get_raw (void) |
Fetch the raw platform specific reset reason register value. More... | |
void | hal_reset_reason_clear (void) |
Clear the reset reason from registers. More... | |
void | hal_reset_reason_get_capabilities (reset_reason_capabilities_t *cap) |
Fill the given reset_reason_capabilities_t instance according to platform capabilities. More... | |
Low-level interface to the ResetReason of a target.
This module provides a platform-independent method of checking the cause of the last system reset.
reset_reason_capabilities_t
instance.enum reset_reason_t |
Definitions of different reset reasons.
Definition at line 78 of file reset_reason_api.h.
void hal_reset_reason_clear | ( | void | ) |
Clear the reset reason from registers.
Reset the value of the reset status registers. The reset reason persists between system resets on certain platforms, so the registers should be cleared before the system resets. Failing to do so may make it difficult to determine the cause of any subsequent system resets.
reset_reason_t hal_reset_reason_get | ( | void | ) |
Fetch the reset reason for the last system reset.
This function must return the contents of the system reset reason registers cast to an appropriate platform independent reset reason. If multiple reset reasons are set, this function should return RESET_REASON_MULTIPLE. If the reset reason does not match any existing platform independent value, this function should return RESET_REASON_PLATFORM. If no reset reason can be determined, this function should return RESET_REASON_UNKNOWN.
This function is not idempotent; there is no guarantee the system reset reason will not be cleared between calls to this function altering the return value between calls.
Note: Some platforms contain reset reason registers that persist through system resets. If the registers haven't been cleared before calling this function, multiple reasons may be set within the registers. If multiple reset reasons are detected, this function returns RESET_REASON_MULTIPLE.
void hal_reset_reason_get_capabilities | ( | reset_reason_capabilities_t * | cap | ) |
Fill the given reset_reason_capabilities_t instance according to platform capabilities.
uint32_t hal_reset_reason_get_raw | ( | void | ) |
Fetch the raw platform specific reset reason register value.
This function must return the raw contents of the system reset reason registers cast to a uint32_t value. If the platform contains reset reasons that span multiple registers/addresses, the value should be concatenated into the return type.
This function is not idempotent; there is no guarantee the system reset reason will not be cleared between calls to this function altering the return value between calls.