M24LC256 v1
|
00001 /* 00002 Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License 00006 version 2 as published by the Free Software Foundation. 00007 */ 00008 00009 #include <WProgram.h> 00010 00026 class M24LC256 00027 { 00028 protected: 00032 uint8_t i2c_address; 00033 00052 uint16_t WriteChunk(uint16_t location, uint16_t length, uint8_t* data); 00053 00066 uint16_t ReadChunk(uint16_t location, uint16_t length, uint8_t* data); 00067 00069 public: 00076 M24LC256(uint8_t _address); 00077 00087 void begin(void); 00088 00103 void write(uint16_t location, void* buf, uint16_t len); 00104 00123 uint16_t read(uint16_t location, void* buf, uint16_t len); 00124 }; 00125 00144 // vim:ci:sw=4 sts=4 ft=cpp