Interface for SPI memory controller drivers.
More...
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.
◆ PBL_SPI_MEM_INIT
| #define PBL_SPI_MEM_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops, |
|
|
|
_flags |
|
) |
| |
Value: { \
.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
-
| sym | Symbol of the controller instance, with its state defined by PBL_SPI_MEM_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, as the memory controller the function is part of, or NULL. |
| _ops | Driver operations. |
| _flags | Flags, 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
-
| sym | Symbol of the controller instance. |
◆ 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
-
- Returns
- True if polling.
References pbl_spi_mem::state.