1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
macro_rules! mode { ($name:ident) => { pub enum $name {} unsafe impl super::PinMode for $name {} }; } mode!(Unassigned); mode!(DigitalOutput); mode!(DigitalInput); mode!(SWM); unsafe impl super::PinAssignment for Unassigned {} // A marker type used to represent that a function is assigned to a pin. pub struct Assigned<PIN: super::Pin>(PIN, void::Void); unsafe impl<T: super::Pin> super::PinAssignment for Assigned<T> {}