Driver, C++ code, and library for the MAX5487, MAX5488, MAX5489. dual channel, SPI bus, 256-tap digital potentiometer. Non-volatile memory (EEPROM) is available for returning the wipers to their previously stored positions upon power-up.

Dependents:   MAX5487_Digital_Potentiometer_Resistor_MAX32630FTHR_Host

Committer:
jungkeviny
Date:
Tue Jul 10 05:28:12 2018 +0000
Revision:
0:3d525ab09933
Child:
1:bc368afe2ec8
initial commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jungkeviny 0:3d525ab09933 1 #ifndef MAX5487_H
jungkeviny 0:3d525ab09933 2 #define MAX5487_H
jungkeviny 0:3d525ab09933 3
jungkeviny 0:3d525ab09933 4 #include "mbed.h"
jungkeviny 0:3d525ab09933 5
jungkeviny 0:3d525ab09933 6
jungkeviny 0:3d525ab09933 7 class MAX5487{
jungkeviny 0:3d525ab09933 8
jungkeviny 0:3d525ab09933 9 typedef enum {
jungkeviny 0:3d525ab09933 10 Wiper_RegA = 0x01; //Position of Wiper A
jungkeviny 0:3d525ab09933 11 Wiper_RegB = 0x02; //Position of Wiper B
jungkeviny 0:3d525ab09933 12 NV_RegA = 0x11; //Non Volatile Register A
jungkeviny 0:3d525ab09933 13 NV_RegB = 0x12; //Non Volatile Register B
jungkeviny 0:3d525ab09933 14 Copy_Wiper_RegA_to_NV_RegA = 0x21; //Copy Wiper A position to Non Volatile Register A
jungkeviny 0:3d525ab09933 15 Copy_Wiper_RegB_to_NV_RegB = 0x22; //Copy Wiper B position to Non Volatile Register B
jungkeviny 0:3d525ab09933 16 Copy_Wiper_RegAB_to_NV_RegAB = 0x23; //Copy both Wiper A & B positions to respective Non Volatile Registers
jungkeviny 0:3d525ab09933 17 Copy_NV_RegA_to_Wiper_RegA = 0x31; //Copy Non Volatile Register A to Wiper Register A
jungkeviny 0:3d525ab09933 18 Copy_NV_RegB_to_Wiper_RegB = 0x32; //Copy Non Volatile Register B to Wiper Register B
jungkeviny 0:3d525ab09933 19 Copy_NV_RegAB_to_Wiper_RegAB = 0x33; //Copy Non Volatile Register A & B to Wiper Register A & B
jungkeviny 0:3d525ab09933 20 } setting_t;
jungkeviny 0:3d525ab09933 21 public:
jungkeviny 0:3d525ab09933 22 MAX5487(SPI spi);
jungkeviny 0:3d525ab09933 23
jungkeviny 0:3d525ab09933 24 writeCommand(setting_t test, int value);
jungkeviny 0:3d525ab09933 25
jungkeviny 0:3d525ab09933 26 ~MAX5487();
jungkeviny 0:3d525ab09933 27 }