no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
no_os_eeprom.h
Go to the documentation of this file.
1/***************************************************************************/
33
34#ifndef _NO_OS_EEPROM_H_
35#define _NO_OS_EEPROM_H_
36
37#include <stdint.h>
38
39
40/* Forward declaration of structure */
42
54
66
74 int32_t (*init)(struct no_os_eeprom_desc **,
75 const struct no_os_eeprom_init_param *);
77 int32_t (*write)(struct no_os_eeprom_desc *, uint32_t, uint8_t *, uint16_t);
79 int32_t (*read)(struct no_os_eeprom_desc *, uint32_t, uint8_t *, uint16_t);
81 int32_t (*remove)(struct no_os_eeprom_desc *);
82};
83
84/* Initialize the EEPROM */
85int32_t no_os_eeprom_init(struct no_os_eeprom_desc **desc,
86 const struct no_os_eeprom_init_param *param);
87
88/* Write into EEPROM */
89int32_t no_os_eeprom_write(struct no_os_eeprom_desc *desc, uint32_t address,
90 uint8_t *data, uint16_t bytes);
91
92/* Read from EEPROM */
93int32_t no_os_eeprom_read(struct no_os_eeprom_desc *desc, uint32_t address,
94 uint8_t *data, uint16_t bytes);
95
96/* Free the resources allocated by no_os_eeprom_init() */
97int32_t no_os_eeprom_remove(struct no_os_eeprom_desc *desc);
98
99#endif // _NO_OS_EEPROM_H_
int32_t no_os_eeprom_init(struct no_os_eeprom_desc **desc, const struct no_os_eeprom_init_param *param)
Initialize the EEPROM.
Definition no_os_eeprom.c:45
int32_t no_os_eeprom_remove(struct no_os_eeprom_desc *desc)
Free the resources allocated by no_os_eeprom_init()
Definition no_os_eeprom.c:70
int32_t no_os_eeprom_read(struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
Read the EEPROM data.
Definition no_os_eeprom.c:109
int32_t no_os_eeprom_write(struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
Write the EEPROM data.
Definition no_os_eeprom.c:89
Structure holding the EEPROM descriptor.
Definition no_os_eeprom.h:59
void * extra
Definition no_os_eeprom.h:64
const struct no_os_eeprom_platform_ops * platform_ops
Definition no_os_eeprom.h:62
uint32_t device_id
Definition no_os_eeprom.h:61
Structure holding the parameters for EEPROM initialization.
Definition no_os_eeprom.h:47
uint32_t device_id
Definition no_os_eeprom.h:49
const struct no_os_eeprom_platform_ops * platform_ops
Definition no_os_eeprom.h:50
void * extra
Definition no_os_eeprom.h:52
Structure holding the EEPROM function pointers that point to the platform specific function.
Definition no_os_eeprom.h:72
int32_t(* write)(struct no_os_eeprom_desc *, uint32_t, uint8_t *, uint16_t)
Definition no_os_eeprom.h:77
int32_t(* init)(struct no_os_eeprom_desc **, const struct no_os_eeprom_init_param *)
Definition no_os_eeprom.h:74
int32_t(* remove)(struct no_os_eeprom_desc *)
Definition no_os_eeprom.h:81
int32_t(* read)(struct no_os_eeprom_desc *, uint32_t, uint8_t *, uint16_t)
Definition no_os_eeprom.h:79