summaryrefslogtreecommitdiffstats
path: root/src/channel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel.rs')
-rw-r--r--src/channel.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/channel.rs b/src/channel.rs
index 27262d4..4b7555e 100644
--- a/src/channel.rs
+++ b/src/channel.rs
@@ -1,33 +1,31 @@
//! ADC input channels
use crate::{ic, Ads1x1x, BitFlags as BF, Config};
-mod private {
- pub trait Sealed {}
-}
+use private::ChannelSelection;
/// Marker type for an ADC input channel.
-pub trait ChannelId<T>: private::Sealed {
+pub trait ChannelId<T> {
/// Get the channel.
fn channel_id() -> ChannelSelection;
}
macro_rules! impl_channels {
($(#[doc = $doc:expr] $CH:ident => [$($IC:ident),+]),+ $(,)?) => {
- #[derive(Debug, Clone, Copy)]
- /// ADC input channel selection.
- pub enum ChannelSelection {
- $(
- #[doc = $doc]
- $CH,
- )+
+ mod private {
+ #[derive(Debug, Clone, Copy)]
+ /// ADC input channel selection.
+ pub enum ChannelSelection {
+ $(
+ #[doc = $doc]
+ $CH,
+ )+
+ }
}
$(
#[doc = $doc]
pub struct $CH;
- impl private::Sealed for $CH {}
-
$(
impl<I2C, CONV, MODE> ChannelId<Ads1x1x<I2C, ic::$IC, CONV, MODE>> for $CH {
fn channel_id() -> ChannelSelection {