12#ifndef ZEPHYR_INCLUDE_DRIVERS_OTP_H_
13#define ZEPHYR_INCLUDE_DRIVERS_OTP_H_
55#if defined(CONFIG_OTP_PROGRAM) || defined(__DOXYGEN__)
80static inline int z_impl_otp_read(
const struct device *dev,
off_t offset,
void *data,
size_t len)
85#if defined(CONFIG_OTP_PROGRAM) || defined(__DOXYGEN__)
98static inline int z_impl_otp_program(
const struct device *dev,
off_t offset,
const void *data,
107 return api->
program(dev, offset, data, len);
119#include <zephyr/syscalls/otp.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1353
int otp_read(const struct device *dev, off_t offset, void *data, size_t len)
Read data from OTP memory.
int(* otp_api_read)(const struct device *dev, off_t offset, void *data, size_t len)
@def_driverbackendgroup{OTP,otp_interface}
Definition otp.h:42
int otp_program(const struct device *dev, off_t offset, const void *data, size_t len)
Program data to the given OTP memory.
int(* otp_api_program)(const struct device *dev, off_t offset, const void *data, size_t len)
Callback API upon writing to the OTP memory.
Definition otp.h:48
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define NULL
Definition iar_missing_defs.h:20
__INTPTR_TYPE__ off_t
Definition types.h:36
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
@driver_ops{OTP}
Definition otp.h:52
otp_api_read read
@driver_ops_mandatory Read data from OTP memory.
Definition otp.h:54
otp_api_program program
@driver_ops_optional Program data to the given OTP memory.
Definition otp.h:60