[][src]Struct k8055::K8055

pub struct K8055<'a> { /* fields omitted */ }

Object controlling one Vellemann K8055 card.

Methods

impl<'a> K8055<'a>[src]

pub fn new(ctx: &mut Context) -> Result<K8055, Error>[src]

Create a new K8055 instance with the first card found on the system.

May return None if no card was found connected to the system.

pub fn new_addr(ctx: &mut Context, addr: CardAddress) -> Result<K8055, Error>[src]

Create a new K8055 instance with a specific card address.

See the hardware jumpers on the card for your card's address. May return None if no card with the address addr can be found connected to the system.

pub fn open(&mut self) -> bool[src]

Open the device for starting IO operations.

Returns true if the device was successfully opened or is already open. Returns false if the device can't be opened.

pub fn reset(&mut self) -> Result<(), Error>[src]

Set all analog and digital values to zero.

pub fn write_digital_out(&mut self, d: DigitalChannel) -> Result<(), Error>[src]

Write the digital value d to the outports.

Leaves the analog values untouched. Returns false on failure.

pub fn write_digital_out_mask(
    &mut self,
    d: DigitalChannel,
    mask: DigitalChannel
) -> Result<(), Error>
[src]

Write the masked digital value d to the outports.

Masks d with mask to only affect bits which are on in the mask. Leaves the analog values untouched. Returns false on failure.

pub fn get_digital_out(&mut self) -> DigitalChannel[src]

Return the bits that are currently set on the digital out channel.

pub fn get_digital_out_mask(&mut self, d: DigitalChannel) -> DigitalChannel[src]

Return the bits that are currently set on the digital out channel, masked with mask.

pub fn read_digital_in(&mut self) -> Result<DigitalChannel, Error>[src]

Read the digital in channel.

Returns None on failure

pub fn read_digital_in_mask(
    &mut self,
    mask: DigitalChannel
) -> Result<DigitalChannel, Error>
[src]

Read the digital in channel masked with mask.

Returns None on failure

pub fn write_analog_out(&mut self, a: AnalogChannel) -> Result<(), Error>[src]

Write the analog value a to the given outport.

Leaves the digital values untouched. Returns false on failure.

pub fn get_analog_out1(&mut self) -> AnalogChannel[src]

Return the analog channel 1 out value

pub fn get_analog_out2(&mut self) -> AnalogChannel[src]

Return the analog channel 2 out value

pub fn read_analog_in1(&mut self) -> Result<AnalogChannel, Error>[src]

Read the analog channel 1 input value.

Returns None on failure.

pub fn read_analog_in2(&mut self) -> Result<AnalogChannel, Error>[src]

Read the analog channel 2 input value.

Returns None on failure.

Auto Trait Implementations

impl<'a> Sync for K8055<'a>

impl<'a> Send for K8055<'a>

impl<'a> Unpin for K8055<'a>

impl<'a> RefUnwindSafe for K8055<'a>

impl<'a> UnwindSafe for K8055<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]