Loading...
Searching...
No Matches
eeprom.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include <stdint.h>
22
23#include "periph_cpu.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#ifndef EEPROM_SIZE
30#error "periph/eeprom: EEPROM_SIZE is not defined"
31#endif
32
36#ifndef EEPROM_CLEAR_BYTE
37#define EEPROM_CLEAR_BYTE 0x00
38#endif
39
47uint8_t eeprom_read_byte(uint32_t pos);
48
61size_t eeprom_read(uint32_t pos, void *data, size_t len);
62
69void eeprom_write_byte(uint32_t pos, uint8_t data);
70
83size_t eeprom_write(uint32_t pos, const void *data, size_t len);
84
94size_t eeprom_set(uint32_t pos, uint8_t val, size_t len);
95
106size_t eeprom_clear(uint32_t pos, size_t len);
107
113size_t eeprom_erase(void);
114
115#ifdef __cplusplus
116}
117#endif
118
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.