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.
| Parameter | Type | Description |
|---|---|---|
api | NativeApi | The 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)
| Parameter | Type | Description |
|---|---|---|
mode | AdcChannelMode | The 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)
| Parameter | Type | Description |
|---|---|---|
value | AdcChannelMode | New channel mode. |
OpenChannel(int channel)
public extern void OpenChannel(int channel)
Acquires exclusive access to the specified channel. (inherited)
| Parameter | Type | Description |
|---|---|---|
channel | int | Controller-relative channel index. |
CloseChannel(int channel)
public extern void CloseChannel(int channel)
Releases a previously opened channel. (inherited)
| Parameter | Type | Description |
|---|---|---|
channel | int | Controller-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)
| Parameter | Type | Description |
|---|---|---|
channel | int | Controller-relative channel index. |
samplingTime | TimeSpan | Requested sample-and-hold time. |
Returns int