diff options
author | Markus Reiter <me@reitermark.us> | 2024-01-12 20:24:51 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2024-01-19 11:23:31 +0100 |
commit | b3ca672f70c71194da40a7670549a8264c13d971 (patch) | |
tree | 1f316806351a059ca5b5fccbcf4d790b94c0b471 /src/devices/mode/continuous.rs | |
parent | ed4cc1dbc5b048332b68a0ebc1d7113d482a74a2 (diff) | |
download | ads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.tar.gz ads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.tar.xz ads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.zip |
Update to `embedded-hal` 1.0.
Diffstat (limited to 'src/devices/mode/continuous.rs')
-rw-r--r-- | src/devices/mode/continuous.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/devices/mode/continuous.rs b/src/devices/mode/continuous.rs index 64aa179..b3b4807 100644 --- a/src/devices/mode/continuous.rs +++ b/src/devices/mode/continuous.rs @@ -1,11 +1,10 @@ //! Continuous measurement mode use crate::{ - channels::ChannelSelection, conversion, devices::OperatingMode, interface, mode, Ads1x1x, - Error, ModeChangeError, Register, + conversion, devices::OperatingMode, interface, mode, Ads1x1x, ChannelId, Error, + ModeChangeError, Register, }; use core::marker::PhantomData; -use embedded_hal::adc; impl<DI, IC, CONV, E> Ads1x1x<DI, IC, CONV, mode::Continuous> where @@ -41,11 +40,9 @@ where /// 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. - pub fn select_channel<CH>(&mut self, _channel: &mut CH) -> Result<(), Error<E>> - where - CH: adc::Channel<Ads1x1x<DI, IC, CONV, mode::OneShot>, ID = ChannelSelection>, - { - let config = self.config.with_mux_bits(CH::channel()); + #[allow(unused_variables)] + pub fn select_channel<CH: ChannelId<Self>>(&mut self, channel: CH) -> Result<(), Error<E>> { + let config = self.config.with_mux_bits(CH::channel_id()); self.iface.write_register(Register::CONFIG, config.bits)?; self.config = config; Ok(()) |