Zephyr Project API 4.0.99
A Scalable Open Source RTOS
|
I2C EEPROM Target Driver API. More...
Functions | |
int | eeprom_target_program (const struct device *dev, const uint8_t *eeprom_data, unsigned int length) |
Program memory of the virtual EEPROM. | |
int | eeprom_target_read (const struct device *dev, uint8_t *eeprom_data, unsigned int offset) |
Read single byte of virtual EEPROM memory. | |
int | eeprom_target_set_addr (const struct device *dev, uint8_t addr) |
Change the address of eeprom target at runtime. | |
I2C EEPROM Target Driver API.
int eeprom_target_program | ( | const struct device * | dev, |
const uint8_t * | eeprom_data, | ||
unsigned int | length | ||
) |
#include <include/zephyr/drivers/i2c/target/eeprom.h>
Program memory of the virtual EEPROM.
dev | Pointer to the device structure for the driver instance. |
eeprom_data | Pointer of data to program into the virtual eeprom memory |
length | Length of data to program into the virtual eeprom memory |
0 | If successful. |
-EINVAL | Invalid data size |
#include <include/zephyr/drivers/i2c/target/eeprom.h>
Read single byte of virtual EEPROM memory.
dev | Pointer to the device structure for the driver instance. |
eeprom_data | Pointer of byte where to store the virtual eeprom memory |
offset | Offset into EEPROM memory where to read the byte |
0 | If successful. |
-EINVAL | Invalid data pointer or offset |
#include <include/zephyr/drivers/i2c/target/eeprom.h>
Change the address of eeprom target at runtime.
dev | Pointer to the device structure for the driver instance. |
addr | New address to assign to the eeprom target device |
0 | Is successful |
-EINVAL | If parameters are invalid |
-EIO | General input / output error during i2c_taget_register |
-ENOSYS | If target mode is not implemented |