diff options
| author | Lucas Granberg <[email protected]> | 2024-05-29 14:56:29 +0300 |
|---|---|---|
| committer | Lucas Granberg <[email protected]> | 2024-05-29 14:56:29 +0300 |
| commit | b282edcc6e98b6d86e4faa5bf5e7274571684e49 (patch) | |
| tree | e0815debd51e1baa5b019049e0ea1b1a286f7742 | |
| parent | 56235c97bc00cb0fb8246a9bb2ea531d508438f9 (diff) | |
add set_as_analog to stm32 gpio Flex
| -rw-r--r-- | embassy-stm32/src/gpio.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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> { | |||
| 128 | }); | 128 | }); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /// Put the pin into analog mode | ||
| 132 | /// | ||
| 133 | /// This mode is used by ADC and COMP but usually there is no need to set this manually | ||
| 134 | /// as the mode change is handled by the driver. | ||
| 135 | #[inline] | ||
| 136 | pub fn set_as_analog(&mut self) { | ||
| 137 | self.pin.set_as_analog(); | ||
| 138 | } | ||
| 139 | |||
| 131 | /// Put the pin into AF mode, unchecked. | 140 | /// Put the pin into AF mode, unchecked. |
| 132 | /// | 141 | /// |
| 133 | /// This puts the pin into the AF mode, with the requested number, pull and speed. This is | 142 | /// This puts the pin into the AF mode, with the requested number, pull and speed. This is |
