diff options
author | Em Shotton <matthewshotton88@gmail.com> | 2024-08-22 11:46:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-22 20:46:00 +0200 |
commit | d3af2b6074e8698b8b83f79758e23070a8b80002 (patch) | |
tree | ac89b6256ddbbe1ce4b5e3d5edcc4ae3b4165315 /src/lib.rs | |
parent | 256309063a39836e5c30b3e9eb2c3bcd3246bdec (diff) | |
download | ads1x1x-async-d3af2b6074e8698b8b83f79758e23070a8b80002.tar.gz ads1x1x-async-d3af2b6074e8698b8b83f79758e23070a8b80002.tar.xz ads1x1x-async-d3af2b6074e8698b8b83f79758e23070a8b80002.zip |
Update the terms "master/slave" to "controller/target" (#29)
* Update the terms "master/slave" to "controller/target" throughout to align with the i2c bus specification v.7
* Updated Changelog
* Change word casing
---------
Co-authored-by: Em Shotton <matthewfshotton@gmail.com>
Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -88,10 +88,10 @@ //! //! ```no_run //! use linux_embedded_hal::I2cdev; -//! use ads1x1x::{Ads1x1x, SlaveAddr}; +//! use ads1x1x::{Ads1x1x, TargetAddr}; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let adc = Ads1x1x::new_ads1013(dev, SlaveAddr::default()); +//! let adc = Ads1x1x::new_ads1013(dev, TargetAddr::default()); //! // do something... //! //! // get the I2C device back @@ -102,20 +102,20 @@ //! //! ```no_run //! use linux_embedded_hal::I2cdev; -//! use ads1x1x::{Ads1x1x, SlaveAddr}; +//! use ads1x1x::{Ads1x1x, TargetAddr}; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let adc = Ads1x1x::new_ads1013(dev, SlaveAddr::Sda); +//! let adc = Ads1x1x::new_ads1013(dev, TargetAddr::Sda); //! ``` //! //! ### Make a one-shot measurement //! ```no_run -//! use ads1x1x::{channel, Ads1x1x, SlaveAddr}; +//! use ads1x1x::{channel, Ads1x1x, TargetAddr}; //! use linux_embedded_hal::I2cdev; //! use nb::block; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let mut adc = Ads1x1x::new_ads1013(dev, SlaveAddr::default()); +//! let mut adc = Ads1x1x::new_ads1013(dev, TargetAddr::default()); //! let measurement = block!(adc.read(channel::DifferentialA0A1)).unwrap(); //! println!("Measurement: {}", measurement); //! let _dev = adc.destroy_ads1013(); // get I2C device back @@ -128,10 +128,10 @@ //! //! ```no_run //! use linux_embedded_hal::I2cdev; -//! use ads1x1x::{Ads1x1x, ModeChangeError, SlaveAddr}; +//! use ads1x1x::{Ads1x1x, ModeChangeError, TargetAddr}; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let adc = Ads1x1x::new_ads1013(dev, SlaveAddr::default()); +//! let adc = Ads1x1x::new_ads1013(dev, TargetAddr::default()); //! match adc.into_continuous() { //! Err(ModeChangeError::I2C(e, adc)) => /* mode change failed handling */ panic!(), //! Ok(mut adc) => { @@ -148,10 +148,10 @@ //! //! ```no_run //! use linux_embedded_hal::I2cdev; -//! use ads1x1x::{Ads1x1x, DataRate16Bit, SlaveAddr}; +//! use ads1x1x::{Ads1x1x, DataRate16Bit, TargetAddr}; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let mut adc = Ads1x1x::new_ads1115(dev, SlaveAddr::default()); +//! let mut adc = Ads1x1x::new_ads1115(dev, TargetAddr::default()); //! adc.set_data_rate(DataRate16Bit::Sps860).unwrap(); //! ``` //! @@ -160,17 +160,17 @@ //! or goes above 1.5V in at least two consecutive conversions. Then the //! ALERT/RDY pin will be set high and it will be kept so until the //! measurement is read or an appropriate SMBus alert response is sent by -//! the master. +//! the controller. //! //! ```no_run //! use linux_embedded_hal::I2cdev; //! use ads1x1x::{ -//! Ads1x1x, SlaveAddr, ComparatorQueue, ComparatorPolarity, +//! Ads1x1x, TargetAddr, ComparatorQueue, ComparatorPolarity, //! ComparatorMode, ComparatorLatching, FullScaleRange //! }; //! //! let dev = I2cdev::new("/dev/i2c-1").unwrap(); -//! let address = SlaveAddr::default(); +//! let address = TargetAddr::default(); //! let mut adc = Ads1x1x::new_ads1015(dev, address); //! adc.set_comparator_queue(ComparatorQueue::Two).unwrap(); //! adc.set_comparator_polarity(ComparatorPolarity::ActiveHigh).unwrap(); @@ -224,7 +224,7 @@ mod types; use crate::types::Config; pub use crate::types::{ mode, Ads1x1x, ComparatorLatching, ComparatorMode, ComparatorPolarity, ComparatorQueue, - DataRate12Bit, DataRate16Bit, Error, FullScaleRange, ModeChangeError, SlaveAddr, + DataRate12Bit, DataRate16Bit, Error, FullScaleRange, ModeChangeError, TargetAddr, }; mod private { |