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
Revision 2:16ce7dae9019, committed 2013-07-18
- Comitter:
- Yann
- Date:
- Thu Jul 18 05:34:34 2013 +0000
- Parent:
- 1:bdf87ab4cdb8
- Commit message:
- Add new test unit
Changed in this revision
| 24LCxx_I2C.cpp | Show annotated file Show diff for this revision Revisions of this file |
| 24LCxx_I2C.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/24LCxx_I2C.cpp Fri Jan 25 09:24:05 2013 +0000
+++ b/24LCxx_I2C.cpp Thu Jul 18 05:34:34 2013 +0000
@@ -25,7 +25,7 @@
unsigned char C24LCXX_I2C::I2CModuleRefCounter = 0;
- C24LCXX_I2C::C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const PinName p_wp, const int p_frequency) : _internalId("") {
+ C24LCXX_I2C::C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const PinName p_wp, const unsigned int p_frequency) : _internalId("") {
DEBUG_ENTER("C24LCXX_I2C")
if (C24LCXX_I2C::I2CModuleRefCounter != 0) {
--- a/24LCxx_I2C.h Fri Jan 25 09:24:05 2013 +0000
+++ b/24LCxx_I2C.h Thu Jul 18 05:34:34 2013 +0000
@@ -76,7 +76,7 @@
* - If A1 and A2 pins are tired to Vdd and A0 is tired to Vss, address shall '00000110'B
* - If A0 and A1 pins are tired to Vss and A2 is tired to Vdd, address shall '00000100'B
*/
- C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const PinName p_wp = NC, const int p_frequency = 400000);
+ C24LCXX_I2C(const PinName p_sda, const PinName p_scl, const unsigned char p_address, const PinName p_wp = NC, const unsigned int p_frequency = 400000);
/** Destructor
*/
@@ -88,7 +88,7 @@
/** Erase of memory area starting at the specified address, using the specified pattern to fill the memory area
*
- * @paramp_startAddress The address of the memory area (from 0 to N - 1, N is the number of cells of the memory)
+ * @param p_startAddress The address of the memory area (from 0 to N - 1, N is the number of cells of the memory)
* @param p_count The size of the memory area to erase
* @param p_pattern The pattern value to use to fill the memory area. Default vqlue: 0x00
* @return true on success, false otherwise
@@ -99,7 +99,7 @@
* ...
* @endcode
*/
- bool EraseMemoryArea(const short p_startAddress, const int p_count, unsigned char const p_pattern = 0x00);
+ bool EraseMemoryArea(const short p_startAddress, const int p_count, const unsigned char p_pattern = 0x00);
/** Write a byte at the specified memory address
*
Yann Garcia
24LCxx Serial EEPROM library