File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! Asynchronous digital I/O
2
+
3
+ use core:: future:: Future ;
4
+
5
+ /// Asynchronously wait for a pin to become high or low.
6
+ pub trait AsyncInputPin {
7
+ /// The future returned by the `until_high` function.
8
+ type UntilHighFuture < ' a > : Future < Output =( ) > + ' a ;
9
+
10
+ /// The future returned by the `until_low` function.
11
+ type UntilLowFuture < ' a > : Future < Output =( ) > + ' a ;
12
+
13
+ /// Returns a future that resolves when this pin becomes high.
14
+ fn until_high < ' a > ( & self ) -> Self :: UntilHighFuture < ' a > ;
15
+
16
+ /// Returns a future that resolves when this pin becomes high.
17
+ fn until_low < ' a > ( & self ) -> Self :: UntilLowFuture < ' a > ;
18
+ }
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ pub mod i2c;
6
6
pub mod serial;
7
7
pub mod spi;
8
8
pub mod delay;
9
+ pub mod digital;
You can’t perform that action at this time.
0 commit comments