Appearance
Reset Controller
Reset cause / reset controller driver.
Reports the cause of the most recent reset. The HAL driver reads the SoC's reset-cause register exactly once in its initialize() callback (which clears the latch in HW), so subsequent calls to reset_get() always see a stable value for the current boot.
The integer values of reset_cause_t intentionally match the CW_RESET_* constants used by libcoldwave (libcoldwave/coldwave_defines.h). A static_assert in libcoldwave enforces the equality at compile time — if you change a value here, the libcoldwave build will fail.
Types
| Name | |
|---|---|
| enum | reset_cause_t |
Functions Overview
| Name | |
|---|---|
| reset_cause_t | reset_get(void ) Get the latched reset cause for the current boot. |
Types Documentation
enum reset_cause_t
| Enumerator | Description |
|---|---|
| cwResetUnknown | |
| cwResetPowerOn | |
| cwResetSoftware | |
| cwResetWatchdog | |
| cwResetBrownout | |
| cwResetCrash | |
| cwResetDeepSleep | |
| cwResetUser | |
| cwResetExternalPin | |
| cwResetLockup |
Function Details
function reset_get
cpp
reset_cause_t reset_get(
void
)Get the latched reset cause for the current boot.
Return: reset_cause_t value, or cwResetUnknown if no reset driver is configured on this platform.
Lazy-opens the "reset" device on first call. The HAL driver has already latched the hardware register at its init time; this call only reads the cached value.