From b282edcc6e98b6d86e4faa5bf5e7274571684e49 Mon Sep 17 00:00:00 2001 From: Lucas Granberg <lukkeg@gmail.com> Date: Wed, 29 May 2024 14:56:29 +0300 Subject: [PATCH] add set_as_analog to stm32 gpio Flex --- embassy-stm32/src/gpio.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index 808a5bc82..d60a857ef 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs @@ -128,6 +128,15 @@ impl<'d> Flex<'d> { }); } + /// Put the pin into analog mode + /// + /// This mode is used by ADC and COMP but usually there is no need to set this manually + /// as the mode change is handled by the driver. + #[inline] + pub fn set_as_analog(&mut self) { + self.pin.set_as_analog(); + } + /// Put the pin into AF mode, unchecked. /// /// This puts the pin into the AF mode, with the requested number, pull and speed. This is