13#ifndef ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
14#define ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
120static inline int z_impl_bbram_check_invalid(
const struct device *dev)
141static inline int z_impl_bbram_check_standby_power(
const struct device *dev)
163static inline int z_impl_bbram_check_power(
const struct device *dev)
183static inline int z_impl_bbram_get_size(
const struct device *dev,
size_t *size)
206static inline int z_impl_bbram_read(
const struct device *dev,
size_t offset,
215 return api->
read(dev, offset, size, data);
230static inline int z_impl_bbram_write(
const struct device *dev,
size_t offset,
231 size_t size,
const uint8_t *data)
239 return api->
write(dev, offset, size, data);
283#include <zephyr/syscalls/bbram.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1449
int bbram_emul_set_standby_power_state(const struct device *dev, bool failure)
Set the emulated BBRAM driver's standby power state.
int(* bbram_api_write_t)(const struct device *dev, size_t offset, size_t size, const uint8_t *data)
Callback API to write to BBRAM.
Definition bbram.h:73
int bbram_write(const struct device *dev, size_t offset, size_t size, const uint8_t *data)
Write bytes to BBRAM.
int bbram_check_invalid(const struct device *dev)
Check if BBRAM is invalid.
int(* bbram_api_read_t)(const struct device *dev, size_t offset, size_t size, uint8_t *data)
Callback API to read from BBRAM See bbram_read() for argument description.
Definition bbram.h:66
int bbram_check_power(const struct device *dev)
Check for V CC1 power failure.
int bbram_check_standby_power(const struct device *dev)
Check for standby (Volt SBY) power failure.
int(* bbram_api_check_standby_power_t)(const struct device *dev)
Callback API to check for standby power failure See bbram_check_standby_power() for argument descript...
Definition bbram.h:48
int bbram_read(const struct device *dev, size_t offset, size_t size, uint8_t *data)
Read bytes from BBRAM.
int(* bbram_api_check_power_t)(const struct device *dev)
Callback API to check for V CC1 power failure See bbram_check_power() for argument description.
Definition bbram.h:54
int bbram_get_size(const struct device *dev, size_t *size)
Get the size of the BBRAM (in bytes).
int(* bbram_api_check_invalid_t)(const struct device *dev)
@def_driverbackendgroup{BBRAM,bbram_interface}
Definition bbram.h:42
int(* bbram_api_get_size_t)(const struct device *dev, size_t *size)
Callback API to get the size of the BBRAM See bbram_get_size() for argument description.
Definition bbram.h:60
int bbram_emul_set_power_state(const struct device *dev, bool failure)
Set the emulated BBRAM driver's power state.
int bbram_emul_set_invalid(const struct device *dev, bool is_invalid)
Set the emulated BBRAM driver's invalid state.
#define ENOTSUP
Unsupported value.
Definition errno.h:115
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
@driver_ops{BBRAM}
Definition bbram.h:79
bbram_api_check_invalid_t check_invalid
@driver_ops_optional Check if BBRAM is invalid.
Definition bbram.h:83
bbram_api_get_size_t get_size
@driver_ops_optional Get the size of the BBRAM (in bytes).
Definition bbram.h:95
bbram_api_check_standby_power_t check_standby_power
@driver_ops_optional Check for standby (Volt SBY) power failure.
Definition bbram.h:87
bbram_api_read_t read
@driver_ops_optional Read bytes from BBRAM.
Definition bbram.h:99
bbram_api_check_power_t check_power
@driver_ops_optional Check for V CC1 power failure.
Definition bbram.h:91
bbram_api_write_t write
@driver_ops_optional Write bytes to BBRAM.
Definition bbram.h:103
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