mcp4x.h

Control functions for the MCP4x series of digitally controlled potentiometers.  Relies on the spihelper.h SPI setup facility.

NOTE: These functions do NOT control any SPI slave select pin.  External code must ensure that the commands these functions transmit via the ATmega SPI module reach the intended destination device.

Summary
mcp4x.hControl functions for the MCP4x series of digitally controlled potentiometers.
Macros
MCP4X_P0Numeric identifier of the P0 potentiometer in an MCP4x device.
MCP4X_P1Numeric identifier of the P1 potentiometer in an MCP4x device.
Functions
mcp4x_set_wiperUpdates the potentiometer wiper setting of the selected MCP4x device.
mcp4x_shutdownDisables a potentiometer in the selected MCP4x device.

Macros

MCP4X_P0

Numeric identifier of the P0 potentiometer in an MCP4x device.  Constant macro.

MCP4X_P1

Numeric identifier of the P1 potentiometer in an MCP4x device.  Constant macro.

Functions

mcp4x_set_wiper

void mcp4x_set_wiper(uint8_t pot,
uint8_t pos)

Updates the potentiometer wiper setting of the selected MCP4x device.

Parameters

potIdentifier of the target potentiometer in the destination device.
posThe potentiometer wiper setting.

mcp4x_shutdown

void mcp4x_shutdown(uint8_t pot)

Disables a potentiometer in the selected MCP4x device.

Parameters

potIdentifier of the target potentiometer in the destination device.
void mcp4x_set_wiper(uint8_t pot,
uint8_t pos)
Updates the potentiometer wiper setting of the selected MCP4x device.
void mcp4x_shutdown(uint8_t pot)
Disables a potentiometer in the selected MCP4x device.
Helper functions and macros for communication via the ATmega’s SPI hardware.
Close