FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
eeprom.h File Reference

API to handle EEPROM access in read and write modes. More...

#include "boards/board_traits.h"
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include "interrupts.h"
#include "utilities.h"
#include "queue.h"
Include dependency graph for eeprom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  eeprom::EEPROM
 Collection of static methods to read or write the AVR EEPROM. More...
 
class  eeprom::QueuedWriter
 API that allows asynchronous writing to EEPROM; this can be useful when you have large amount of data to write but cannot afford to wait until all bytes have been written. More...
 

Namespaces

 eeprom
 Defines the API for accessing the EEPROM embedded in each AVR MCU.
 

Macros

#define REGISTER_EEPROM_ISR()
 Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly. More...
 
#define REGISTER_EEPROM_ISR_METHOD(HANDLER, CALLBACK)
 Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly, along with a callback method that will be called everytime all pending queued write operations are complete. More...
 
#define REGISTER_EEPROM_ISR_FUNCTION(CALLBACK)
 Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly, along with a callback method that will be called everytime all pending queued write operations are complete. More...
 
#define DECL_EEPROM_ISR_HANDLERS_FRIEND
 This macro shall be used in a class containing a private callback method, registered by REGISTER_EEPROM_ISR_METHOD. More...
 

Detailed Description

API to handle EEPROM access in read and write modes.

Definition in file eeprom.h.

Macro Definition Documentation

◆ REGISTER_EEPROM_ISR

#define REGISTER_EEPROM_ISR ( )
Value:
ISR(EE_READY_vect) \
{ \
eeprom::isr_handler::eeprom_ready(); \
}

Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly.

See also
eeprom::QueuedWriter

Definition at line 36 of file eeprom.h.

◆ REGISTER_EEPROM_ISR_METHOD

#define REGISTER_EEPROM_ISR_METHOD (   HANDLER,
  CALLBACK 
)
Value:
ISR(EE_READY_vect) \
{ \
eeprom::isr_handler::eeprom_ready_method<HANDLER, CALLBACK>(); \
}

Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly, along with a callback method that will be called everytime all pending queued write operations are complete.

Parameters
HANDLERthe class holding the callback method
CALLBACKthe method of HANDLER that will be called when the interrupt is triggered; this must be a proper PTMF (pointer to member function).
See also
eeprom::QueuedWriter

Definition at line 53 of file eeprom.h.

◆ REGISTER_EEPROM_ISR_FUNCTION

#define REGISTER_EEPROM_ISR_FUNCTION (   CALLBACK)
Value:
ISR(EE_READY_vect) \
{ \
eeprom::isr_handler::eeprom_ready_function<CALLBACK>(); \
}

Register the necessary ISR (Interrupt Service Routine) for eeprom::QueuedWriter to work properly, along with a callback method that will be called everytime all pending queued write operations are complete.

Parameters
CALLBACKthe function that will be called when the interrupt is triggered
See also
eeprom::QueuedWriter

Definition at line 69 of file eeprom.h.

◆ DECL_EEPROM_ISR_HANDLERS_FRIEND

#define DECL_EEPROM_ISR_HANDLERS_FRIEND
Value:
friend struct eeprom::isr_handler; \
friend void ::EE_READY_vect();

This macro shall be used in a class containing a private callback method, registered by REGISTER_EEPROM_ISR_METHOD.

It declares the class where it is used as a friend of all necessary functions so that the private callback method can be called properly.

Definition at line 81 of file eeprom.h.