pub struct Classic<I2C, DELAY> { /* private fields */ }
Implementations§
Source§impl<T, E, DELAY> Classic<T, DELAY>
impl<T, E, DELAY> Classic<T, DELAY>
Sourcepub fn new(
i2cdev: T,
delay: DELAY,
) -> Result<Classic<T, DELAY>, BlockingImplError<E>>
pub fn new( i2cdev: T, delay: DELAY, ) -> Result<Classic<T, DELAY>, BlockingImplError<E>>
Create a new Wii Classic Controller
Sourcepub fn destroy(self) -> (T, DELAY)
pub fn destroy(self) -> (T, DELAY)
Destroy this driver, recovering the i2c bus and delay used to create it
Sourcepub fn update_calibration(&mut self) -> Result<(), BlockingImplError<E>>
pub fn update_calibration(&mut self) -> Result<(), BlockingImplError<E>>
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 fn init(&mut self) -> Result<(), BlockingImplError<E>>
pub fn init(&mut self) -> Result<(), BlockingImplError<E>>
Send the init sequence to the controller
Sourcepub fn enable_hires(&mut self) -> Result<(), BlockingImplError<E>>
pub fn enable_hires(&mut self) -> Result<(), BlockingImplError<E>>
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 fn identify_controller(
&mut self,
) -> Result<Option<ControllerType>, BlockingImplError<E>>
pub fn identify_controller( &mut self, ) -> Result<Option<ControllerType>, BlockingImplError<E>>
Determine the controller type based on the type ID of the extension controller
Sourcepub fn read_uncalibrated(
&mut self,
) -> Result<ClassicReading, BlockingImplError<E>>
pub fn read_uncalibrated( &mut self, ) -> Result<ClassicReading, BlockingImplError<E>>
Do a read, and return button and axis values without applying calibration
Sourcepub fn read(&mut self) -> Result<ClassicReadingCalibrated, BlockingImplError<E>>
pub fn read(&mut self) -> Result<ClassicReadingCalibrated, BlockingImplError<E>>
Do a read, and return button and axis values relative to calibration