mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Add unsafe constructor for AnyPin
This commit is contained in:
parent
5220453d85
commit
72e92647e2
@ -889,6 +889,17 @@ pub struct AnyPin {
|
|||||||
pin_bank: u8,
|
pin_bank: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AnyPin {
|
||||||
|
/// Unsafely create a new type-erased pin.
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// You must ensure that you’re only using one instance of this type at a time.
|
||||||
|
pub unsafe fn steal(pin_bank: u8) -> Self {
|
||||||
|
Self { pin_bank }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl_peripheral!(AnyPin);
|
impl_peripheral!(AnyPin);
|
||||||
|
|
||||||
impl Pin for AnyPin {}
|
impl Pin for AnyPin {}
|
||||||
|
Loading…
Reference in New Issue
Block a user