[][src]Struct ads1x1x::Ads1x1x

pub struct Ads1x1x<DI, IC, CONV, MODE> { /* fields omitted */ }

ADS1x1x ADC driver

Methods

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1013, Resolution12Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1013(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1013, CONV, MODE>[src]

pub fn destroy_ads1013(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1113, Resolution16Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1113(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1113, CONV, MODE>[src]

pub fn destroy_ads1113(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1014, Resolution12Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1014(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1014, CONV, MODE>[src]

pub fn destroy_ads1014(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1114, Resolution16Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1114(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1114, CONV, MODE>[src]

pub fn destroy_ads1114(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1015, Resolution12Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1015(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1015, CONV, MODE>[src]

pub fn destroy_ads1015(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E> Ads1x1x<I2cInterface<I2C>, Ads1115, Resolution16Bit, OneShot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new_ads1115(i2c: I2C, address: SlaveAddr) -> Self[src]

Create a new instance of the device in OneShot mode.

impl<I2C, CONV, MODE> Ads1x1x<I2cInterface<I2C>, Ads1115, CONV, MODE>[src]

pub fn destroy_ads1115(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<DI, IC, CONV, MODE, E> Ads1x1x<DI, IC, CONV, MODE> where
    DI: WriteData<Error = E> + ReadData<Error = E>, 
[src]

pub fn is_measurement_in_progress(&mut self) -> Result<bool, Error<E>>[src]

Read whether a measurement is currently in progress.

pub fn reset_internal_driver_state(&mut self)[src]

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.

impl<DI, IC, MODE, E> Ads1x1x<DI, IC, Resolution12Bit, MODE> where
    DI: WriteData<Error = E>, 
[src]

pub fn set_data_rate(&mut self, rate: DataRate12Bit) -> Result<(), Error<E>>[src]

Set data rate

impl<DI, IC, MODE, E> Ads1x1x<DI, IC, Resolution16Bit, MODE> where
    DI: WriteData<Error = E>, 
[src]

pub fn set_data_rate(&mut self, rate: DataRate16Bit) -> Result<(), Error<E>>[src]

Set data rate

impl<DI, IC, CONV, MODE, E> Ads1x1x<DI, IC, CONV, MODE> where
    DI: WriteData<Error = E>,
    IC: Tier2Features,
    CONV: ConvertThreshold<E>, 
[src]

pub fn set_full_scale_range(
    &mut self,
    range: FullScaleRange
) -> Result<(), Error<E>>
[src]

Set the input voltage measurable range

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

pub fn set_low_threshold_raw(&mut self, value: i16) -> Result<(), Error<E>>[src]

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.

pub fn set_high_threshold_raw(&mut self, value: i16) -> Result<(), Error<E>>[src]

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.

pub fn set_comparator_mode(
    &mut self,
    mode: ComparatorMode
) -> Result<(), Error<E>>
[src]

Set comparator mode

pub fn set_comparator_polarity(
    &mut self,
    polarity: ComparatorPolarity
) -> Result<(), Error<E>>
[src]

Set comparator polarity

pub fn set_comparator_latching(
    &mut self,
    latching: ComparatorLatching
) -> Result<(), Error<E>>
[src]

Set comparator latching

pub fn set_comparator_queue(
    &mut self,
    queue: ComparatorQueue
) -> Result<(), Error<E>>
[src]

Activate comparator and set the alert queue

The comparator can be disabled with disable_comparator()

pub fn disable_comparator(&mut self) -> Result<(), Error<E>>[src]

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()

pub fn use_alert_rdy_pin_as_ready(&mut self) -> Result<(), Error<E>>[src]

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.

impl<DI, IC, CONV, E> Ads1x1x<DI, IC, CONV, Continuous> where
    DI: ReadData<Error = E> + WriteData<Error = E>,
    CONV: ConvertMeasurement, 
[src]

pub fn into_one_shot(
    self
) -> Result<Ads1x1x<DI, IC, CONV, OneShot>, ModeChangeError<E, Self>>
[src]

Change operating mode to OneShot

pub fn read(&mut self) -> Result<i16, Error<E>>[src]

Read the most recent measurement

pub fn select_channel<CH>(&mut self, _channel: &mut CH) -> Result<(), Error<E>> where
    CH: Channel<Ads1x1x<DI, IC, CONV, OneShot>, ID = ChannelSelection>, 
[src]

Select the channel for measurements.

Note that when changing the channel in continuous conversion mode, the ongoing conversion will be completed. The following conversions will use the new channel configuration.

impl<DI, IC, CONV, E> Ads1x1x<DI, IC, CONV, OneShot> where
    DI: WriteData<Error = E> + ReadData<Error = E>,
    CONV: ConvertMeasurement, 
[src]

pub fn into_continuous(
    self
) -> Result<Ads1x1x<DI, IC, CONV, Continuous>, ModeChangeError<E, Self>>
[src]

Change operating mode to Continuous

Trait Implementations

impl<DI: Debug, IC: Debug, CONV: Debug, MODE: Debug> Debug for Ads1x1x<DI, IC, CONV, MODE>[src]

impl<DI: Default, IC: Default, CONV: Default, MODE: Default> Default for Ads1x1x<DI, IC, CONV, MODE>[src]

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1013, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1113, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1014, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1114, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for DifferentialA0A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for DifferentialA1A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for DifferentialA2A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for SingleA0[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for SingleA1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for SingleA2[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1015, CONV, MODE>> for SingleA3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for DifferentialA0A1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for DifferentialA0A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for DifferentialA1A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for DifferentialA2A3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for SingleA0[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for SingleA1[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for SingleA2[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, CONV, MODE> Channel<Ads1x1x<DI, Ads1115, CONV, MODE>> for SingleA3[src]

type ID = ChannelSelection

Channel ID type Read more

impl<DI, IC, CONV, E, CH> OneShot<Ads1x1x<DI, IC, CONV, OneShot>, i16, CH> for Ads1x1x<DI, IC, CONV, OneShot> where
    DI: ReadData<Error = E> + WriteData<Error = E>,
    CONV: ConvertMeasurement,
    CH: Channel<Ads1x1x<DI, IC, CONV, OneShot>, ID = ChannelSelection>, 
[src]

type Error = Error<E>

Error type returned by ADC methods

fn read(&mut self, _channel: &mut CH) -> Result<i16, Self::Error>[src]

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.

Auto Trait Implementations

impl<DI, IC, CONV, MODE> Send for Ads1x1x<DI, IC, CONV, MODE> where
    CONV: Send,
    DI: Send,
    IC: Send,
    MODE: Send

impl<DI, IC, CONV, MODE> Sync for Ads1x1x<DI, IC, CONV, MODE> where
    CONV: Sync,
    DI: Sync,
    IC: Sync,
    MODE: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]