aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-02-17 01:46:12 +0000
committerGitHub <[email protected]>2024-02-17 01:46:12 +0000
commite19bed921d882b25b618afe29417b6f9c75e81a4 (patch)
tree5b1b84730acb7121eda6fae7dd1e0173214718c3
parent542dab918980c84f9fdd55a520a6e130be8e6a9c (diff)
parent72e92647e2634958d2229f35264a3dc696c3d33e (diff)
Merge pull request #2581 from adsnaider/main
Add unsafe constructor for AnyPin
-rw-r--r--embassy-rp/src/gpio.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 93b29bbf9..a121a8036 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -889,6 +889,17 @@ pub struct AnyPin {
889 pin_bank: u8, 889 pin_bank: u8,
890} 890}
891 891
892impl AnyPin {
893 /// Unsafely create a new type-erased pin.
894 ///
895 /// # Safety
896 ///
897 /// You must ensure that you’re only using one instance of this type at a time.
898 pub unsafe fn steal(pin_bank: u8) -> Self {
899 Self { pin_bank }
900 }
901}
902
892impl_peripheral!(AnyPin); 903impl_peripheral!(AnyPin);
893 904
894impl Pin for AnyPin {} 905impl Pin for AnyPin {}