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

Interface for random number generator drivers. More...

Data Structures

struct  pbl_rng_ops
 Random number generator driver operations. More...
 
struct  pbl_rng
 Random number generator. More...
 

Macros

#define PBL_RNG_STATE_DEFINE(sym)   PBL_DEVICE_STATE_DEFINE(sym)
 Define the class state of a random number generator.
 
#define PBL_RNG_INIT(sym, _name, _parent, _ops)
 Initialize a struct pbl_rng.
 

Detailed Description

Interface for random number generator drivers.

A driver embeds a struct pbl_rng in its instance, sets it up with PBL_RNG_STATE_DEFINE() and PBL_RNG_INIT(), and implements the struct pbl_rng_ops the class calls.


Data Structure Documentation

◆ pbl_rng

struct pbl_rng

Random number generator.

Data Fields
struct pbl_device dev Device.
const struct pbl_rng_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_RNG_INIT

#define PBL_RNG_INIT (   sym,
  _name,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, pbl_rng_dev_init, _parent, &pbl_rng_class), \
.ops = (_ops), \
}
#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_rng.

Parameters
symSymbol of the instance, as passed to PBL_RNG_STATE_DEFINE().
_nameDevice name.
_parentParent device, or NULL.
_opsDriver operations.

◆ PBL_RNG_STATE_DEFINE

#define PBL_RNG_STATE_DEFINE (   sym)    PBL_DEVICE_STATE_DEFINE(sym)

Define the class state of a random number generator.

Parameters
symSymbol of the instance.