aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/src/saadc.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs
index c4de7315f..61bc1fbda 100644
--- a/embassy-nrf/src/saadc.rs
+++ b/embassy-nrf/src/saadc.rs
@@ -102,6 +102,29 @@ impl sealed::Input for VddInput {
102} 102}
103impl Input for VddInput {} 103impl Input for VddInput {}
104 104
105/// A dummy `Input` pin implementation for SAADC peripheral sampling from the
106/// VDDH / 5 voltage.
107#[cfg(any(feature = "_nrf5340-app", feature = "nrf52833", feature = "nrf52840"))]
108pub struct VddhDiv5Input;
109
110#[cfg(any(feature = "_nrf5340-app", feature = "nrf52833", feature = "nrf52840"))]
111unsafe impl Unborrow for VddhDiv5Input {
112 type Target = VddhDiv5Input;
113 unsafe fn unborrow(self) -> Self::Target {
114 self
115 }
116}
117
118#[cfg(any(feature = "_nrf5340-app", feature = "nrf52833", feature = "nrf52840"))]
119impl sealed::Input for VddhDiv5Input {
120 fn channel(&self) -> InputChannel {
121 InputChannel::VDDHDIV5
122 }
123}
124
125#[cfg(any(feature = "_nrf5340-app", feature = "nrf52833", feature = "nrf52840"))]
126impl Input for VddhDiv5Input {}
127
105impl<'d> ChannelConfig<'d> { 128impl<'d> ChannelConfig<'d> {
106 /// Default configuration for single ended channel sampling. 129 /// Default configuration for single ended channel sampling.
107 pub fn single_ended(input: impl Unborrow<Target = impl Input> + 'd) -> Self { 130 pub fn single_ended(input: impl Unborrow<Target = impl Input> + 'd) -> Self {