Adafruit MCP4728 DAC Library
Classes | Macros | Typedefs | Enumerations
Adafruit_MCP4728.h File Reference
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Wire.h>

Go to the source code of this file.

Classes

class  Adafruit_MCP4728
 Class that stores state and functions for interacting with the MCP4728 I2C Digital Potentiometer. More...
 

Macros

#define MCP4728_I2CADDR_DEFAULT   0x60
 MCP4728 default i2c address.
 
#define MCP4728_MULTI_IR_CMD   0x40
 Command to write to the input register only.
 
#define MCP4728_MULTI_EEPROM_CMD   0x50
 Command to write to the input register and EEPROM.
 
#define MCP4728_FAST_WRITE_CMD   0xC0
 Command to write all channels at once with.
 

Typedefs

typedef enum pd_mode MCP4728_pd_mode_t
 Power status values. More...
 
typedef enum gain MCP4728_gain_t
 Example enum values. More...
 
typedef enum vref MCP4728_vref_t
 Ex. More...
 
typedef enum channel MCP4728_channel_t
 Example enum values. More...
 

Enumerations

enum  pd_mode { MCP4728_PD_MODE_NORMAL, MCP4728_PD_MODE_GND_1K, MCP4728_PD_MODE_GND_100K, MCP4728_PD_MODE_GND_500K }
 Power status values. More...
 
enum  gain { MCP4728_GAIN_1X, MCP4728_GAIN_2X }
 Example enum values. More...
 
enum  vref { MCP4728_VREF_VDD, MCP4728_VREF_INTERNAL }
 Ex. More...
 
enum  channel { MCP4728_CHANNEL_A, MCP4728_CHANNEL_B, MCP4728_CHANNEL_C, MCP4728_CHANNEL_D }
 Example enum values. More...
 

Detailed Description

I2C Driver for the Adafruit MCP4728 4-Channel 12-Bit I2C DAC library

This is a library for the Adafruit MCP4728 breakout: https://www.adafruit.com/products/4470

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

BSD license (see license.txt)

Typedef Documentation

◆ MCP4728_pd_mode_t

typedef enum pd_mode MCP4728_pd_mode_t

Power status values.

Allowed values for setPowerMode.

◆ MCP4728_gain_t

typedef enum gain MCP4728_gain_t

Example enum values.

Allowed values for setGain.

◆ MCP4728_vref_t

typedef enum vref MCP4728_vref_t

Ex.

Allowed values for setVref.

◆ MCP4728_channel_t

typedef enum channel MCP4728_channel_t

Example enum values.

Allowed values for setChannelGain.

Enumeration Type Documentation

◆ pd_mode

enum pd_mode

Power status values.

Allowed values for setPowerMode.

Enumerator
MCP4728_PD_MODE_NORMAL 

Normal; the channel outputs the given value as normal.

MCP4728_PD_MODE_GND_1K 

VOUT is loaded with 1 kΩ resistor to ground. Most of the channel circuits are powered off.

MCP4728_PD_MODE_GND_100K 

VOUT is loaded with 100 kΩ resistor to ground. Most of the channel circuits are powered off.

MCP4728_PD_MODE_GND_500K 

VOUT is loaded with 500 kΩ resistor to ground. Most of the channel circuits are powered off.

◆ gain

enum gain

Example enum values.

Allowed values for setGain.

◆ vref

enum vref

Ex.

Allowed values for setVref.

◆ channel

enum channel

Example enum values.

Allowed values for setChannelGain.