pub struct AdiDigitalInput { /* private fields */ }Expand description
A struct which represents a V5 ADI port configured as an ADI digital input.
Implementations§
Source§impl AdiDigitalInput
impl AdiDigitalInput
Sourcepub unsafe fn new(
port: u8,
expander_port: u8,
) -> Result<Self, AdiDigitalInputError>
pub unsafe fn new( port: u8, expander_port: u8, ) -> Result<Self, AdiDigitalInputError>
Initializes an ADI digital input on an ADI port.
§Safety
This function is unsafe because it allows the user to create multiple
mutable references to the same ADI digital input. You likely want to
implement Robot::new() instead.
Sourcepub fn read(&self) -> Result<bool, AdiDigitalInputError>
pub fn read(&self) -> Result<bool, AdiDigitalInputError>
Gets the digital value (true or false) of the input.
Trait Implementations§
Source§impl DataSource for AdiDigitalInput
impl DataSource for AdiDigitalInput
Auto Trait Implementations§
impl Freeze for AdiDigitalInput
impl RefUnwindSafe for AdiDigitalInput
impl Send for AdiDigitalInput
impl Sync for AdiDigitalInput
impl Unpin for AdiDigitalInput
impl UnwindSafe for AdiDigitalInput
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
Source§impl<T> IntoBroadcast for Twhere
T: DataSource,
impl<T> IntoBroadcast for Twhere
T: DataSource,
Source§fn into_broadcast(
self,
) -> Result<BroadcastWrapper<T>, (<T as DataSource>::Error, T)>
fn into_broadcast( self, ) -> Result<BroadcastWrapper<T>, (<T as DataSource>::Error, T)>
Converts the data source into a
BroadcastWrapper. Read more