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

MAX5487.h

Committer:
jungkeviny
Date:
2018-07-10
Revision:
0:3d525ab09933
Child:
1:bc368afe2ec8

File content as of revision 0:3d525ab09933:

#ifndef MAX5487_H
#define MAX5487_H

#include "mbed.h"


class MAX5487{

    typedef enum {
        Wiper_RegA = 0x01;                        //Position of Wiper A
        Wiper_RegB = 0x02;                        //Position of Wiper B
        NV_RegA = 0x11;                           //Non Volatile Register A 
        NV_RegB = 0x12;                           //Non Volatile Register B 
        Copy_Wiper_RegA_to_NV_RegA   = 0x21;      //Copy Wiper A position to Non Volatile Register A
        Copy_Wiper_RegB_to_NV_RegB   = 0x22;      //Copy Wiper B position to Non Volatile Register B
        Copy_Wiper_RegAB_to_NV_RegAB = 0x23;      //Copy both Wiper A & B positions to respective Non Volatile Registers
        Copy_NV_RegA_to_Wiper_RegA   = 0x31;      //Copy Non Volatile Register A to Wiper Register A
        Copy_NV_RegB_to_Wiper_RegB   = 0x32;      //Copy Non Volatile Register B to Wiper Register B
        Copy_NV_RegAB_to_Wiper_RegAB = 0x33;      //Copy Non Volatile Register A & B to Wiper Register A & B
    } setting_t;
    public:
    MAX5487(SPI spi); 

    writeCommand(setting_t test, int value); 

    ~MAX5487();
}