Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Retained memory driver interface

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.
 

Detailed Description

Retained memory driver interface.

Since
3.4
Version
0.8.0

Typedef Documentation

◆ retained_mem_clear_api

retained_mem_clear_api

#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.

◆ retained_mem_read_api

retained_mem_read_api

#include <zephyr/drivers/retained_mem.h>

Callback API to read from retained memory area.

See retained_mem_read() for argument description.

◆ retained_mem_size_api

retained_mem_size_api

#include <zephyr/drivers/retained_mem.h>

Callback API to get size of retained memory area.

See retained_mem_size() for argument description.

◆ retained_mem_write_api

retained_mem_write_api

#include <zephyr/drivers/retained_mem.h>

Callback API to write to retained memory area.

See retained_mem_write() for argument description.

Function Documentation

◆ retained_mem_clear()

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.

Parameters
devRetained memory device to use.
Return values
0on success else negative errno code.

◆ retained_mem_read()

int retained_mem_read ( const struct device dev,
off_t  offset,
uint8_t buffer,
size_t  size 
)

#include <zephyr/drivers/retained_mem.h>

Reads data from the Retained memory area.

Parameters
devRetained memory device to use.
offsetOffset to read data from.
bufferBuffer to store read data in.
sizeSize of data to read.
Return values
0on success else negative errno code.

◆ retained_mem_size()

ssize_t retained_mem_size ( const struct device dev)

#include <zephyr/drivers/retained_mem.h>

Returns the size of the retained memory area.

Parameters
devRetained memory device to use.
Return values
Positivevalue indicating size in bytes on success, else negative errno code.

◆ retained_mem_write()

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.

Parameters
devRetained memory device to use.
offsetOffset to write data to.
bufferData to write.
sizeSize of data to be written.
Return values
0on success else negative errno code.