Runs single-line memory operations as transfers on a SPI controller.
More...
Runs single-line memory operations as transfers on a SPI controller.
A memory on a SPI controller with no memory operations of its own gets one of these: the command, address and dummy bytes go out in a first transfer, and the data in a second, with the chip select asserted throughout.
◆ pbl_spi_mem_spi
| Data Fields |
|
struct pbl_spi_mem_spi_data * |
data |
Driver state. |
|
struct pbl_spi_dev |
dev |
The memory on the bus. |
|
struct pbl_spi_mem |
mem |
Controller. |
◆ PBL_SPI_MEM_SPI_BUF_SIZE
| #define PBL_SPI_MEM_SPI_BUF_SIZE 256U |
Largest data phase, and the size of the buffer data to write goes through.
◆ PBL_SPI_MEM_SPI_DEFINE
| #define PBL_SPI_MEM_SPI_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_bus, |
|
|
|
_cs, |
|
|
|
_max_hz |
|
) |
| |
Value:
}
SPI memory on a SPI bus.
Definition spi.h:35
A SPI memory controller.
Definition spi_mem.h:239
#define PBL_SPI_MEM_STATE_DEFINE(sym)
Define the class state of controller sym, for the PBL_SPI_MEM_*_DEFINE() macro of a driver.
Definition spi_mem.h:256
#define PBL_SPI_MEM_INIT(sym, _name, _parent, _ops, _flags)
Initializer for the struct pbl_spi_mem of controller sym.
Definition spi_mem.h:270
#define PBL_SPI_DEV(_bus, _cs, _max_hz, _mode)
Initializer for a struct pbl_spi_dev.
Definition spi.h:173
#define PBL_SPI_MODE_0
Mode 0: clock idles low, sample on the leading edge.
Definition spi.h:62
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50
Define a SPI memory on a SPI bus.
- Parameters
-
| sym | Symbol of the device. |
| _name | Name. |
| _bus | SPI bus. |
| _cs | Chip select of the memory. |
| _max_hz | Highest SCK frequency of the memory, in Hz. |