pub struct AdiPort { /* private fields */ }
Expand description
A struct which represents an unconfigured ADI port.
Implementations
sourceimpl AdiPort
impl AdiPort
sourcepub unsafe fn new(port: u8, expander_port: u8) -> Self
pub unsafe fn new(port: u8, expander_port: u8) -> Self
Constructs a new ADI port.
Safety
This function is unsafe because it allows the user to create multiple
mutable references to an V5 ADI port. You likely want to implement
Robot::new()
instead.
sourcepub fn into_adi_analog(self) -> Result<AdiAnalog, AdiAnalogError>
pub fn into_adi_analog(self) -> Result<AdiAnalog, AdiAnalogError>
Turns this port into an ADI analog
sourcepub fn into_adi_encoder(
self,
bottom: Self
) -> Result<AdiEncoder, AdiEncoderError>
pub fn into_adi_encoder(
self,
bottom: Self
) -> Result<AdiEncoder, AdiEncoderError>
Turns this and another port into an encoder
sourcepub fn into_adi_gyro(self, multiplier: f64) -> Result<AdiGyro, AdiGyroError>
pub fn into_adi_gyro(self, multiplier: f64) -> Result<AdiGyro, AdiGyroError>
Turns this port into a gyro
sourcepub fn into_adi_ultrasonic(
self,
bottom: Self
) -> Result<AdiUltrasonic, AdiUltrasonicError>
pub fn into_adi_ultrasonic(
self,
bottom: Self
) -> Result<AdiUltrasonic, AdiUltrasonicError>
Turns this and another port into an ultrasonic sensor
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AdiPort
impl Send for AdiPort
impl Sync for AdiPort
impl Unpin for AdiPort
impl UnwindSafe for AdiPort
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more