PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
Reset cause drivers

Interface for reset cause drivers. More...

Data Structures

struct  pbl_reset_cause_ops
 Reset cause driver operations. More...
 
struct  pbl_reset_cause
 Reset cause. More...
 

Macros

#define PBL_RESET_CAUSE_STATE_DEFINE(sym)
 Define the class state of a reset cause.
 
#define PBL_RESET_CAUSE_INIT(sym, _name, _parent, _ops)
 Initialize a struct pbl_reset_cause.
 

Detailed Description

Interface for reset cause drivers.

A driver embeds a struct pbl_reset_cause in its instance, sets it up with PBL_RESET_CAUSE_STATE_DEFINE() and PBL_RESET_CAUSE_INIT(), and implements the struct pbl_reset_cause_ops the class calls.


Data Structure Documentation

◆ pbl_reset_cause

struct pbl_reset_cause

Reset cause.

Data Fields
pbl_reset_cause_t * causes Causes read when the device came up.
struct pbl_device dev Device.
const struct pbl_reset_cause_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_RESET_CAUSE_INIT

#define PBL_RESET_CAUSE_INIT (   sym,
  _name,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, pbl_reset_cause_dev_init, _parent, \
&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
symSymbol of the instance, as passed to PBL_RESET_CAUSE_STATE_DEFINE().
_nameDevice name.
_parentParent device, or NULL.
_opsDriver operations.

◆ PBL_RESET_CAUSE_STATE_DEFINE

#define PBL_RESET_CAUSE_STATE_DEFINE (   sym)
Value:
static pbl_reset_cause_t sym##_reset_causes
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
uint32_t pbl_reset_cause_t
Reset causes, as PBL_RESET_CAUSE_* flags.
Definition reset_cause.h:31

Define the class state of a reset cause.

Parameters
symSymbol of the instance.