Struct ads1x15::Ads1x15 [−][src]
pub struct Ads1x15<D> { /* fields omitted */ }
An interface to an ADS1x15 device that can be used to control the device over I2C.
Methods
impl<D> Ads1x15<D>
[src]
impl<D> Ads1x15<D>
pub fn new_ads1015(device: D) -> Self
[src]
pub fn new_ads1015(device: D) -> Self
Create a new interface to an ADS1015 device.
Uses the supplied I2C device.
pub fn new_ads1115(device: D) -> Self
[src]
pub fn new_ads1115(device: D) -> Self
Create a new interface to an ADS1115 device.
Uses the supplied I2C device.
pub fn gain(&self) -> Gain
[src]
pub fn gain(&self) -> Gain
Returns the current gain setting of the device.
pub fn set_gain(&mut self, gain: Gain)
[src]
pub fn set_gain(&mut self, gain: Gain)
Changes the gain setting of the device.
impl<D> Ads1x15<D> where
D: I2CDevice + 'static,
[src]
impl<D> Ads1x15<D> where
D: I2CDevice + 'static,
pub fn read_single_ended(
&mut self,
channel: Channel
) -> impl Future<Item = f32, Error = Error<D>>
[src]
pub fn read_single_ended(
&mut self,
channel: Channel
) -> impl Future<Item = f32, Error = Error<D>>
Reads the single-ended voltage of one of the input channels.
The returned value is the electric potential in volts (V) measured on the specified channel.