From 28b16cc364cc4f4112aca2195df389ea6f007048 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Wed, 7 Nov 2018 20:19:06 +0100 Subject: Convert between modes through transformation of the struct --- src/devices/ads1013.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/devices/ads1013.rs (limited to 'src/devices/ads1013.rs') diff --git a/src/devices/ads1013.rs b/src/devices/ads1013.rs deleted file mode 100644 index b4628b5..0000000 --- a/src/devices/ads1013.rs +++ /dev/null @@ -1,28 +0,0 @@ -//! Functions exclusive of ADS1013 - -extern crate embedded_hal as hal; -use hal::blocking; -use core::marker::PhantomData; -use { Ads1x1x, DEVICE_BASE_ADDRESS, SlaveAddr, ic }; -use interface::I2cInterface; - -impl Ads1x1x, ic::ADS1013> -where - I2C: blocking::i2c::Write + blocking::i2c::WriteRead -{ - /// Create a new instance of the ADS1013 device. - pub fn new_ads1013(i2c: I2C, address: SlaveAddr) -> Self { - Ads1x1x { - iface: I2cInterface { - i2c, - address: address.addr(DEVICE_BASE_ADDRESS) - }, - _ic: PhantomData - } - } - - /// Destroy driver instance, return I²C bus instance. - pub fn destroy_ads1013(self) -> I2C { - self.iface.i2c - } -} -- cgit v1.2.3-54-g00ecf