This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

I2C EEPROM Target

Overview

API Reference

group i2c_eeprom_target_api

I2C EEPROM Target Driver API.

Functions

int eeprom_target_program(const struct device *dev, const uint8_t *eeprom_data, unsigned int length)

Program memory of the virtual EEPROM.

Parameters
  • 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

Return values
  • 0 – If successful.

  • -EINVAL – Invalid data size

int eeprom_target_read(const struct device *dev, uint8_t *eeprom_data, unsigned int offset)

Read single byte of virtual EEPROM memory.

Parameters
  • 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

Return values
  • 0 – If successful.

  • -EINVAL – Invalid data pointer or offset