Skip to content

Commit e6b830c

Browse files
committed
Document IoPin
1 parent 1505cf4 commit e6b830c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/digital.rs

+16
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,26 @@ pub trait InputPin {
2525
fn is_low(&self) -> bool;
2626
}
2727

28+
/// Pins that can switch between input and output modes at runtime
29+
#[cfg(feature = "unproven")]
2830
pub trait IoPin {
31+
/// Used by [`into_input()`](#tymethod.into_input)
32+
///
33+
/// In addition to being an [`InputPin`](trait.InputPin.html), the
34+
/// target type must implement `IoPin` so that the mode can be
35+
/// changed again.
2936
type Input: InputPin + IoPin<Input = Self::Input, Output = Self::Output>;
37+
38+
/// Used by [`into_output()`](#tymethod.into_output)
39+
///
40+
/// In addition to being an [`OutputPin`](trait.OutputPin.html),
41+
/// the target type must implement `IoPin` so that the mode can be
42+
/// changed again.
3043
type Output: OutputPin + IoPin<Input = Self::Input, Output = Self::Output>;
3144

45+
/// Configure as [`InputPin`](trait.InputPin.html)
3246
fn into_input(self) -> Self::Input;
47+
48+
/// Configure as [`OutputPin`](trait.OutputPin.html)
3349
fn into_output(self) -> Self::Output;
3450
}

0 commit comments

Comments
 (0)