Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
I2C EEPROM Target Driver API

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.
 

Detailed Description

I2C EEPROM Target Driver API .

Since
1.13
Version
1.0.0

Function Documentation

◆ eeprom_target_program()

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

#include <zephyr/drivers/i2c/target/eeprom.h>

Program memory of the virtual EEPROM.

Parameters
devPointer to the device structure for the driver instance.
eeprom_dataPointer of data to program into the virtual eeprom memory
lengthLength of data to program into the virtual eeprom memory
Return values
0If successful.
-EINVALInvalid data size

◆ eeprom_target_read()

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

#include <zephyr/drivers/i2c/target/eeprom.h>

Read single byte of virtual EEPROM memory.

Parameters
devPointer to the device structure for the driver instance.
eeprom_dataPointer of byte where to store the virtual eeprom memory
offsetOffset into EEPROM memory where to read the byte
Return values
0If successful.
-EINVALInvalid data pointer or offset

◆ eeprom_target_set_addr()

int eeprom_target_set_addr ( const struct device * dev,
uint8_t addr )

#include <zephyr/drivers/i2c/target/eeprom.h>

Change the address of eeprom target at runtime.

Parameters
devPointer to the device structure for the driver instance.
addrNew address to assign to the eeprom target device
Return values
0Is successful
-EINVALIf parameters are invalid
-EIOGeneral input / output error during i2c_taget_register
-ENOSYSIf target mode is not implemented