diff options
| -rw-r--r-- | embassy-nrf/src/saadc.rs | 23 |
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 | } |
| 103 | impl Input for VddInput {} | 103 | impl 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"))] | ||
| 108 | pub struct VddhDiv5Input; | ||
| 109 | |||
| 110 | #[cfg(any(feature = "_nrf5340-app", feature = "nrf52833", feature = "nrf52840"))] | ||
| 111 | unsafe 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"))] | ||
| 119 | impl 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"))] | ||
| 126 | impl Input for VddhDiv5Input {} | ||
| 127 | |||
| 105 | impl<'d> ChannelConfig<'d> { | 128 | impl<'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 { |
