Interface to Analog devices AD5258 digital I2C potentiometer
Diff: AD5258.h
- Revision:
- 2:8a71db02417b
- Parent:
- 1:64570234d7b5
- Child:
- 3:f5b60d166896
--- a/AD5258.h Mon Nov 11 13:08:08 2013 +0000 +++ b/AD5258.h Tue Nov 12 12:57:07 2013 +0000 @@ -3,7 +3,21 @@ #ifndef MBED_AD5258_H #define MBED_AD5258_H -// Interface to the AD5258 I2C 6-Bit digital Potentiometer +// Interface to the AD5258 I2C 64-step (0x00 to 0x3F)6-Bit digital Potentiometer + +// measure reference voltage on the pin6 of U3 LM293 +// be sure to remove R11, and check R4 is 220 + +/*Examples: RDAC = +0x00, Vref=1,0V +0x03, Vref=1,1V +0x05, Vref=1,2V +0x0F, Vref=1,5V +0x20, Vref=1,82V // default +0x30, Vref=2,0V +0x3F, Vref=2,2V +*/ + class AD5258 { public: @@ -55,6 +69,17 @@ * */ void restore(void); + + + /** update write protect bit + * + * @param enable: TRUE to SET WP, FALSE to lift WP + */ + + void writeProtect(bool enable); + + // TODO: tolerance register access + private: