diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-04-05 00:20:22 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-04-05 00:48:46 +0200 |
| commit | ab85eb4b60cd49ebcd43d2305f42327685f5e5a6 (patch) | |
| tree | 3c385a5703edcd1e791ec1934d3232dc4084ab2b /embassy-nrf/src/saadc.rs | |
| parent | 0e1208947e89ea60bd1b5c85e4deb79efb94d89a (diff) | |
nrf: remove mod sealed.
Diffstat (limited to 'embassy-nrf/src/saadc.rs')
| -rw-r--r-- | embassy-nrf/src/saadc.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 662b05614..17c65fa3e 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs | |||
| @@ -16,7 +16,6 @@ pub(crate) use saadc::ch::pselp::PSELP_A as InputChannel; | |||
| 16 | use saadc::oversample::OVERSAMPLE_A; | 16 | use saadc::oversample::OVERSAMPLE_A; |
| 17 | use saadc::resolution::VAL_A; | 17 | use saadc::resolution::VAL_A; |
| 18 | 18 | ||
| 19 | use self::sealed::Input as _; | ||
| 20 | use crate::interrupt::InterruptExt; | 19 | use crate::interrupt::InterruptExt; |
| 21 | use crate::ppi::{ConfigurableChannel, Event, Ppi, Task}; | 20 | use crate::ppi::{ConfigurableChannel, Event, Ppi, Task}; |
| 22 | use crate::timer::{Frequency, Instance as TimerInstance, Timer}; | 21 | use crate::timer::{Frequency, Instance as TimerInstance, Timer}; |
| @@ -662,16 +661,13 @@ pub enum Resolution { | |||
| 662 | _14BIT = 3, | 661 | _14BIT = 3, |
| 663 | } | 662 | } |
| 664 | 663 | ||
| 665 | pub(crate) mod sealed { | 664 | pub(crate) trait SealedInput { |
| 666 | use super::*; | 665 | fn channel(&self) -> InputChannel; |
| 667 | |||
| 668 | pub trait Input { | ||
| 669 | fn channel(&self) -> InputChannel; | ||
| 670 | } | ||
| 671 | } | 666 | } |
| 672 | 667 | ||
| 673 | /// An input that can be used as either or negative end of a ADC differential in the SAADC periperhal. | 668 | /// An input that can be used as either or negative end of a ADC differential in the SAADC periperhal. |
| 674 | pub trait Input: sealed::Input + Into<AnyInput> + Peripheral<P = Self> + Sized + 'static { | 669 | #[allow(private_bounds)] |
| 670 | pub trait Input: SealedInput + Into<AnyInput> + Peripheral<P = Self> + Sized + 'static { | ||
| 675 | /// Convert this SAADC input to a type-erased `AnyInput`. | 671 | /// Convert this SAADC input to a type-erased `AnyInput`. |
| 676 | /// | 672 | /// |
| 677 | /// This allows using several inputs in situations that might require | 673 | /// This allows using several inputs in situations that might require |
| @@ -693,7 +689,7 @@ pub struct AnyInput { | |||
| 693 | 689 | ||
| 694 | impl_peripheral!(AnyInput); | 690 | impl_peripheral!(AnyInput); |
| 695 | 691 | ||
| 696 | impl sealed::Input for AnyInput { | 692 | impl SealedInput for AnyInput { |
| 697 | fn channel(&self) -> InputChannel { | 693 | fn channel(&self) -> InputChannel { |
| 698 | self.channel | 694 | self.channel |
| 699 | } | 695 | } |
| @@ -706,7 +702,7 @@ macro_rules! impl_saadc_input { | |||
| 706 | impl_saadc_input!(@local, crate::peripherals::$pin, $ch); | 702 | impl_saadc_input!(@local, crate::peripherals::$pin, $ch); |
| 707 | }; | 703 | }; |
| 708 | (@local, $pin:ty, $ch:ident) => { | 704 | (@local, $pin:ty, $ch:ident) => { |
| 709 | impl crate::saadc::sealed::Input for $pin { | 705 | impl crate::saadc::SealedInput for $pin { |
| 710 | fn channel(&self) -> crate::saadc::InputChannel { | 706 | fn channel(&self) -> crate::saadc::InputChannel { |
| 711 | crate::saadc::InputChannel::$ch | 707 | crate::saadc::InputChannel::$ch |
| 712 | } | 708 | } |
