Merge pull request #1929 from sgoll/exti-level
stm32/exti: Add get_level() to ExtiInput
This commit is contained in:
commit
e1ed492577
@ -6,7 +6,7 @@ use core::task::{Context, Poll};
|
|||||||
use embassy_hal_internal::impl_peripheral;
|
use embassy_hal_internal::impl_peripheral;
|
||||||
use embassy_sync::waitqueue::AtomicWaker;
|
use embassy_sync::waitqueue::AtomicWaker;
|
||||||
|
|
||||||
use crate::gpio::{AnyPin, Input, Pin as GpioPin};
|
use crate::gpio::{AnyPin, Input, Level, Pin as GpioPin};
|
||||||
use crate::pac::exti::regs::Lines;
|
use crate::pac::exti::regs::Lines;
|
||||||
use crate::pac::EXTI;
|
use crate::pac::EXTI;
|
||||||
use crate::{interrupt, pac, peripherals, Peripheral};
|
use crate::{interrupt, pac, peripherals, Peripheral};
|
||||||
@ -101,6 +101,10 @@ impl<'d, T: GpioPin> ExtiInput<'d, T> {
|
|||||||
self.pin.is_low()
|
self.pin.is_low()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_level(&self) -> Level {
|
||||||
|
self.pin.get_level()
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn wait_for_high<'a>(&'a mut self) {
|
pub async fn wait_for_high<'a>(&'a mut self) {
|
||||||
let fut = ExtiInputFuture::new(self.pin.pin.pin.pin(), self.pin.pin.pin.port(), true, false);
|
let fut = ExtiInputFuture::new(self.pin.pin.pin.pin(), self.pin.pin.pin.port(), true, false);
|
||||||
if self.is_high() {
|
if self.is_high() {
|
||||||
|
Loading…
Reference in New Issue
Block a user