[][src]Struct ftd2xx_embedded_hal::Ft232hHal

pub struct Ft232hHal { /* fields omitted */ }

FT232H device.

Implementations

impl Ft232hHal[src]

pub fn new() -> Result<Ft232hHal, DeviceTypeError>[src]

Create a new FT232H structure.

Example

use ftd2xx_embedded_hal as hal;

let ftdi = hal::Ft232hHal::new();

pub fn with_ft(ft: Ft232h) -> Ft232hHal[src]

Create a new FT232H structure from a specific FT232H device.

Examples

Selecting a device with a specific serial number.

use ftd2xx_embedded_hal as hal;
use libftd2xx::Ft232h;

let ft = Ft232h::with_serial_number("FT59UO4C")?;
let ftdi = hal::Ft232hHal::with_ft(ft);

Selecting a device with a specific description.

use ftd2xx_embedded_hal as hal;
use libftd2xx::Ft232h;

let ft = Ft232h::with_description("My device description")?;
let ftdi = hal::Ft232hHal::with_ft(ft);

pub fn spi(&self) -> Result<Spi<'_>, TimeoutError>[src]

Aquire the SPI peripheral for the FT232H.

Pin assignments:

  • AD0 => SCK
  • AD1 => MOSI
  • AD2 => MISO

Example

use ftd2xx_embedded_hal as hal;

let ftdi = hal::Ft232hHal::new()?;
let spi = ftdi.spi()?;

pub fn ad0(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 0 for the FT232H.

pub fn ad1(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 1 for the FT232H.

pub fn ad2(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 2 for the FT232H.

pub fn ad3(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 3 for the FT232H.

pub fn ad4(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 4 for the FT232H.

pub fn ad5(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 5 for the FT232H.

pub fn ad6(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 6 for the FT232H.

pub fn ad7(&self) -> OutputPin<'_>[src]

Aquire the digital output pin 7 for the FT232H.

Auto Trait Implementations

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.