Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
SPI Emulation Interface . More...
Data Structures | |
struct | spi_emul |
Node in a linked list of emulators for SPI devices. More... | |
struct | spi_emul_api |
Definition of the emulator API. More... | |
Typedefs | |
typedef int(* | spi_emul_io_t) (const struct emul *target, const struct spi_config *config, const struct spi_buf_set *tx_bufs, const struct spi_buf_set *rx_bufs) |
Passes SPI messages to the emulator. | |
Functions | |
int | spi_emul_register (const struct device *dev, struct spi_emul *emul) |
Register an emulated device on the controller. | |
uint32_t | spi_emul_get_config (const struct device *dev) |
Back door to allow an emulator to retrieve the host configuration. | |
SPI Emulation Interface .
typedef int(* spi_emul_io_t) (const struct emul *target, const struct spi_config *config, const struct spi_buf_set *tx_bufs, const struct spi_buf_set *rx_bufs) |
#include <zephyr/drivers/spi_emul.h>
Passes SPI messages to the emulator.
The emulator updates the data with what was read back.
target | The device Emulator instance |
config | Pointer to a valid spi_config structure instance. Pointer-comparison may be used to detect changes from previous operations. |
tx_bufs | Buffer array where data to be sent originates from, or NULL if none. |
rx_bufs | Buffer array where data to be read will be written to, or NULL if none. |
0 | If successful. |
-EIO | General input / output error. |
#include <zephyr/drivers/spi_emul.h>
Back door to allow an emulator to retrieve the host configuration.
dev | SPI device associated with the emulator |
#include <zephyr/drivers/spi_emul.h>
Register an emulated device on the controller.
dev | Device that will use the emulator |
emul | SPI emulator to use |