Skip to main content

DacController Class

Namespace: GHIElectronics.TinyCLR.Devices.Dac · Assembly: GHIElectronics.TinyCLR.Devices.Dac

Represents a DAC peripheral. Open a channel via OpenChannel(int) to drive analog output; use MinValue/MaxValue to know the raw-code range for the configured resolution.

public class DacController : IDisposable

Properties

Provider

public IDacControllerProvider Provider { get; }

The low-level provider backing this controller.

ChannelCount

public int ChannelCount { get; }

Number of channels exposed by this controller.

ResolutionInBits

public int ResolutionInBits { get; }

Sample width in bits.

MinValue

public int MinValue { get; }

Smallest raw value accepted by DacChannel.WriteValue(int).

MaxValue

public int MaxValue { get; }

Largest raw value accepted by DacChannel.WriteValue(int).

Methods

GetDefault()

public static DacController GetDefault()

Returns the default DAC controller for this device.

Returns DacController

FromName(string name)

public static DacController FromName(string name)

Returns a DAC controller identified by its native API name.

ParameterTypeDescription
namestringNative API name.

Returns DacController

FromProvider(IDacControllerProvider provider)

public static DacController FromProvider(IDacControllerProvider provider)

Creates a controller from a custom IDacControllerProvider.

ParameterTypeDescription
providerIDacControllerProviderProvider implementing the channel operations.

Returns DacController

Dispose()

public void Dispose()

Releases the underlying provider.

OpenChannel(int channelNumber)

public DacChannel OpenChannel(int channelNumber)

Opens a channel for output.

ParameterTypeDescription
channelNumberintController-relative channel index.

Returns DacChannel — A DacChannel; dispose it to release the channel.