Loading...
Searching...
No Matches
eeprom.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Inria
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
22#ifndef PERIPH_EEPROM_H
23#define PERIPH_EEPROM_H
24
25#include <stdint.h>
26
27#include "periph_cpu.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#ifndef EEPROM_SIZE
34#error "periph/eeprom: EEPROM_SIZE is not defined"
35#endif
36
40#ifndef EEPROM_CLEAR_BYTE
41#define EEPROM_CLEAR_BYTE 0x00
42#endif
43
51uint8_t eeprom_read_byte(uint32_t pos);
52
65size_t eeprom_read(uint32_t pos, void *data, size_t len);
66
73void eeprom_write_byte(uint32_t pos, uint8_t data);
74
87size_t eeprom_write(uint32_t pos, const void *data, size_t len);
88
98size_t eeprom_set(uint32_t pos, uint8_t val, size_t len);
99
110size_t eeprom_clear(uint32_t pos, size_t len);
111
117size_t eeprom_erase(void);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* PERIPH_EEPROM_H */
size_t eeprom_clear(uint32_t pos, size_t len)
Clear len bytes from the given position pos.
uint8_t eeprom_read_byte(uint32_t pos)
Read a byte at the given position in eeprom.
void eeprom_write_byte(uint32_t pos, uint8_t data)
Write a byte at the given position.
size_t eeprom_read(uint32_t pos, void *data, size_t len)
Read len bytes from the given position.
size_t eeprom_erase(void)
Erase the whole EEPROM content.
size_t eeprom_write(uint32_t pos, const void *data, size_t len)
Write len bytes at the given position.
size_t eeprom_set(uint32_t pos, uint8_t val, size_t len)
Set len bytes from the given position pos with value val.