add qei trait and implementation
This commit is contained in:
@ -9,5 +9,6 @@
|
||||
pub mod delay;
|
||||
pub mod flash;
|
||||
pub mod gpio;
|
||||
pub mod qei;
|
||||
pub mod i2c;
|
||||
pub mod uart;
|
||||
|
14
embassy-traits/src/qei.rs
Normal file
14
embassy-traits/src/qei.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use core::future::Future;
|
||||
use core::pin::Pin;
|
||||
use embedded_hal::Direction;
|
||||
|
||||
// Wait for a specified number of rotations either up or down
|
||||
pub trait WaitForRotate {
|
||||
type RotateFuture<'a>: Future<Output = Direction> + 'a;
|
||||
|
||||
fn wait_for_rotate<'a>(
|
||||
self: Pin<&'a mut Self>,
|
||||
count_down: u16,
|
||||
count_up: u16,
|
||||
) -> Self::RotateFuture<'a>;
|
||||
}
|
Reference in New Issue
Block a user