Driver C++ source code for MAX5216/MAX5214 16-bit/14-bit DAC SPI (50MHz) bus ICs. Low power Digital-to_Analog Converter chips which accept supply voltages of 2.7V to 5.5V. Features Rail-to-Rail Buffered Output Operation and Safe Power-On Reset (POR) to Zero DAC Output.

Dependents:   MAX5216_16_Bit_DAC_Hello_Code

Fork of MAX5487_Digital_Pot_Potentiometer_Rheostat_Resistor_Wiper by Kevin Jung

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 }