aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-05-31 13:17:24 +0200
committerGitHub <[email protected]>2021-05-31 13:17:24 +0200
commitf04e6ec76268c53afd52711194ab398aebb9f941 (patch)
tree83619d831d2628a829830b28aede79925eb84108
parent553432a8e89c65683f13494befaabdb9c8c18628 (diff)
parent1a9a619033199f9221225b01060e07c246deacb6 (diff)
Merge pull request #213 from lulf/toggleable-output
Implement togglable output pin for Output
-rw-r--r--embassy-stm32/Cargo.toml2
-rw-r--r--embassy-stm32/src/gpio.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index f25e6baf0..ee0ec1abf 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -15,7 +15,7 @@ defmt = { version = "0.2.0", optional = true }
15log = { version = "0.4.11", optional = true } 15log = { version = "0.4.11", optional = true }
16cortex-m-rt = { version = "0.6.13", features = ["device"] } 16cortex-m-rt = { version = "0.6.13", features = ["device"] }
17cortex-m = "0.7.1" 17cortex-m = "0.7.1"
18embedded-hal = { version = "0.2.4" } 18embedded-hal = { version = "0.2.4", features = ["unproven"] }
19futures = { version = "0.3.5", default-features = false, features = ["async-await"] } 19futures = { version = "0.3.5", default-features = false, features = ["async-await"] }
20rand_core = { version = "0.6.2" } 20rand_core = { version = "0.6.2" }
21sdio-host = { version = "0.5.0" } 21sdio-host = { version = "0.5.0" }
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs
index 023ec7a28..873c73b4e 100644
--- a/embassy-stm32/src/gpio.rs
+++ b/embassy-stm32/src/gpio.rs
@@ -3,7 +3,7 @@ use core::convert::Infallible;
3use core::marker::PhantomData; 3use core::marker::PhantomData;
4use embassy::util::Unborrow; 4use embassy::util::Unborrow;
5use embassy_extras::{unborrow, unsafe_impl_unborrow}; 5use embassy_extras::{unborrow, unsafe_impl_unborrow};
6use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin}; 6use embedded_hal::digital::v2::{toggleable, InputPin, OutputPin, StatefulOutputPin};
7 7
8use crate::pac; 8use crate::pac;
9use crate::pac::gpio::{self, vals}; 9use crate::pac::gpio::{self, vals};
@@ -148,6 +148,8 @@ impl<'d, T: Pin> StatefulOutputPin for Output<'d, T> {
148 } 148 }
149} 149}
150 150
151impl<'d, T: Pin> toggleable::Default for Output<'d, T> {}
152
151pub(crate) mod sealed { 153pub(crate) mod sealed {
152 use super::*; 154 use super::*;
153 155