Struct ads1x1x::Ads1x1x

source ·
pub struct Ads1x1x<DI, IC, CONV, MODE> { /* private fields */ }
Expand description

ADS1x1x ADC driver

Implementations§

Change operating mode to Continuous

Change operating mode to OneShot

Start continuous conversions

Note: this method is only available in continuous mode.

Read the most recent measurement

The continuous measurement must be started with start() before calling this method. Otherwise, Error::NotStarted will be returned.

Note: this method is only available in continuous mode.

Select the channel for measurements.

Set data rate

Set data rate

Set the input voltage measurable range

This configures the programmable gain amplifier and determines the measurable input voltage range.

Set raw comparator lower threshold

The input value must be within [2047..-2048] for 12-bit devices (ADS101x) and within [32767..-32768] for 16-bit devices (ADS111x). The voltage that these values correspond to must be calculated using the full-scale range selected. See FullScaleRange.

Set raw comparator upper threshold

The input value must be within [2047..-2048] for 12-bit devices (ADS101x) and within [32767..-32768] for 16-bit devices (ADS111x). The voltage that these values correspond to must be calculated using the full-scale range selected. See FullScaleRange.

Set comparator mode

Set comparator polarity

Set comparator latching

Activate comparator and set the alert queue

The comparator can be disabled with disable_comparator()

Disable comparator (default)

This will set the ALERT/RDY pin to high-impedance. The comparator can be enabled by setting the comparator queue. See set_comparator_queue()

Use the ALERT/RDY pin as conversion-ready pin.

This the ALERT/RDY pin outputs the OS bit when in OneShot mode, and provides a continuous-conversion ready pulse when in continuous-conversion mode.

When calling this the comparator will be disabled and the thresholds will be cleared.

Read whether a measurement is currently in progress.

Reset the internal state of this driver to the default values.

Note: This does not alter the state or configuration of the device.

This resets the cached configuration register value in this driver to the power-up (reset) configuration of the device.

This needs to be called after performing a reset on the device, for example through an I2C general-call Reset command, which was not done through this driver to ensure that the configurations in the device and in the driver match.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device in OneShot mode.

Destroy driver instance, return I²C bus instance.

Trait Implementations§

Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Channel ID type Read more
Get the specific ID that identifies this channel, for example 0_u8 for the first ADC channel, if Self::ID is u8. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Request that the ADC begin a conversion on the specified channel.

The output value will be within [2047..-2048] for 12-bit devices (ADS101x) and within [32767..-32768] for 16-bit devices (ADS111x). The voltage that these values correspond to must be calculated using the full-scale range selected. See FullScaleRange.

Returns nb::Error::WouldBlock while a measurement is in progress.

In case a measurement was requested and after is it is finished a measurement on a different channel is requested, a new measurement on using the new channel selection is triggered.

Error type returned by ADC methods

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.