Skip to main content

Class Mcp4728

This class represents an MCP4728 quad digital-to-analog converter (DAC) and implements the II2CPeripheral and IAnalogOutputController interfaces.

Assembly: Mcp4728.dll
View Source
Declaration
public class Mcp4728 : II2cPeripheral, IAnalogOutputController, IPinController

Implements:
Meadow.Hardware.II2cPeripheral, Meadow.Hardware.IAnalogOutputController, Meadow.Hardware.IPinController

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

DefaultBusSpeed

Default I2C Bus Speed to use for communication.

View Source
Declaration
public static I2cBusSpeed DefaultBusSpeed { get; }

Pins

The pins

View Source
Declaration
public Mcp4728.PinDefinitions Pins { get; }

Methods

CreateAnalogOutputPort(IPin)

Creates an IAnalogOutputPort on the specified pin

View Source
Declaration
public IAnalogOutputPort CreateAnalogOutputPort(IPin pin)
Returns

Meadow.Hardware.IAnalogOutputPort

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin on which to create the port.

CreateAnalogOutputPort(IPin, bool, bool, bool, Voltage?)

Creates an IAnalogOutputPort on the specified pin, with the specified settings.

View Source
Declaration
public IAnalogOutputPort CreateAnalogOutputPort(IPin pin, bool internalVRef, bool gain2x, bool buffered = false, Voltage? vcc = null)
Returns

Meadow.Hardware.IAnalogOutputPort

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin on which to create the port
System.BooleaninternalVRefuse the internal 2.048V reference for this analog output.
System.Booleangain2xif using <code class="paramref">internalVRef</code>, also apply a 2x gain to the output.
System.Booleanbufferedif true, changes to the output are not applied until the LDAC pin is pulled low.
System.Nullable<Meadow.Units.Voltage>vccif not using <code class="paramref">internalVRef</code>, providing the external Vcc voltage will allow Meadow.Foundation.ICs.DAC.Mcp4728.AnalogOutputPort.VoltageResolution to be correctly calculated. If not provided, 3.3V is assumed.

Implements

  • Meadow.Hardware.II2cPeripheral
  • Meadow.Hardware.IAnalogOutputController
  • Meadow.Hardware.IPinController