VLCB
Loading...
Searching...
No Matches
DueEepromEmulationStorage.h
Go to the documentation of this file.
1// Copyright (C) Sven Rosvall (sven@rosvall.ie)
2// This file is part of VLCB-Arduino project on https://github.com/SvenRosvall/VLCB-Arduino
3// Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
4// The full licence can be found at: http://creativecommons.org/licenses/by-nc-sa/4.0/
5
6#pragma once
7
8#include "Storage.h"
9#ifdef __SAM3X8E__
10#include <DueFlashStorage.h>
11#endif
12
13
14namespace VLCB
15{
16
18{
19public:
20#ifndef __SAM3X8E__
21// If not SAM3X8E then this file shall be compilable but this class shall not be instantiatable and will not compile if used anyway.
23#endif
24 virtual void begin(unsigned int size) override;
25
26 virtual byte read(unsigned int eeaddress) override;
27 virtual byte readBytes(unsigned int eeaddress, byte nbytes, byte dest[]) override;
28 virtual void write(unsigned int eeaddress, byte data) override;
29 virtual void writeBytes(unsigned int eeaddress, const byte src[], byte numbytes) override;
30 virtual void reset() override;
31
32private:
33 byte getChipEEPROMVal(unsigned int eeaddress);
34 void setChipEEPROMVal(unsigned int eeaddress, byte val);
35
36#ifdef __SAM3X8E__
37 DueFlashStorage dueFlashStorage;
38#endif
39};
40
41}
virtual void reset() override
clear all event data in external EEPROM chip
Definition DueEepromEmulationStorage.cpp:91
virtual void write(unsigned int eeaddress, byte data) override
write a byte
Definition DueEepromEmulationStorage.cpp:58
virtual byte readBytes(unsigned int eeaddress, byte nbytes, byte dest[]) override
Definition DueEepromEmulationStorage.cpp:33
virtual void writeBytes(unsigned int eeaddress, const byte src[], byte numbytes) override
Definition DueEepromEmulationStorage.cpp:69
virtual byte read(unsigned int eeaddress) override
read a single byte from EEPROM
Definition DueEepromEmulationStorage.cpp:23
Interface for persistent storage. Used by Configuration class.
Definition Storage.h:15
Definition AbstractEventTeachingService.cpp:13
void begin()
Definition VLCB.cpp:181