VLCB
Toggle main menu visibility
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
14
namespace
VLCB
15
{
16
17
class
DueEepromEmulationStorage
:
public
Storage
18
{
19
public
:
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.
22
DueEepromEmulationStorage
() =
delete
;
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
32
private
:
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
}
Storage.h
VLCB::DueEepromEmulationStorage::reset
virtual void reset() override
clear all event data in external EEPROM chip
Definition
DueEepromEmulationStorage.cpp:91
VLCB::DueEepromEmulationStorage::begin
virtual void begin(unsigned int size) override
Initialise the storage.
Definition
DueEepromEmulationStorage.cpp:15
VLCB::DueEepromEmulationStorage::write
virtual void write(unsigned int eeaddress, byte data) override
write a byte
Definition
DueEepromEmulationStorage.cpp:58
VLCB::DueEepromEmulationStorage::readBytes
virtual byte readBytes(unsigned int eeaddress, byte nbytes, byte dest[]) override
Definition
DueEepromEmulationStorage.cpp:33
VLCB::DueEepromEmulationStorage::writeBytes
virtual void writeBytes(unsigned int eeaddress, const byte src[], byte numbytes) override
Definition
DueEepromEmulationStorage.cpp:69
VLCB::DueEepromEmulationStorage::DueEepromEmulationStorage
DueEepromEmulationStorage()=delete
VLCB::DueEepromEmulationStorage::read
virtual byte read(unsigned int eeaddress) override
read a single byte from EEPROM
Definition
DueEepromEmulationStorage.cpp:23
VLCB::Storage
Interface for persistent storage. Used by Configuration class.
Definition
Storage.h:15
VLCB
Definition
AbstractEventTeachingService.cpp:13
src
DueEepromEmulationStorage.h
Generated by
1.18.0