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