7#ifndef ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
8#define ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
95static inline int z_impl_bbram_check_invalid(
const struct device *dev)
100 if (!api->check_invalid) {
104 return api->check_invalid(dev);
117static inline int z_impl_bbram_check_standby_power(
const struct device *dev)
122 if (!api->check_standby_power) {
126 return api->check_standby_power(dev);
140static inline int z_impl_bbram_check_power(
const struct device *dev)
145 if (!api->check_power) {
149 return api->check_power(dev);
161static inline int z_impl_bbram_get_size(
const struct device *dev,
size_t *size)
166 if (!api->get_size) {
170 return api->get_size(dev, size);
185static inline int z_impl_bbram_read(
const struct device *dev,
size_t offset,
195 return api->read(dev, offset, size, data);
210static inline int z_impl_bbram_write(
const struct device *dev,
size_t offset,
211 size_t size,
const uint8_t *data)
220 return api->write(dev, offset, size, data);
264#include <zephyr/syscalls/bbram.h>
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)
API template to write to BBRAM.
Definition bbram.h:72
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)
API template to read from BBRAM.
Definition bbram.h:63
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)
API template to check for standby power failure.
Definition bbram.h:39
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)
API template to check for V CC1 power failure.
Definition bbram.h:47
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)
API template to check if the BBRAM is invalid.
Definition bbram.h:31
int(* bbram_api_get_size_t)(const struct device *dev, size_t *size)
API template to check the size of the BBRAM.
Definition bbram.h:55
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:114
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
bbram_api_check_invalid_t check_invalid
Definition bbram.h:76
bbram_api_get_size_t get_size
Definition bbram.h:79
bbram_api_check_standby_power_t check_standby_power
Definition bbram.h:77
bbram_api_read_t read
Definition bbram.h:80
bbram_api_check_power_t check_power
Definition bbram.h:78
bbram_api_write_t write
Definition bbram.h:81
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
void * data
Address of the device instance private data.
Definition device.h:421
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417