[][src]Struct libftd2xx::Ftdi

pub struct Ftdi { /* fields omitted */ }

Generic FTDI device.

This structure can be used for all FTDI devices. A device-specific structure is only necessary to access the EEPROM traits for that device.

Implementations

impl Ftdi[src]

pub fn new() -> Result<Ftdi, FtStatus>[src]

Open the first device on the system.

This is equivalent to calling with_index with an index of 0.

This function cannot be used to open a specific device. Ordering of devices on a system is not guaranteed to remain constant. Calling this function multiple times may result in a different device each time when there is more than one device connected to the system. Use with_serial_number to open a specific device.

Example

use libftd2xx::Ftdi;

Ftdi::new()?;

pub fn with_index(index: i32) -> Result<Ftdi, FtStatus>[src]

Open the device by an arbitrary index and initialize the handle.

This function can open multiple devices, but it cannot be used to open a specific device. Ordering of devices on a system is not guaranteed to remain constant. Calling this function multiple times with the same index may result in a different device each time when there is more than one device connected to the system. Use with_serial_number to open a specific device.

Example

use libftd2xx::Ftdi;

Ftdi::with_index(0)?;

pub fn with_serial_number(serial_number: &str) -> Result<Ftdi, FtStatus>[src]

Open the device by its serial number and initialize the handle.

Example

use libftd2xx::Ftdi;

Ftdi::with_serial_number("FT59UO4C")?;

pub fn with_description(description: &str) -> Result<Ftdi, FtStatus>[src]

Open the device by its device description.

Example

use libftd2xx::Ftdi;

Ftdi::with_description("Hello")?;

Trait Implementations

impl FtdiCommon for Ftdi[src]

impl<'_> TryFrom<&'_ mut Ftdi> for Ft232h[src]

type Error = DeviceTypeError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ mut Ftdi> for Ft4232h[src]

type Error = DeviceTypeError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Ftdi

impl !Send for Ftdi

impl !Sync for Ftdi

impl Unpin for Ftdi

impl UnwindSafe for Ftdi

Blanket Implementations

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

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

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

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.