20#ifndef EEPROM_DISPLAY_H
21#define EEPROM_DISPLAY_H
32 #if defined(ARDUINO) && ARDUINO >= 100
34 #elif defined(PARTICLE)
35 #define DEBUG USBSerial
42#if defined(ARDUINO) && ARDUINO >= 100
45#elif defined(PARTICLE)
54#define LINE_WIDTH (WIDTH * 3) + 8
101 this->drawLine(
WIDTH + 2);
116 for(uint i = 0; i <
WIDTH; i++)
119 sprintf(b,
"%2u ", i);
120 buffer[(i * 3) + 7] = b[0];
121 buffer[(i * 3) + 8] = b[1];
122 buffer[(i * 3) + 9] = b[2];
133 this->drawLine(
WIDTH + 2);
138 uint maxLines = EEPROM.length() /
WIDTH;
141 for (uint row = 0; row < maxLines; row++)
143 uint lineNumber = row *
WIDTH;
144 sprintf(buffer,
"%4d | ", lineNumber);
146 for(uint j = 0; j <
WIDTH; j++)
149 sprintf(b,
"%.2X ", (
byte)EEPROM[i++]);
150 buffer[(j * 3) + 7] = b[0];
151 buffer[(j * 3) + 8] = b[1];
152 buffer[(j * 3) + 9] = b[2];
167 DEBUG_INFO(
"%s: Variable Size: %2d, Memory Length = %2d, Start Address = %2d, Checksum Address = %2d, Checksum Value = %2d, Initialized = %s",
188 void drawLine(uint width)
This file contains the EEPROMBase<T> definition.
#define DEBUG_INFO(fmt,...)
#define WIDTH
Define a Serial port to used for displaying output.
Base class to wrap an EEPROM variable.
uint checksumAddress() const
Gets the address of the checksum byte in EEPROM for this variable.
bool isInitialized() const
Checks whether the EEPROM variable has been initialized.
uint size() const
Returns the number of EEPROM bytes used by T.
byte checksumByte() const
Gets the stored checksum byte.
uint length() const
Returns the number of EEPROM bytes used.
uint getAddress() const
Get the EEPROM address of the variable.
Provides methods to display EEPROM data for debugging.
void displayPaddedHexByte(byte value, bool showPrefix=true)
Print a byte value in HEX with leading 0x.
void displayEEPROM()
Displays the contents of the EEPROM.
void displayHeader()
Display a header that can be used for listing variable properties.
void displayVariable(const char *name, EEPROMBase< T > value)
Display the properties of a variable.
void begin()
Sets default behavior for the Arduino Debug Utils library.