Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
BBRAM Interface. More...
Data Structures | |
struct | bbram_driver_api |
Typedefs | |
typedef int(* | bbram_api_check_invalid_t) (const struct device *dev) |
API template to check if the BBRAM is invalid. | |
typedef int(* | bbram_api_check_standby_power_t) (const struct device *dev) |
API template to check for standby power failure. | |
typedef int(* | bbram_api_check_power_t) (const struct device *dev) |
API template to check for V CC1 power failure. | |
typedef int(* | bbram_api_get_size_t) (const struct device *dev, size_t *size) |
API template to check the size of the BBRAM. | |
typedef int(* | bbram_api_read_t) (const struct device *dev, size_t offset, size_t size, uint8_t *data) |
API template to read from BBRAM. | |
typedef 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. | |
Functions | |
int | bbram_check_invalid (const struct device *dev) |
Check if BBRAM is invalid. | |
int | bbram_check_standby_power (const struct device *dev) |
Check for standby (Volt SBY) power failure. | |
int | bbram_check_power (const struct device *dev) |
Check for V CC1 power failure. | |
int | bbram_get_size (const struct device *dev, size_t *size) |
Get the size of the BBRAM (in bytes). | |
int | bbram_read (const struct device *dev, size_t offset, size_t size, uint8_t *data) |
Read bytes from BBRAM. | |
int | bbram_write (const struct device *dev, size_t offset, size_t size, const uint8_t *data) |
Write bytes to BBRAM. | |
int | bbram_emul_set_invalid (const struct device *dev, bool is_invalid) |
Set the emulated BBRAM driver's invalid state. | |
int | bbram_emul_set_standby_power_state (const struct device *dev, bool failure) |
Set the emulated BBRAM driver's standby power state. | |
int | bbram_emul_set_power_state (const struct device *dev, bool failure) |
Set the emulated BBRAM driver's power state. | |
BBRAM Interface.
bbram_api_check_invalid_t |
#include <include/zephyr/drivers/bbram.h>
API template to check if the BBRAM is invalid.
bbram_api_check_power_t |
#include <include/zephyr/drivers/bbram.h>
API template to check for V CC1 power failure.
bbram_api_check_standby_power_t |
#include <include/zephyr/drivers/bbram.h>
API template to check for standby power failure.
bbram_api_get_size_t |
#include <include/zephyr/drivers/bbram.h>
API template to check the size of the BBRAM.
bbram_api_read_t |
bbram_api_write_t |
int bbram_check_invalid | ( | const struct device * | dev | ) |
#include <include/zephyr/drivers/bbram.h>
Check if BBRAM is invalid.
Check if "Invalid Battery-Backed RAM" status is set then reset the status bit. This may occur as a result to low voltage at the VBAT pin.
[in] | dev | BBRAM device pointer. |
int bbram_check_power | ( | const struct device * | dev | ) |
#include <include/zephyr/drivers/bbram.h>
Check for V CC1 power failure.
This will return an error if the V CC1 power domain is turned on after it was off and reset the status bit.
[in] | dev | BBRAM device pointer. |
int bbram_check_standby_power | ( | const struct device * | dev | ) |
#include <include/zephyr/drivers/bbram.h>
Check for standby (Volt SBY) power failure.
Check if the V standby power domain is turned on after it was off then reset the status bit.
[in] | dev | BBRAM device pointer. |
#include <include/zephyr/drivers/bbram.h>
Set the emulated BBRAM driver's invalid state.
Calling this will affect the emulated behavior of bbram_check_invalid().
[in] | dev | The emulated device to modify |
[in] | is_invalid | The new invalid state |
#include <include/zephyr/drivers/bbram.h>
Set the emulated BBRAM driver's power state.
Calling this will affect the emulated behavior of bbram_check_power().
[in] | dev | The emulated device to modify |
[in] | failure | Whether or not a power failure should be emulated |
#include <include/zephyr/drivers/bbram.h>
Set the emulated BBRAM driver's standby power state.
Calling this will affect the emulated behavior of bbram_check_standby_power().
[in] | dev | The emulated device to modify |
[in] | failure | Whether or not standby power failure should be emulated |
#include <include/zephyr/drivers/bbram.h>
Get the size of the BBRAM (in bytes).
[in] | dev | BBRAM device pointer. |
[out] | size | Pointer to write the size to. |
#include <include/zephyr/drivers/bbram.h>
Read bytes from BBRAM.
[in] | dev | The BBRAM device pointer to read from. |
[in] | offset | The offset into the RAM address to start reading from. |
[in] | size | The number of bytes to read. |
[out] | data | The buffer to load the data into. |
#include <include/zephyr/drivers/bbram.h>
Write bytes to BBRAM.
[in] | dev | The BBRAM device pointer to write to. |
[in] | offset | The offset into the RAM address to start writing to. |
[in] | size | The number of bytes to write. |
[out] | data | Pointer to the start of data to write. |