17#ifndef ZEPHYR_INCLUDE_DRIVERS_EEPROM_H_
18#define ZEPHYR_INCLUDE_DRIVERS_EEPROM_H_
57 const void *
data,
size_t len);
92static inline int z_impl_eeprom_read(
const struct device *dev,
off_t offset,
93 void *data,
size_t len)
112static inline int z_impl_eeprom_write(
const struct device *dev,
off_t offset,
113 const void *data,
size_t len)
115 return DEVICE_API_GET(eeprom, dev)->write(dev, offset, data, len);
127static inline size_t z_impl_eeprom_get_size(
const struct device *dev)
140#include <zephyr/syscalls/eeprom.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1425
int(* eeprom_api_read)(const struct device *dev, off_t offset, void *data, size_t len)
Callback API upon reading from the EEPROM.
Definition eeprom.h:48
size_t(* eeprom_api_size)(const struct device *dev)
Callback API upon getting the EEPROM size.
Definition eeprom.h:63
int(* eeprom_api_write)(const struct device *dev, off_t offset, const void *data, size_t len)
Callback API upon writing to the EEPROM.
Definition eeprom.h:56
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.
__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:29
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
void * data
Address of the device instance private data.
Definition device.h:523
<span class="mlabel">Driver Operations</span> EEPROM driver operations
Definition eeprom.h:68
eeprom_api_read read
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition eeprom.h:70
eeprom_api_size size
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition eeprom.h:74
eeprom_api_write write
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition eeprom.h:72