Skip to main content

AdcControllerApiWrapper Class

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

Concrete IAdcControllerProvider backed by the native TinyCLR ADC HAL. Constructed internally by AdcController; you don't normally need to use this type directly.

public sealed class AdcControllerApiWrapper : IAdcControllerProvider

Constructors​

AdcControllerApiWrapper(NativeApi api)​

public AdcControllerApiWrapper(NativeApi api)

Wraps the given native API as a provider.

ParameterTypeDescription
apiNativeApiThe native ADC API to bind to.

Properties​

Api​

public NativeApi Api { get; }

The underlying native API descriptor.

ChannelCount​

public extern int ChannelCount { get; }

Total number of channels exposed by this controller. (inherited)

ResolutionInBits​

public extern int ResolutionInBits { get; }

Sample width in bits. (inherited)

MinValue​

public extern int MinValue { get; }

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

MaxValue​

public extern int MaxValue { get; }

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

Methods​

Dispose()​

public void Dispose()

Releases the native controller.

IsChannelModeSupported(AdcChannelMode mode)​

public extern bool IsChannelModeSupported(AdcChannelMode mode)

Tests whether the controller supports the given channel mode. (inherited)

ParameterTypeDescription
modeAdcChannelModeThe mode to test.

Returns bool

GetChannelMode()​

public extern AdcChannelMode GetChannelMode()

Returns the controller's current channel mode. (inherited)

Returns AdcChannelMode

SetChannelMode(AdcChannelMode value)​

public extern void SetChannelMode(AdcChannelMode value)

Sets the controller's channel mode. (inherited)

ParameterTypeDescription
valueAdcChannelModeNew channel mode.

OpenChannel(int channel)​

public extern void OpenChannel(int channel)

Acquires exclusive access to the specified channel. (inherited)

ParameterTypeDescription
channelintController-relative channel index.

CloseChannel(int channel)​

public extern void CloseChannel(int channel)

Releases a previously opened channel. (inherited)

ParameterTypeDescription
channelintController-relative channel index.

Read(int channel, TimeSpan samplingTime)​

public extern int Read(int channel, TimeSpan samplingTime)

Performs a conversion on the channel and returns the raw code. (inherited)

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

Returns int