first publish

Dependents:   eeprom_test eeprom_test MCP3204_test

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers 24LC1025.h Source File

24LC1025.h

00001 #include "mbed.h"
00002 #include "math.h"
00003 // 24LC64 の書き込み、読み込みテスト
00004 
00005 #define ADDRESS_24LC1025_BLOCK0  0xA0 //B0=0,A0=0,A1=0 : 10100000
00006 #define ADDRESS_24LC1025_BLOCK1  0xA8 //B0=1,A0=0,A1=0 : 10101000
00007 
00008 class LC1025{
00009 
00010   public:
00011     LC1025(PinName sda, PinName scl);
00012     LC1025(I2C *i2c);
00013     ~LC1025();
00014 
00015     void writeByte(uint8_t address, uint16_t subAddress, uint8_t data);
00016     void PageWrite(uint8_t address, uint16_t subAddress, char *data, int num);
00017     char RandomRead(uint8_t address, uint16_t subAddress);
00018     char SequentialRead(uint8_t address, uint16_t subAddress);
00019     void readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest);
00020 
00021   private:
00022          I2C *i2c_; 
00023 };