Loading...
Searching...
No Matches
nvram.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Eistec AB
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
27#ifndef NVRAM_H
28#define NVRAM_H
29
30#include <stdint.h>
31#include <stddef.h>
32
33#if MODULE_VFS
34#include "vfs.h"
35#endif
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/* Forward declaration in order to declare function pointers which take this
42 * type as a parameter within the struct. */
43struct nvram;
44
48typedef struct nvram {
62 int (*read)(struct nvram *dev, uint8_t *dst, uint32_t src, size_t size);
63
77 int (*write)(struct nvram *dev, const uint8_t *src, uint32_t dst, size_t size);
78
80 size_t size;
81
83 void *extra;
85
86#if MODULE_VFS
87extern const vfs_file_ops_t nvram_vfs_ops;
88#endif
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* NVRAM_H */
struct nvram nvram_t
Device descriptor for generic NVRAM devices.
Device descriptor for generic NVRAM devices.
Definition nvram.h:48
void * extra
Device-specific parameters, if any.
Definition nvram.h:83
int(* write)(struct nvram *dev, const uint8_t *src, uint32_t dst, size_t size)
Pointer to device-specific write function.
Definition nvram.h:77
size_t size
Device capacity.
Definition nvram.h:80
int(* read)(struct nvram *dev, uint8_t *dst, uint32_t src, size_t size)
Pointer to device-specific read function.
Definition nvram.h:62
Operations on open files.
Definition vfs.h:436