aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-traits/src/qei.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/embassy-traits/src/qei.rs b/embassy-traits/src/qei.rs
index 7e0a8961f..73581256d 100644
--- a/embassy-traits/src/qei.rs
+++ b/embassy-traits/src/qei.rs
@@ -6,6 +6,14 @@ use embedded_hal::Direction;
6pub trait WaitForRotate { 6pub trait WaitForRotate {
7 type RotateFuture<'a>: Future<Output = Direction> + 'a; 7 type RotateFuture<'a>: Future<Output = Direction> + 'a;
8 8
9 /// Wait for a specified number of rotations, in ticks, either up or down.
10 ///
11 /// Return Direction::Upcounting if the high bound is reached.
12 /// Return Direction::Downcounting if the low bound is reached.
13 ///
14 /// Number of ticks is encoder dependent. As an example, if we connect
15 /// the Bourns PEC11H-4120F-S0020, we have 20 ticks per full rotation.
16 /// Other encoders may vary.
9 fn wait_for_rotate<'a>( 17 fn wait_for_rotate<'a>(
10 self: Pin<&'a mut Self>, 18 self: Pin<&'a mut Self>,
11 count_down: u16, 19 count_down: u16,