Arduino-Storage
External Memory Storage library for Arduino
EEPROM Class Reference

#include <EEPROM.h>

Inheritance diagram for EEPROM:
Inheritance graph
Collaboration diagram for EEPROM:
Collaboration graph

Public Member Functions

 EEPROM ()
 
virtual int read (void *dst, uint32_t src, size_t count)
 
virtual int write (uint32_t dst, const void *src, size_t count)
 
uint32_t room ()
 
uint32_t alloc (size_t count)
 
void free (uint32_t addr)
 

Public Attributes

const uint32_t SIZE
 

Protected Attributes

uint32_t m_addr
 

Detailed Description

Storage device driver for the AVR internal EEPROM.

Definition at line 27 of file EEPROM.h.

Constructor & Destructor Documentation

EEPROM::EEPROM ( )
inline

Construct EEPROM device driver with storage size.

Definition at line 32 of file EEPROM.h.

Member Function Documentation

uint32_t Storage::alloc ( size_t  count)
inlineinherited

Allocate block with given number of bytes on storage. Returns storage address if successful otherwise UINT32_MAX.

Parameters
[in]countnumber of bytes.
Returns
address of allocated block, otherwise UINT32_MAX.

Definition at line 53 of file Storage.h.

void Storage::free ( uint32_t  addr)
inlineinherited

Reset allocation point to given address.

Parameters
[in]addraddress of allocated block.

Definition at line 65 of file Storage.h.

virtual int EEPROM::read ( void *  dst,
uint32_t  src,
size_t  count 
)
inlinevirtual

Read eeprom block with the given size into the buffer from the source address. Return number of bytes read or negative error code.

Parameters
[in]dstbuffer to read from eeprom.
[in]srcaddress in eeprom to read from.
[in]countnumber of bytes to read.
Returns
number of bytes or negative error code.

Implements Storage.

Definition at line 44 of file EEPROM.h.

uint32_t Storage::room ( )
inlineinherited

Returns number of bytes that may be allocated.

Returns
number of bytes.

Definition at line 42 of file Storage.h.

virtual int EEPROM::write ( uint32_t  dst,
const void *  src,
size_t  count 
)
inlinevirtual

Write eeprom block at given destination address with the contents from the buffer. Return number of bytes written or negative error code.

Parameters
[in]dstaddress in eeprom to read write to.
[in]srcbuffer to write to eeprom.
[in]countnumber of bytes to write.
Returns
number of bytes or negative error code.

Implements Storage.

Definition at line 60 of file EEPROM.h.

Member Data Documentation

uint32_t Storage::m_addr
protectedinherited

Address of the next allocation.

Definition at line 398 of file Storage.h.

const uint32_t Storage::SIZE
inherited

Number of bytes on device.

Definition at line 30 of file Storage.h.


The documentation for this class was generated from the following file: