13#ifndef ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
14#define ZEPHYR_INCLUDE_DRIVERS_BBRAM_H
118static inline int z_impl_bbram_check_invalid(
const struct device *dev)
139static inline int z_impl_bbram_check_standby_power(
const struct device *dev)
161static inline int z_impl_bbram_check_power(
const struct device *dev)
181static inline int z_impl_bbram_get_size(
const struct device *dev,
size_t *size)
204static inline int z_impl_bbram_read(
const struct device *dev,
size_t offset,
213 return api->
read(dev, offset, size, data);
228static inline int z_impl_bbram_write(
const struct device *dev,
size_t offset,
229 size_t size,
const uint8_t *data)
237 return api->
write(dev, offset, size, data);
281#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:1375
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:71
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:64
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:46
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:52
int(* bbram_api_check_invalid_t)(const struct device *dev)
Callback API to check if the BBRAM is invalid See bbram_check_invalid() for argument description.
Definition bbram.h:40
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:58
int bbram_emul_set_standby_power_state(const struct device *dev, bool failure)
Set the emulated BBRAM driver's standby power state.
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_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_read(const struct device *dev, size_t offset, size_t size, uint8_t *data)
Read bytes from BBRAM.
int bbram_get_size(const struct device *dev, size_t *size)
Get the size of the BBRAM (in bytes).
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
<span class="mlabel">Driver Operations</span> BBRAM driver operations
Definition bbram.h:77
bbram_api_check_invalid_t check_invalid
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:81
bbram_api_get_size_t get_size
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:93
bbram_api_check_standby_power_t check_standby_power
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:85
bbram_api_read_t read
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:97
bbram_api_check_power_t check_power
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:89
bbram_api_write_t write
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition bbram.h:101
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