COSA
An Object-Oriented Platform for Arduino Programming
|
#include <AT24CXX.hh>
Public Member Functions | |
AT24CXX (uint8_t subaddr=0, const size_t size=32, const uint16_t page_max=32) | |
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) |
Public Attributes | |
const size_t | SIZE |
const uint16_t | PAGE_MAX |
Static Public Attributes | |
static Device | eeprom |
Private Member Functions | |
bool | is_async () const |
void | sync_request () |
void | async_request () |
virtual void | on_completion (uint8_t type, int count) |
Private Attributes | |
uint8_t | m_addr |
bool | m_async |
Driver for the AT24CXX 2-Wire Serial EEPROM. Allows page write and block read. Supports device AT24C32 (8K) to AT24C512 (64K). Default AT24CXX device is AT24C32.
The TinyRTC with DS1307 also contains a 24C32 EEPROM.
Definition at line 48 of file AT24CXX.hh.
|
inline |
Construct AT24CXX serial TWI EEPROM device access to given chip address, page and memory size.
[in] | subaddr | chip address (0..7, default 0). |
[in] | size | in Kbits (default 32). |
[in] | page_max | size of memory page (default 32 byte). |
Definition at line 67 of file AT24CXX.hh.
|
virtual |
Return true(1) if the device is ready, write cycle is completed, otherwise false(0).
Reimplemented from EEPROM::Device.
Definition at line 47 of file AT24CXX.cpp.
|
virtual |
Read rom block with the given size into the buffer from the address. Return number of bytes read or negative error code.
[in] | dest | buffer to read from rom. |
[in] | src | address in rom to read from. |
[in] | size | number of bytes to read. |
Reimplemented from EEPROM::Device.
Definition at line 57 of file AT24CXX.cpp.
|
virtual |
Write rom block at given address with the contents from the buffer. Return number of bytes written or negative error code.
[in] | dest | address in rom to read write to. |
[in] | src | buffer to write to rom. |
[in] | size | number of bytes to write. |
Reimplemented from EEPROM::Device.
Definition at line 66 of file AT24CXX.cpp.
|
staticinherited |
const uint16_t AT24CXX::PAGE_MAX |
Number of bytes in max write page size.
Definition at line 58 of file AT24CXX.hh.
const size_t AT24CXX::SIZE |
Number of bytes on device.
Definition at line 53 of file AT24CXX.hh.