Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
retention.h File Reference

Public API for retention API. More...

#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/types.h>

Go to the source code of this file.

Data Structures

struct  retention_api
 

Typedefs

typedef ssize_t(* retention_size_api) (const struct device *dev)
 
typedef int(* retention_is_valid_api) (const struct device *dev)
 
typedef int(* retention_read_api) (const struct device *dev, off_t offset, uint8_t *buffer, size_t size)
 
typedef int(* retention_write_api) (const struct device *dev, off_t offset, const uint8_t *buffer, size_t size)
 
typedef int(* retention_clear_api) (const struct device *dev)
 

Functions

ssize_t retention_size (const struct device *dev)
 Returns the size of the retention area.
 
int retention_is_valid (const struct device *dev)
 Checks if the underlying data in the retention area is valid or not.
 
int retention_read (const struct device *dev, off_t offset, uint8_t *buffer, size_t size)
 Reads data from the retention area.
 
int retention_write (const struct device *dev, off_t offset, const uint8_t *buffer, size_t size)
 Writes data to the retention area (underlying data does not need to be cleared prior to writing), once function returns with a success code, the data will be classed as valid if queried using retention_is_valid().
 
int retention_clear (const struct device *dev)
 Clears all data in the retention area (sets it to 0)
 

Detailed Description

Public API for retention API.