@ -3,27 +3,36 @@
# include <inttypes.h>
# define DPOT_WADDR 0x28
# define DPOT_RADDR DPOT_WADDR | 0x01
/**
* Address byte selection
* Select 0 for low and 1 for high
* */
# define DS1803_A0 0
# define DS1803_A1 0
# define DS1803_A2 0
# define DS1803_BASE_ADDR B00101000
# define DS1803_WADDR DS1803_BASE_ADDR | (DS1803_A0 * B00000001) | (DS1803_A1 * B00000010) | (DS1803_A2 * B00000100)
# define DS1803_RADDR DS1803_WADDR | 0x01
/**
* The number of available potentiometer wipers
* */
# define DPOT_NBR_WIPERS 0x02
# define D S1803 _NBR_WIPERS 0x02
/**
* Digital pot selection commands
* */
# define D POT_WIPERS B10101111
# define D POT _WIPER_0 B10101001
# define D POT _WIPER_1 B10101010
# define D S1803_WIPERS B10101111
# define D S1803 _WIPER_0 B10101001
# define D S1803 _WIPER_1 B10101010
/**
* Macros
* */
# define setWiper1(value) setWiper(value, D POT _WIPER_0)
# define setWiper2(value) setWiper(value, D POT _WIPER_1)
# define setWipers(value) setWiper(value, D POT _WIPERS)
# define setWiper1(value) setWiper(value, D S1803 _WIPER_0)
# define setWiper2(value) setWiper(value, D S1803 _WIPER_1)
# define setWipers(value) setWiper(value, D S1803 _WIPERS)
/**
* DS1803 I2C Dual Digital Pot .