Skip to content

Commit 1e63c04

Browse files
diondokterjamesmunns
authored andcommitted
Added VDD source for the ADC
1 parent 9de137b commit 1e63c04

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nrf-hal-common/src/saadc.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ where
103103
5 => self.0.ch[0].pselp.write(|w| w.pselp().analog_input5()),
104104
6 => self.0.ch[0].pselp.write(|w| w.pselp().analog_input6()),
105105
7 => self.0.ch[0].pselp.write(|w| w.pselp().analog_input7()),
106+
#[cfg(not(feature = "9160"))]
107+
8 => self.0.ch[0].pselp.write(|w| w.pselp().vdd()),
106108
// This can never happen the only analog pins have already been defined
107109
// PAY CLOSE ATTENTION TO ANY CHANGES TO THIS IMPL OR THE `channel_mappings!` MACRO
108110
_ => unsafe { unreachable_unchecked() },
@@ -175,5 +177,10 @@ channel_mappings! {
175177
4 => crate::gpio::p0::P0_28<Input<Floating>>,
176178
5 => crate::gpio::p0::P0_29<Input<Floating>>,
177179
6 => crate::gpio::p0::P0_30<Input<Floating>>,
178-
7 => crate::gpio::p0::P0_31<Input<Floating>>
180+
7 => crate::gpio::p0::P0_31<Input<Floating>>,
181+
8 => InternalVdd
179182
}
183+
184+
#[cfg(not(feature = "9160"))]
185+
/// Channel that doesn't sample a pin, but the internal VDD voltage.
186+
pub struct InternalVdd;

0 commit comments

Comments
 (0)