Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
I2C Emulation Interface. More...
Data Structures | |
struct | i2c_emul |
Node in a linked list of emulators for I2C devices. More... | |
struct | i2c_emul_api |
Definition of the emulator API. More... | |
Typedefs | |
typedef int(* | i2c_emul_transfer_t) (const struct emul *target, struct i2c_msg *msgs, int num_msgs, int addr) |
Passes I2C messages to the emulator. | |
Functions | |
int | i2c_emul_register (const struct device *dev, struct i2c_emul *emul) |
Register an emulated device on the controller. | |
I2C Emulation Interface.
typedef int(* i2c_emul_transfer_t) (const struct emul *target, struct i2c_msg *msgs, int num_msgs, int addr) |
#include <include/zephyr/drivers/i2c_emul.h>
Passes I2C messages to the emulator.
The emulator updates the data with what was read back.
target | The device Emulator instance. |
msgs | Array of messages to transfer. For 'read' messages, this function updates the 'buf' member with the data that was read. |
num_msgs | Number of messages to transfer. |
addr | Address of the I2C target device. |
0 | If successful. |
-EIO | General input / output error. |
#include <include/zephyr/drivers/i2c_emul.h>
Register an emulated device on the controller.
dev | Device that will use the emulator |
emul | I2C emulator to use |