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_api_read)(const struct device *dev, off_t offset, void *data, size_t len)
Callback API upon reading from the OTP memory.
Definition otp.h:42
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
int otp_read(const struct device *dev, off_t offset, void *data, size_t len)
Read data from OTP memory.
int otp_program(const struct device *dev, off_t offset, const void *data, size_t len)
Program data to the given OTP memory.
#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
<span class="mlabel">Driver Operations</span> OTP driver operations
Definition otp.h:52
otp_api_read read
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition otp.h:54
otp_api_program program
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition otp.h:60