Skip to main content

IAdcControllerProvider Interface

Namespace: GHIElectronics.TinyCLR.Devices.Adc.Provider · Assembly: GHIElectronics.TinyCLR.Devices.Adc

Provider contract for an ADC controller. Most users call AdcController / AdcChannel directly; implement this interface only when supplying a custom or virtual ADC.

public interface IAdcControllerProvider : IDisposable

Properties

ChannelCount

int ChannelCount { get; }

Total number of channels exposed by this controller.

ResolutionInBits

int ResolutionInBits { get; }

Sample width in bits.

MinValue

int MinValue { get; }

Smallest raw value Read(int, TimeSpan) can return.

MaxValue

int MaxValue { get; }

Largest raw value Read(int, TimeSpan) can return.

Methods

IsChannelModeSupported(AdcChannelMode mode)

bool IsChannelModeSupported(AdcChannelMode mode)

Tests whether the controller supports the given channel mode.

ParameterTypeDescription
modeAdcChannelModeThe mode to test.

Returns bool

GetChannelMode()

AdcChannelMode GetChannelMode()

Returns the controller's current channel mode.

Returns AdcChannelMode

SetChannelMode(AdcChannelMode value)

void SetChannelMode(AdcChannelMode value)

Sets the controller's channel mode.

ParameterTypeDescription
valueAdcChannelModeNew channel mode.

OpenChannel(int channel)

void OpenChannel(int channel)

Acquires exclusive access to the specified channel.

ParameterTypeDescription
channelintController-relative channel index.

CloseChannel(int channel)

void CloseChannel(int channel)

Releases a previously opened channel.

ParameterTypeDescription
channelintController-relative channel index.

Read(int channel, TimeSpan samplingTime)

int Read(int channel, TimeSpan samplingTime)

Performs a conversion on the channel and returns the raw code.

ParameterTypeDescription
channelintController-relative channel index.
samplingTimeTimeSpanRequested sample-and-hold time.

Returns int