diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-05-31 13:17:24 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-31 13:17:24 +0200 |
| commit | f04e6ec76268c53afd52711194ab398aebb9f941 (patch) | |
| tree | 83619d831d2628a829830b28aede79925eb84108 | |
| parent | 553432a8e89c65683f13494befaabdb9c8c18628 (diff) | |
| parent | 1a9a619033199f9221225b01060e07c246deacb6 (diff) | |
Merge pull request #213 from lulf/toggleable-output
Implement togglable output pin for Output
| -rw-r--r-- | embassy-stm32/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/gpio.rs | 4 |
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 } | |||
| 15 | log = { version = "0.4.11", optional = true } | 15 | log = { version = "0.4.11", optional = true } |
| 16 | cortex-m-rt = { version = "0.6.13", features = ["device"] } | 16 | cortex-m-rt = { version = "0.6.13", features = ["device"] } |
| 17 | cortex-m = "0.7.1" | 17 | cortex-m = "0.7.1" |
| 18 | embedded-hal = { version = "0.2.4" } | 18 | embedded-hal = { version = "0.2.4", features = ["unproven"] } |
| 19 | futures = { version = "0.3.5", default-features = false, features = ["async-await"] } | 19 | futures = { version = "0.3.5", default-features = false, features = ["async-await"] } |
| 20 | rand_core = { version = "0.6.2" } | 20 | rand_core = { version = "0.6.2" } |
| 21 | sdio-host = { version = "0.5.0" } | 21 | sdio-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; | |||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use embassy::util::Unborrow; | 4 | use embassy::util::Unborrow; |
| 5 | use embassy_extras::{unborrow, unsafe_impl_unborrow}; | 5 | use embassy_extras::{unborrow, unsafe_impl_unborrow}; |
| 6 | use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin}; | 6 | use embedded_hal::digital::v2::{toggleable, InputPin, OutputPin, StatefulOutputPin}; |
| 7 | 7 | ||
| 8 | use crate::pac; | 8 | use crate::pac; |
| 9 | use crate::pac::gpio::{self, vals}; | 9 | use crate::pac::gpio::{self, vals}; |
| @@ -148,6 +148,8 @@ impl<'d, T: Pin> StatefulOutputPin for Output<'d, T> { | |||
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | impl<'d, T: Pin> toggleable::Default for Output<'d, T> {} | ||
| 152 | |||
| 151 | pub(crate) mod sealed { | 153 | pub(crate) mod sealed { |
| 152 | use super::*; | 154 | use super::*; |
| 153 | 155 | ||
