ArduinoMega2560_SPI 1.0
Cargando...
Buscando...
Nada coincide
diagnosticsEEPROM.h
Ir a la documentación de este archivo.
1#ifndef DIAGNOSTICSEEPROM_H
2#define DIAGNOSTICSEEPROM_H
3
4#include <Arduino.h>
5#include <EEPROM.h>
6#include "system/msg/msg.h" // Message handling functions
7
8/**
9 * @brief Provides diagnostic utilities for testing and managing EEPROM memory.
10 */
12public:
13 /**
14 * @brief Runs a diagnostic test on the EEPROM at the specified address.
15 * Writes a test value, reads it back, and verifies integrity.
16 *
17 * @param address EEPROM address to test (default is 0).
18 * @return true if EEPROM responds correctly, false otherwise.
19 */
20 static bool runTest(int address = 0);
21
22 /**
23 * @brief Estimates the amount of free RAM available on the system.
24 * Works on AVR-based boards like Arduino Mega 2560.
25 *
26 * @return Number of free bytes in RAM.
27 */
28 static int getFreeMemory();
29
30private:
31 /**
32 * @brief Value used for EEPROM testing.
33 */
34 static const byte testValue = 123;
35
36 /**
37 * @brief Clears the EEPROM at the specified address by writing 0xFF.
38 *
39 * @param address EEPROM address to clear.
40 */
41 static void clearEEPROM(int address);
42};
43
44/**
45 * @brief [Deprecated] Global version of getFreeMemory().
46 * Prefer using DiagnosticsEEPROM::getFreeMemory() instead.
47 *
48 * @return Number of free bytes in RAM.
49 */
51
52#endif // DIAGNOSTICSEEPROM_H
Provides diagnostic utilities for testing and managing EEPROM memory.
static int getFreeMemory()
Estimates the amount of free RAM available on the system. Works on AVR-based boards like Arduino Mega...
static const byte testValue
Value used for EEPROM testing.
static void clearEEPROM(int address)
Clears the EEPROM at the specified address by writing 0xFF.
static bool runTest(int address=0)
Runs a diagnostic test on the EEPROM at the specified address. Writes a test value,...
int getFreeMemory()
[Deprecated] Global version of getFreeMemory(). Prefer using DiagnosticsEEPROM::getFreeMemory() inste...