VLCB
Toggle main menu visibility
Loading...
Searching...
No Matches
EepromExternalStorage.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
10
#include <Arduino.h>
// for definition of byte datatype
11
#include <Wire.h>
12
13
namespace
VLCB
14
{
15
16
class
EepromExternalStorage
:
public
Storage
17
{
18
public
:
19
EepromExternalStorage
(
byte
address);
20
EepromExternalStorage
(
byte
address, TwoWire *bus);
21
virtual
void
begin
(
unsigned
int
size)
override
;
22
23
virtual
byte
read
(
unsigned
int
eeaddress)
override
;
24
virtual
byte
readBytes
(
unsigned
int
eeaddress,
byte
nbytes,
byte
dest[])
override
;
25
virtual
void
write
(
unsigned
int
eeaddress,
byte
data)
override
;
26
virtual
void
writeBytes
(
unsigned
int
eeaddress,
const
byte
src[],
byte
numbytes)
override
;
27
virtual
void
reset
()
override
;
28
29
private
:
30
byte
external_address;
31
TwoWire *I2Cbus;
32
};
33
34
}
Storage.h
VLCB::EepromExternalStorage::writeBytes
virtual void writeBytes(unsigned int eeaddress, const byte src[], byte numbytes) override
Definition
EepromExternalStorage.cpp:119
VLCB::EepromExternalStorage::EepromExternalStorage
EepromExternalStorage(byte address)
Definition
EepromExternalStorage.cpp:13
VLCB::EepromExternalStorage::begin
virtual void begin(unsigned int size) override
Initialise the storage.
Definition
EepromExternalStorage.cpp:25
VLCB::EepromExternalStorage::read
virtual byte read(unsigned int eeaddress) override
read a single byte from EEPROM
Definition
EepromExternalStorage.cpp:44
VLCB::EepromExternalStorage::write
virtual void write(unsigned int eeaddress, byte data) override
write a byte
Definition
EepromExternalStorage.cpp:100
VLCB::EepromExternalStorage::readBytes
virtual byte readBytes(unsigned int eeaddress, byte nbytes, byte dest[]) override
Definition
EepromExternalStorage.cpp:73
VLCB::EepromExternalStorage::reset
virtual void reset() override
clear all event data in external EEPROM chip
Definition
EepromExternalStorage.cpp:145
VLCB::Storage
Interface for persistent storage. Used by Configuration class.
Definition
Storage.h:15
VLCB
Definition
AbstractEventTeachingService.cpp:13
src
EepromExternalStorage.h
Generated by
1.18.0