Loading...
Searching...
No Matches
nvram.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Eistec AB
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
25
26#include <stdint.h>
27#include <stddef.h>
28
29#if MODULE_VFS
30#include "vfs.h"
31#endif
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/* Forward declaration in order to declare function pointers which take this
38 * type as a parameter within the struct. */
39struct nvram;
40
44typedef struct nvram {
58 int (*read)(struct nvram *dev, uint8_t *dst, uint32_t src, size_t size);
59
73 int (*write)(struct nvram *dev, const uint8_t *src, uint32_t dst, size_t size);
74
76 size_t size;
77
79 void *extra;
81
82#if MODULE_VFS
83extern const vfs_file_ops_t nvram_vfs_ops;
84#endif
85
86#ifdef __cplusplus
87}
88#endif
89
struct nvram nvram_t
Device descriptor for generic NVRAM devices.
struct vfs_file_ops vfs_file_ops_t
struct vfs_file_ops typedef
Definition vfs.h:358
Device descriptor for generic NVRAM devices.
Definition nvram.h:44
void * extra
Device-specific parameters, if any.
Definition nvram.h:79
int(* write)(struct nvram *dev, const uint8_t *src, uint32_t dst, size_t size)
Pointer to device-specific write function.
Definition nvram.h:73
size_t size
Device capacity.
Definition nvram.h:76
int(* read)(struct nvram *dev, uint8_t *dst, uint32_t src, size_t size)
Pointer to device-specific read function.
Definition nvram.h:58