Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
retention.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
11
12
#ifndef ZEPHYR_INCLUDE_RETENTION_RETENTION_H_
13
#define ZEPHYR_INCLUDE_RETENTION_RETENTION_H_
14
15
#include <
stdint.h
>
16
#include <stddef.h>
17
#include <
sys/types.h
>
18
#include <
zephyr/kernel.h
>
19
#include <
zephyr/device.h
>
20
#include <
zephyr/types.h
>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
34
43
ssize_t
retention_size
(
const
struct
device
*dev);
44
55
int
retention_is_valid
(
const
struct
device
*dev);
56
68
int
retention_read
(
const
struct
device
*dev,
off_t
offset,
uint8_t
*buffer,
size_t
size);
69
82
int
retention_write
(
const
struct
device
*dev,
off_t
offset,
const
uint8_t
*buffer,
size_t
size);
83
91
int
retention_clear
(
const
struct
device
*dev);
92
96
97
#ifdef __cplusplus
98
}
99
#endif
100
101
#endif
/* ZEPHYR_INCLUDE_RETENTION_RETENTION_H_ */
device.h
retention_write
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),...
retention_read
int retention_read(const struct device *dev, off_t offset, uint8_t *buffer, size_t size)
Reads data from the retention area.
retention_is_valid
int retention_is_valid(const struct device *dev)
Checks if the underlying data in the retention area is valid or not.
retention_clear
int retention_clear(const struct device *dev)
Clears all data in the retention area (sets it to 0).
retention_size
ssize_t retention_size(const struct device *dev)
Returns the size of the retention area.
types.h
kernel.h
Public kernel APIs.
types.h
ssize_t
__SIZE_TYPE__ ssize_t
Definition
types.h:28
off_t
__INTPTR_TYPE__ off_t
Definition
types.h:36
stdint.h
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
zephyr
retention
retention.h
Generated on
for Zephyr API by
1.17.0