Zephyr API 3.6.99
|
Retained memory driver interface . More...
Data Structures | |
struct | retained_mem_driver_api |
Retained memory driver API API which can be used by a device to store data in a retained memory area. More... | |
Typedefs | |
typedef ssize_t(* | retained_mem_size_api) (const struct device *dev) |
Callback API to get size of retained memory area. | |
typedef int(* | retained_mem_read_api) (const struct device *dev, off_t offset, uint8_t *buffer, size_t size) |
Callback API to read from retained memory area. | |
typedef int(* | retained_mem_write_api) (const struct device *dev, off_t offset, const uint8_t *buffer, size_t size) |
Callback API to write to retained memory area. | |
typedef int(* | retained_mem_clear_api) (const struct device *dev) |
Callback API to clear retained memory area (reset all data to 0x00). | |
Functions | |
ssize_t | retained_mem_size (const struct device *dev) |
Returns the size of the retained memory area. | |
int | retained_mem_read (const struct device *dev, off_t offset, uint8_t *buffer, size_t size) |
Reads data from the Retained memory area. | |
int | retained_mem_write (const struct device *dev, off_t offset, const uint8_t *buffer, size_t size) |
Writes data to the Retained memory area - underlying data does not need to be cleared prior to writing. | |
int | retained_mem_clear (const struct device *dev) |
Clears data in the retained memory area by setting it to 0x00. | |
Retained memory driver interface .
typedef int(* retained_mem_clear_api) (const struct device *dev) |
#include <zephyr/drivers/retained_mem.h>
Callback API to clear retained memory area (reset all data to 0x00).
See retained_mem_clear() for argument description.
typedef int(* retained_mem_read_api) (const struct device *dev, off_t offset, uint8_t *buffer, size_t size) |
#include <zephyr/drivers/retained_mem.h>
Callback API to read from retained memory area.
See retained_mem_read() for argument description.
#include <zephyr/drivers/retained_mem.h>
Callback API to get size of retained memory area.
See retained_mem_size() for argument description.
typedef int(* retained_mem_write_api) (const struct device *dev, off_t offset, const uint8_t *buffer, size_t size) |
#include <zephyr/drivers/retained_mem.h>
Callback API to write to retained memory area.
See retained_mem_write() for argument description.
int retained_mem_clear | ( | const struct device * | dev | ) |
#include <zephyr/drivers/retained_mem.h>
Clears data in the retained memory area by setting it to 0x00.
dev | Retained memory device to use. |
0 | on success else negative errno code. |
#include <zephyr/drivers/retained_mem.h>
Reads data from the Retained memory area.
dev | Retained memory device to use. |
offset | Offset to read data from. |
buffer | Buffer to store read data in. |
size | Size of data to read. |
0 | on success else negative errno code. |
#include <zephyr/drivers/retained_mem.h>
Returns the size of the retained memory area.
dev | Retained memory device to use. |
Positive | value indicating size in bytes on success, else negative errno code. |
int retained_mem_write | ( | const struct device * | dev, |
off_t | offset, | ||
const uint8_t * | buffer, | ||
size_t | size ) |
#include <zephyr/drivers/retained_mem.h>
Writes data to the Retained memory area - underlying data does not need to be cleared prior to writing.
dev | Retained memory device to use. |
offset | Offset to write data to. |
buffer | Data to write. |
size | Size of data to be written. |
0 | on success else negative errno code. |