16#ifndef ZEPHYR_INCLUDE_DRIVERS_EEPROM_H_
17#define ZEPHYR_INCLUDE_DRIVERS_EEPROM_H_
39 const void *
data,
size_t len);
61static inline int z_impl_eeprom_read(
const struct device *dev,
off_t offset,
62 void *data,
size_t len)
67 return api->
read(dev, offset, data, len);
84static inline int z_impl_eeprom_write(
const struct device *dev,
off_t offset,
85 const void *data,
size_t len)
90 return api->
write(dev, offset, data, len);
102static inline size_t z_impl_eeprom_get_size(
const struct device *dev)
107 return api->
size(dev);
118#include <syscalls/eeprom.h>
int eeprom_write(const struct device *dev, off_t offset, const void *data, size_t len)
Write data to EEPROM.
size_t eeprom_get_size(const struct device *dev)
Get the size of the EEPROM in bytes.
int eeprom_read(const struct device *dev, off_t offset, void *data, size_t len)
Read data from EEPROM.
int(* eeprom_api_read)(const struct device *dev, off_t offset, void *data, size_t len)
Definition: eeprom.h:35
size_t(* eeprom_api_size)(const struct device *dev)
Definition: eeprom.h:40
int(* eeprom_api_write)(const struct device *dev, off_t offset, const void *data, size_t len)
Definition: eeprom.h:38
__INTPTR_TYPE__ off_t
Definition: types.h:36
Size of off_t must be equal or less than size of size_t
Definition: retained_mem.h:28
Runtime device structure (in ROM) per driver instance.
Definition: device.h:381
void * data
Address of the device instance private data.
Definition: device.h:391
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:387
eeprom_api_read read
Definition: eeprom.h:43
eeprom_api_size size
Definition: eeprom.h:45
eeprom_api_write write
Definition: eeprom.h:44