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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The 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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin on which to create the port |
System.Boolean | internalVRef | use the internal 2.048V reference for this analog output. |
System.Boolean | gain2x | if using <code class="paramref">internalVRef</code>, also apply a 2x gain to the output. |
System.Boolean | buffered | if true, changes to the output are not applied until the LDAC pin is pulled low. |
System.Nullable<Meadow.Units.Voltage> | vcc | if 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