Skip to main content

Class Mcp492x

This class represents an MCP492x digital-to-analog converter (DAC) and implements the ISpiPeripheral and IAnalogOutputController interfaces.

Assembly: Mcp492x.dll
View Source
public abstract class Mcp492x : ISpiPeripheral, IAnalogOutputController, IPinController

Derived:
Meadow.Foundation.ICs.DAC.Mcp4921, Meadow.Foundation.ICs.DAC.Mcp4922

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

Properties

DefaultSpiBusMode

Gets the default SPI bus mode (Mode0).

View Source
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }

DefaultSpiBusSpeed

Gets the default SPI bus speed (20 MHz).

View Source
public Frequency DefaultSpiBusSpeed { get; }

SpiBusMode

Gets or sets the SPI bus mode.

View Source
public SpiClockConfiguration.Mode SpiBusMode { get; set; }

SpiBusSpeed

Gets or sets the SPI bus speed.

View Source
public Frequency SpiBusSpeed { get; set; }

Methods

CreateAnalogOutputPort(IPin)

Creates an IAnalogOutputPort on the specified pin

View Source
public IAnalogOutputPort CreateAnalogOutputPort(IPin pin)
Returns

Meadow.Hardware.IAnalogOutputPort

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

CreateAnalogOutputPort(IPin, Gain, bool)

View Source
public IAnalogOutputPort CreateAnalogOutputPort(IPin pin, Mcp492x.Gain gain = Gain.Gain1x, bool bufferedInput = false)
Returns

Meadow.Hardware.IAnalogOutputPort

Parameters
TypeName
Meadow.Hardware.IPinpin
Meadow.Foundation.ICs.DAC.Mcp492x.Gaingain
System.BooleanbufferedInput

Implements

  • Meadow.Hardware.ISpiPeripheral
  • Meadow.Hardware.IAnalogOutputController
  • Meadow.Hardware.IPinController