pub struct Classic<I2C, Delay> { /* private fields */ }
Implementations§
Source§impl<I2C, Delay> Classic<I2C, Delay>
impl<I2C, Delay> Classic<I2C, Delay>
Sourcepub fn destroy(self) -> (I2C, Delay)
pub fn destroy(self) -> (I2C, Delay)
Destroy this driver, recovering the i2c bus and delay used to create it
Sourcepub async fn update_calibration(&mut self) -> Result<(), AsyncImplError>
pub async fn update_calibration(&mut self) -> Result<(), AsyncImplError>
Update the stored calibration for this controller
Since each device will have different tolerances, we take a snapshot of some analog data to use as the “baseline” center.
Sourcepub async fn init(&mut self) -> Result<(), AsyncImplError>
pub async fn init(&mut self) -> Result<(), AsyncImplError>
Send the init sequence to the controller and calibrate it
Sourcepub async fn read(&mut self) -> Result<ClassicReadingCalibrated, AsyncImplError>
pub async fn read(&mut self) -> Result<ClassicReadingCalibrated, AsyncImplError>
Do a read, and report axis values relative to calibration
Sourcepub async fn enable_hires(&mut self) -> Result<(), AsyncImplError>
pub async fn enable_hires(&mut self) -> Result<(), AsyncImplError>
Switch the driver from standard to hi-resolution reporting
This enables the controllers high-resolution report data mode, which returns each analogue axis as a u8, rather than packing smaller integers in a structure. If your controllers supports this mode, you should use it. It is much better.
Sourcepub async fn identify_controller(
&mut self,
) -> Result<Option<ControllerType>, AsyncImplError>
pub async fn identify_controller( &mut self, ) -> Result<Option<ControllerType>, AsyncImplError>
Determine the controller type based on the type ID of the extension controller
Trait Implementations§
Auto Trait Implementations§
impl<I2C, Delay> Freeze for Classic<I2C, Delay>
impl<I2C, Delay> RefUnwindSafe for Classic<I2C, Delay>where
I2C: RefUnwindSafe,
Delay: RefUnwindSafe,
impl<I2C, Delay> Send for Classic<I2C, Delay>
impl<I2C, Delay> Sync for Classic<I2C, Delay>
impl<I2C, Delay> Unpin for Classic<I2C, Delay>
impl<I2C, Delay> UnwindSafe for Classic<I2C, Delay>where
I2C: UnwindSafe,
Delay: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more