Reset cause class.
More...
|
| | Nordic nRF52 POWER |
| | Reset reason latched by the POWER block of the nRF52.
|
| |
| | QEMU |
| | Reset reason latched by the system controller of the QEMU Pebble machines.
|
| |
| | SiFli SF32LB PMUC |
| | Wake and reset sources latched by the PMUC of the SF32LB52 and SF32LB57.
|
| |
| | ST STM32H7 RCC |
| | Reset flags latched by the RCC of the STM32H7.
|
| |
Reset cause class.
A reset cause is a struct pbl_reset_cause device: the block that latches why the system last reset, such as the power or clock controller of the SoC. The cause is read when the device comes up, so it stays available once the hardware latch is cleared.
}
int pbl_reset_cause_get(const struct pbl_reset_cause *rc, pbl_reset_cause_t *causes)
Get the causes of the last reset.
uint32_t pbl_reset_cause_t
Reset causes, as PBL_RESET_CAUSE_* flags.
Definition reset_cause.h:31
int pbl_reset_cause_clear(const struct pbl_reset_cause *rc)
Clear the causes latched by the hardware, so the next reset reports its own.
const struct pbl_reset_cause *const RESET_CAUSE
The board's reset cause.
◆ pbl_reset_cause
◆ PBL_RESET_CAUSE_BROWN_OUT
| #define PBL_RESET_CAUSE_BROWN_OUT PBL_BIT(1) |
Supply below the brown-out threshold.
◆ PBL_RESET_CAUSE_INIT
| #define PBL_RESET_CAUSE_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
&pbl_reset_cause_class), \
.ops = (_ops), \
.causes = &sym##_reset_causes, \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initialize a struct pbl_reset_cause.
- Parameters
-
◆ PBL_RESET_CAUSE_LOCKUP
| #define PBL_RESET_CAUSE_LOCKUP PBL_BIT(5) |
◆ PBL_RESET_CAUSE_LOW_POWER
| #define PBL_RESET_CAUSE_LOW_POWER PBL_BIT(6) |
Illegal low-power mode entry.
◆ PBL_RESET_CAUSE_PIN
| #define PBL_RESET_CAUSE_PIN PBL_BIT(2) |
◆ PBL_RESET_CAUSE_POWER_ON
| #define PBL_RESET_CAUSE_POWER_ON PBL_BIT(0) |
◆ PBL_RESET_CAUSE_SOFTWARE
| #define PBL_RESET_CAUSE_SOFTWARE PBL_BIT(3) |
◆ PBL_RESET_CAUSE_STATE_DEFINE
| #define PBL_RESET_CAUSE_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Define the class state of a reset cause.
- Parameters
-
| sym | Symbol of the instance. |
◆ PBL_RESET_CAUSE_WAKEUP
| #define PBL_RESET_CAUSE_WAKEUP PBL_BIT(7) |
Wake-up from a power-off state.
◆ PBL_RESET_CAUSE_WATCHDOG
| #define PBL_RESET_CAUSE_WATCHDOG PBL_BIT(4) |
◆ pbl_reset_cause_t
Reset causes, as PBL_RESET_CAUSE_* flags.
◆ pbl_reset_cause_clear()
Clear the causes latched by the hardware, so the next reset reports its own.
pbl_reset_cause_get() keeps reporting the causes read when the device came up.
- Parameters
-
- Returns
- 0, -ENODEV if the device is not ready, or a negative errno.
◆ pbl_reset_cause_get()
Get the causes of the last reset.
- Parameters
-
| rc | Reset cause. |
| [out] | causes | PBL_RESET_CAUSE_* flags, read when the device came up; those the hardware cannot report are clear. |
- Returns
- 0, -ENODEV if the device is not ready.
◆ RESET_CAUSE