PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
SPI memory controller drivers

Interface for SPI memory controller drivers. More...

Data Structures

struct  pbl_spi_mem_ops
 Controller driver operations. More...
 

Macros

#define PBL_SPI_MEM_STATE_DEFINE(sym)
 Define the class state of controller sym, for the PBL_SPI_MEM_*_DEFINE() macro of a driver.
 
#define PBL_SPI_MEM_INIT(sym, _name, _parent, _ops, _flags)
 Initializer for the struct pbl_spi_mem of controller sym.
 

Functions

static bool pbl_spi_mem_is_polling (const struct pbl_spi_mem *mem)
 Check whether the controller polls for completion, for drivers.
 

Detailed Description

Interface for SPI memory controller drivers.

A driver embeds a struct pbl_spi_mem in its instance, sets it up with PBL_SPI_MEM_STATE_DEFINE() and PBL_SPI_MEM_INIT(), and implements the struct pbl_spi_mem_ops the class calls.

Macro Definition Documentation

◆ PBL_SPI_MEM_INIT

#define PBL_SPI_MEM_INIT (   sym,
  _name,
  _parent,
  _ops,
  _flags 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, pbl_spi_mem_dev_init, _parent, &pbl_spi_mem_class), \
.ops = (_ops), \
.state = &sym##_spi_mem_state, \
.flags = (_flags), \
}
#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

Initializer for the struct pbl_spi_mem of controller sym.

Parameters
symSymbol of the controller instance, with its state defined by PBL_SPI_MEM_STATE_DEFINE().
_nameName.
_parentParent device, as the memory controller the function is part of, or NULL.
_opsDriver operations.
_flagsFlags, PBL_SPI_MEM_*.

◆ PBL_SPI_MEM_STATE_DEFINE

#define PBL_SPI_MEM_STATE_DEFINE (   sym)
Value:
static struct pbl_spi_mem_state sym##_spi_mem_state
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132

Define the class state of controller sym, for the PBL_SPI_MEM_*_DEFINE() macro of a driver.

Parameters
symSymbol of the controller instance.

Function Documentation

◆ pbl_spi_mem_is_polling()

static bool pbl_spi_mem_is_polling ( const struct pbl_spi_mem *  mem)
inlinestatic

Check whether the controller polls for completion, for drivers.

Parameters
memController.
Returns
True if polling.

References pbl_spi_mem::state.