aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src
diff options
context:
space:
mode:
authorSebastian Goll <[email protected]>2023-09-19 23:23:14 +0200
committerSebastian Goll <[email protected]>2023-09-20 00:03:39 +0200
commit2405aff11f466d1c3fc07bca70c07d11fc96c3be (patch)
tree48b08c7fe2833966a922c01d8960eae3709cd6e2 /embassy-stm32/src
parentc573959a956802eb177d04fa5b7802397af19f93 (diff)
Add get_level() to ExtiInput
Diffstat (limited to 'embassy-stm32/src')
-rw-r--r--embassy-stm32/src/exti.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs
index bd4bab1f8..efa51fb24 100644
--- a/embassy-stm32/src/exti.rs
+++ b/embassy-stm32/src/exti.rs
@@ -6,7 +6,7 @@ use core::task::{Context, Poll};
6use embassy_hal_internal::impl_peripheral; 6use embassy_hal_internal::impl_peripheral;
7use embassy_sync::waitqueue::AtomicWaker; 7use embassy_sync::waitqueue::AtomicWaker;
8 8
9use crate::gpio::{AnyPin, Input, Pin as GpioPin}; 9use crate::gpio::{AnyPin, Input, Level, Pin as GpioPin};
10use crate::pac::exti::regs::Lines; 10use crate::pac::exti::regs::Lines;
11use crate::pac::EXTI; 11use crate::pac::EXTI;
12use crate::{interrupt, pac, peripherals, Peripheral}; 12use crate::{interrupt, pac, peripherals, Peripheral};
@@ -101,6 +101,10 @@ impl<'d, T: GpioPin> ExtiInput<'d, T> {
101 self.pin.is_low() 101 self.pin.is_low()
102 } 102 }
103 103
104 pub fn get_level(&self) -> Level {
105 self.pin.get_level()
106 }
107
104 pub async fn wait_for_high<'a>(&'a mut self) { 108 pub async fn wait_for_high<'a>(&'a mut self) {
105 let fut = ExtiInputFuture::new(self.pin.pin.pin.pin(), self.pin.pin.pin.port(), true, false); 109 let fut = ExtiInputFuture::new(self.pin.pin.pin.pin(), self.pin.pin.pin.port(), true, false);
106 if self.is_high() { 110 if self.is_high() {