MySensors Library & Examples  2.3.2
SoftEeprom.h
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2019 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
19 
25 #ifndef SoftEeprom_h
26 #define SoftEeprom_h
27 
28 #include <stdint.h>
29 
34 {
35 
36 public:
40  SoftEeprom();
44  SoftEeprom(const SoftEeprom& other);
48  ~SoftEeprom();
56  int init(const char *fileName, size_t length);
61  void destroy();
69  void readBlock(void* buf, void* addr, size_t length);
77  void writeBlock(void* buf, void* addr, size_t length);
84  uint8_t readByte(int addr);
91  void writeByte(int addr, uint8_t value);
96  SoftEeprom& operator=(const SoftEeprom& other);
97 
98 private:
99  size_t _length;
100  char *_fileName;
101  uint8_t *_values;
102 };
103 
104 #endif
SoftEeprom::readByte
uint8_t readByte(int addr)
Read a byte from eeprom.
SoftEeprom::init
int init(const char *fileName, size_t length)
Initializes the eeprom class.
SoftEeprom::destroy
void destroy()
Clear all allocated memory variables.
SoftEeprom::~SoftEeprom
~SoftEeprom()
SoftEeprom destructor.
SoftEeprom::readBlock
void readBlock(void *buf, void *addr, size_t length)
Read a block of bytes from eeprom.
SoftEeprom::operator=
SoftEeprom & operator=(const SoftEeprom &other)
Overloaded assign operator.
SoftEeprom::writeBlock
void writeBlock(void *buf, void *addr, size_t length)
Write a block of bytes to eeprom.
SoftEeprom::SoftEeprom
SoftEeprom()
SoftEeprom constructor.
SoftEeprom::writeByte
void writeByte(int addr, uint8_t value)
Write a byte to eeprom.
SoftEeprom
Definition: SoftEeprom.h:33