pub struct AdiPort { /* private fields */ }Expand description
A struct which represents an unconfigured ADI port.
Implementations§
Source§impl 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 input.
Sourcepub fn into_adi_digital_input(
self,
) -> Result<AdiDigitalInput, AdiDigitalInputError>
pub fn into_adi_digital_input( self, ) -> Result<AdiDigitalInput, AdiDigitalInputError>
Turns this port into an ADI digital input.
Sourcepub fn into_adi_digital_output(
self,
) -> Result<AdiDigitalOutput, AdiDigitalOutputError>
pub fn into_adi_digital_output( self, ) -> Result<AdiDigitalOutput, AdiDigitalOutputError>
Turns this port into an ADI digital output.
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 ADI 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 an ADI 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 ADI ultrasonic sensor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdiPort
impl RefUnwindSafe for AdiPort
impl Send for AdiPort
impl Sync for AdiPort
impl Unpin for AdiPort
impl UnwindSafe for AdiPort
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