Interface to Analog devices AD5258 digital I2C potentiometer
Diff: AD5258.h
- Revision:
- 1:64570234d7b5
- Parent:
- 0:8920c7d857d8
- Child:
- 2:8a71db02417b
--- a/AD5258.h Mon Nov 11 11:00:35 2013 +0000 +++ b/AD5258.h Mon Nov 11 13:08:08 2013 +0000 @@ -21,11 +21,41 @@ */ int read(); - /** Write to the IO pins + /** Write to the RDAC * * @param data The 6-bits value: 0x00 to 0x3F to write to the pots RDAC */ void write(int data); + + // READ and WRITE EEPROM + + /** Read the EEPROM value + * + * @return The 6-bit value read + */ + int readEE(); + + /** Write to the RDAC + * + * @param data The 6-bits value: 0x00 to 0x3F to write to the pots RDAC + */ + void writeEE(int data); + + + + + // STORE and RESTORE: + + /** store the RDAC value into the EEPROM, for nonvolatile keeping of the value + * + */ + void store(void); + + /** restore to the RDAC the value from the EEPROM. NOP issued afterward, to put back into low-power idle mode + * + */ + void restore(void); + private: I2C _i2c;