COSA
An Object-Oriented Platform for Arduino Programming
EEPROM::Device Class Reference

#include <EEPROM.hh>

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

Public Member Functions

virtual bool is_ready ()
 
virtual int read (void *dest, const void *src, size_t size)
 
virtual int write (void *dest, const void *src, size_t size)
 

Static Public Attributes

static Device eeprom
 

Detailed Description

EEPROM Device abstraction; default device is the processors internal EEPROM data memory. New devices should sub-class and implement virtual methods.

Definition at line 40 of file EEPROM.hh.

Member Function Documentation

bool EEPROM::Device::is_ready ( )
virtual

Return true(1) if the device is ready, write cycle is completed, otherwise false(0).

Returns
bool.

Reimplemented in AT24CXX.

Definition at line 24 of file EEPROM.cpp.

int EEPROM::Device::read ( void *  dest,
const void *  src,
size_t  size 
)
virtual

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

Parameters
[in]destbuffer to read from rom into.
[in]srcaddress in rom to read from.
[in]sizenumber of bytes to read.
Returns
number of bytes or negative error code.

Reimplemented in AT24CXX.

Definition at line 30 of file EEPROM.cpp.

int EEPROM::Device::write ( void *  dest,
const void *  src,
size_t  size 
)
virtual

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

Parameters
[in]destaddress in rom to write to.
[in]srcbuffer to write to rom.
[in]sizenumber of bytes to write.
Returns
number of bytes or negative error code.

Reimplemented in AT24CXX.

Definition at line 40 of file EEPROM.cpp.

Member Data Documentation

EEPROM::Device EEPROM::Device::eeprom
static

Default EEPROM device; handling of internal EEPROM Data Memory.

Definition at line 75 of file EEPROM.hh.


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