PebbleOS
Loading...
Searching...
No Matches
Reset

Reset controller class. More...

Modules

 SF32LB RCC resets
 Reset controller of the SF32LB52 HPSYS RCC.
 

Data Structures

struct  pbl_reset_controller_ops
 Reset controller driver operations, called with interrupts locked. More...
 
struct  pbl_reset_controller
 A reset controller. More...
 
struct  pbl_reset
 A reset line, as used by a consumer. More...
 

Macros

#define PBL_RESET_CONTROLLER_STATE_DEFINE(sym)   PBL_DEVICE_STATE_DEFINE(sym)
 Define the class state of reset controller sym, for the driver's define macro.
 
#define PBL_RESET_CONTROLLER_INIT(sym, _name, _init, _parent, _ops, _num_resets)
 Initializer for the struct pbl_reset_controller of controller sym.
 
#define PBL_RESET(_ctrl, _id)   {.ctrl = (_ctrl), .id = (_id)}
 Initializer for a struct pbl_reset.
 

Functions

int pbl_reset_assert (const struct pbl_reset *rst)
 Put a line in reset.
 
int pbl_reset_deassert (const struct pbl_reset *rst)
 Take a line out of reset.
 
int pbl_reset_reset (const struct pbl_reset *rst)
 Pulse a line: assert then deassert it.
 

Detailed Description

Reset controller class.

A reset controller is a struct pbl_reset_controller device driving a set of reset lines, each identified by a provider-specific number defined in the controller header. A consumer holds a struct pbl_reset naming the controller and line, and lists the controller among its device dependencies:

#define SF32LB52_HPSYS_RST_TRNG
Definition sf32lb.h:40
#define SF32LB_HPSYS_RCC_RESET
HPSYS RCC reset controller.
Definition sf32lb.h:22
A reset line, as used by a consumer.
Definition reset.h:74
int pbl_reset_reset(const struct pbl_reset *rst)
Pulse a line: assert then deassert it.
#define PBL_RESET(_ctrl, _id)
Initializer for a struct pbl_reset.
Definition reset.h:87

Data Structure Documentation

◆ pbl_reset_controller

struct pbl_reset_controller

A reset controller.

Data Fields
struct pbl_device dev Device.
uint16_t num_resets Number of reset lines.
const struct pbl_reset_controller_ops * ops Driver operations.

◆ pbl_reset

struct pbl_reset

A reset line, as used by a consumer.

Data Fields
const struct pbl_reset_controller * ctrl Controller.
uint32_t id Line number on the controller.

Macro Definition Documentation

◆ PBL_RESET

#define PBL_RESET (   _ctrl,
  _id 
)    {.ctrl = (_ctrl), .id = (_id)}

Initializer for a struct pbl_reset.

Parameters
_ctrlReset controller.
_idLine number, from the controller's binding header.

◆ PBL_RESET_CONTROLLER_INIT

#define PBL_RESET_CONTROLLER_INIT (   sym,
  _name,
  _init,
  _parent,
  _ops,
  _num_resets 
)
Value:
{ \
.dev = PBL_DEVICE_INIT(sym, _name, _init, _parent, nullptr), \
.ops = (_ops), \
.num_resets = (_num_resets), \
}
#define PBL_DEVICE_INIT(sym, _name, _init, _parent, _deps)
Initializer for the struct pbl_device of device instance sym.
Definition device.h:142

Initializer for the struct pbl_reset_controller of controller sym.

Parameters
symSymbol of the controller instance, with its state defined by PBL_RESET_CONTROLLER_STATE_DEFINE().
_nameName.
_initDevice init function, or NULL.
_parentParent device, or NULL.
_opsDriver operations.
_num_resetsNumber of reset lines.

◆ PBL_RESET_CONTROLLER_STATE_DEFINE

#define PBL_RESET_CONTROLLER_STATE_DEFINE (   sym)    PBL_DEVICE_STATE_DEFINE(sym)

Define the class state of reset controller sym, for the driver's define macro.

Parameters
symSymbol of the controller instance.

Function Documentation

◆ pbl_reset_assert()

int pbl_reset_assert ( const struct pbl_reset *  rst)

Put a line in reset.

Parameters
rstReset line.
Returns
0 or a negative errno.

◆ pbl_reset_deassert()

int pbl_reset_deassert ( const struct pbl_reset *  rst)

Take a line out of reset.

Parameters
rstReset line.
Returns
0 or a negative errno.

◆ pbl_reset_reset()

int pbl_reset_reset ( const struct pbl_reset *  rst)

Pulse a line: assert then deassert it.

Parameters
rstReset line.
Returns
0 or a negative errno.