อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


Mcp342x Class

Definition

Base type for MCP342X ADC

C#
public abstract class Mcp342x : IDisposable
Inheritance
Mcp342x
Derived
Implements

Constructors

Mcp342x(I2cDevice, Int32)

Protected constructor to easily generate MCP3426/7 devices whose only difference is channel count and I2C address

Properties

ChannelCount

Number of channels

InputGain

Gets or sets the input gain.

LastBytes

Gets the last transmitted bytes. Debug function

LastChannel

Channel most recently read

LastConversion

Last conversion result

Mode

ADC mode

Resolution

Gets or sets the bit resolution of the result.

WaitTime

Wait period before operation is cancelled

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

OneShotRead(Int32)

Initiates One-shot reading and waits for the conversion to finish.

OneShotReadAsync(Int32, CancellationToken)

One-shot read as an asynchronous operation. Initiates read and waits for it to finish. Async API was required as reading in 16bit resolution can take more than 60ms.

ReadChannel(Int32)

Reads the channel.

ReadChannelAsync(Int32, CancellationToken)

Reads the channel. Async API is mostly useful for greater resolutions and one-shot mode, when conversion time can be significant.

ReadConfigByte(Byte)

Read (or load) configuration byte

ReadValue(Int32)

Reads value on the specified channel

ReadValueAsync(Int32, CancellationToken)

Initiates reading value

SetAsyncThreshold(Int32)

Sets the lower time limit in ms. If the current configuration reads data faster the synchronous API is used. This can save some overhead.

SetConfig(Int32, AdcMode, AdcResolution, AdcGain, IList<String>)

Write configuration register and read back value

WaitForConversion(Nullable<TimeSpan>, Action<Int32>, CancellationToken)

Waits for conversion to complete

WaitForConversionAsync(Nullable<TimeSpan>, Action<Int32>, CancellationToken)

Initiates waiting for conversion

WriteConfig(Byte)

Writes configuration

Events

OnConversion

Event called when conversion is complete

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET IoT Libraries 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 2.0.0, 2.1.0, 2.2.0