COSA
An Object-Oriented Platform for Arduino Programming
EEPROM.cpp
Go to the documentation of this file.
1 
21 #include "Cosa/EEPROM.hh"
22 
23 bool
25 {
26  return (eeprom_is_ready());
27 }
28 
29 int
30 EEPROM::Device::read(void* dest, const void* src, size_t size)
31 {
32  uint8_t* dp = (uint8_t*) dest;
33  const uint8_t* sp = (const uint8_t*) src;
34  size_t res = size;
35  while (size--) *dp++ = eeprom_read_byte(sp++);
36  return (res);
37 }
38 
39 int
40 EEPROM::Device::write(void* dest, const void* src, size_t size)
41 {
42  uint8_t* dp = (uint8_t*) dest;
43  const uint8_t* sp = (const uint8_t*) src;
44  size_t res = size;
45  while (size--) eeprom_write_byte(dp++, *sp++);
46  return (res);
47 }
48 
static Device eeprom
Definition: EEPROM.hh:75
virtual int write(void *dest, const void *src, size_t size)
Definition: EEPROM.cpp:40
virtual int read(void *dest, const void *src, size_t size)
Definition: EEPROM.cpp:30
virtual bool is_ready()
Definition: EEPROM.cpp:24