This class provides simplified I2C access to a Microchip 24LCxx Serial EEPROM device: - Rename the class (C2424 -> C24) - Add EraseMemoryArea method - Add DumpMemoryArea method only accessible in DEBUG mode - Add 'const' qualifier in parameters
Fork of 24LCxx_I2C by
Diff: 24LCxx_I2C.h
- Revision:
- 5:2f61885d8bc3
- Parent:
- 4:650f3259bd4f
--- a/24LCxx_I2C.h Wed Apr 25 09:37:34 2018 -0500 +++ b/24LCxx_I2C.h Thu Sep 13 09:56:13 2018 -0500 @@ -40,15 +40,15 @@ BigEndian //<! Little Endian mode: 0xA0B70708 is stored as AO: MSB and 08 LSB }; public: - C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const unsigned int p_frequency = 400000); + C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const uint32_t p_frequency = 400000); virtual ~C24LCXX_I2C(); - bool Write(const short p_address, const unsigned char p_byte); - bool Write(const short p_address, const short p_short, const C24LCXX_I2C::Mode p_mode = BigEndian); - bool Write(const short p_address, const int p_int, const C24LCXX_I2C::Mode p_mode = BigEndian); - bool Read(const short p_address, unsigned char *p_value); - bool Read(const short p_address, short *p_short, C24LCXX_I2C::Mode p_mode = BigEndian); - bool Read(const short p_address, int *p_int, C24LCXX_I2C::Mode p_mode = BigEndian); + bool Write(const uint16_t p_address, const uint8_t p_byte); + bool Write(const uint16_t p_address, const uint16_t p_short, const C24LCXX_I2C::Mode p_mode = BigEndian); + bool Write(const uint16_t p_address, const uint32_t p_int, const C24LCXX_I2C::Mode p_mode = BigEndian); + bool Read(const uint16_t p_address, unsigned char *p_value); + bool Read(const uint16_t p_address, uint16_t *p_short, C24LCXX_I2C::Mode p_mode = BigEndian); + bool Read(const uint16_t p_address, uint32_t *p_int, C24LCXX_I2C::Mode p_mode = BigEndian); private: }; // End of class C24LCXX_I2C