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

Interface for RAM drivers. More...

Data Structures

struct  pbl_ram_ops
 Driver operations. More...
 
struct  pbl_ram
 RAM device. More...
 

Macros

#define PBL_RAM_STATE_DEFINE(sym)
 
#define PBL_RAM_INIT(sym, _name, _parent, _ops)
 

Detailed Description

Interface for RAM drivers.

A driver embeds a struct pbl_ram in its instance, sets it up with PBL_RAM_STATE_DEFINE() and PBL_RAM_INIT(), and implements the struct pbl_ram_ops the class calls.


Data Structure Documentation

◆ pbl_ram

struct pbl_ram

RAM device.

Data Fields
struct pbl_device dev Device.
const struct pbl_ram_ops * ops Driver operations.
struct pbl_ram_state * state Runtime state.

Macro Definition Documentation

◆ PBL_RAM_INIT

#define PBL_RAM_INIT (   sym,
  _name,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, pbl_ram_dev_init, _parent, &pbl_ram_class), \
.ops = (_ops), \
.state = &sym##_ram_state, \
}
#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

◆ PBL_RAM_STATE_DEFINE

#define PBL_RAM_STATE_DEFINE (   sym)
Value:
static struct pbl_ram_state sym##_ram_state = {.lock = PBL_MUTEX_INITIALIZER}
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50