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

Main header file for NVMEM API. More...

#include <sys/types.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/devicetree/nvmem.h>

Go to the source code of this file.

Data Structures

struct  nvmem_cell
 Non-Volatile Memory cell representation. More...
 

Macros

#define NVMEM_CELL_INIT(node_id)
 Static initializer for a struct nvmem_cell.
 
#define NVMEM_CELL_GET_BY_NAME(node_id, name)   NVMEM_CELL_INIT(DT_NVMEM_CELL_BY_NAME(node_id, name))
 Static initializer for a struct nvmem_cell.
 
#define NVMEM_CELL_INST_GET_BY_NAME(inst, name)   NVMEM_CELL_GET_BY_NAME(DT_DRV_INST(inst), name)
 Static initializer for a struct nvmem_cell from a DT_DRV_COMPAT instance.
 
#define NVMEM_CELL_GET_BY_NAME_OR(node_id, name, default_value)
 Like NVMEM_CELL_GET_BY_NAME(), with a fallback to a default value.
 
#define NVMEM_CELL_INST_GET_BY_NAME_OR(inst, name, default_value)    NVMEM_CELL_GET_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
 Like NVMEM_CELL_INST_GET_BY_NAME(), with a fallback to a default value.
 
#define NVMEM_CELL_GET_BY_IDX(node_id, idx)   NVMEM_CELL_INIT(DT_NVMEM_CELL_BY_IDX(node_id, idx))
 Static initializer for a struct nvmem_cell.
 
#define NVMEM_CELL_INST_GET_BY_IDX(inst, idx)   NVMEM_CELL_GET_BY_IDX(DT_DRV_INST(inst), idx)
 Static initializer for a struct nvmem_cell from a DT_DRV_COMPAT instance.
 
#define NVMEM_CELL_GET_BY_IDX_OR(node_id, idx, default_value)
 Like NVMEM_CELL_GET_BY_IDX(), with a fallback to a default value.
 
#define NVMEM_CELL_INST_GET_BY_IDX_OR(inst, idx, default_value)    NVMEM_CELL_GET_BY_IDX_OR(DT_DRV_INST(inst), idx, default_value)
 Like NVMEM_CELL_INST_GET_BY_IDX(), with a fallback to a default value.
 

Functions

int nvmem_cell_read (const struct nvmem_cell *cell, void *data, off_t off, size_t len)
 Read data from an NVMEM cell.
 
int nvmem_cell_write (const struct nvmem_cell *cell, const void *data, off_t off, size_t len)
 Write data to an NVMEM cell.
 
static bool nvmem_cell_is_ready (const struct nvmem_cell *cell)
 Validate that the NVMEM cell is ready.
 

Detailed Description

Main header file for NVMEM API.