Struct libftd2xx::Ft232h

source ·
pub struct Ft232h { /* private fields */ }
Expand description

FT232H device.

§Example

Converting from an unknown FTDI device.

use libftd2xx::{Ft232h, Ftdi};

let ft232h: Ft232h = Ftdi::new()?.try_into()?;

Implementations§

source§

impl Ft232h

source

pub unsafe fn with_serial_number_unchecked( serial_number: &str ) -> Result<Ft232h, FtStatus>

Open a Ft4232h device and initialize the handle.

§Safety

This is unchecked meaning a device type check will not be performed. Methods that require this specific device type may fail in unexpected ways if the wrong device is used.

§Example
use libftd2xx::Ft232h;

let mut ft = unsafe { Ft232h::with_serial_number_unchecked("FT5AVX6B")? };
source

pub fn with_serial_number( serial_number: &str ) -> Result<Ft232h, DeviceTypeError>

Open a Ft232h device and initialize the handle.

§Example
use libftd2xx::Ft232h;

Ft232h::with_serial_number("FT59UO4C")?;
source

pub fn with_description(description: &str) -> Result<Ft232h, DeviceTypeError>

Open a Ft232h device by its device description.

§Example
use libftd2xx::Ft232h;

Ft232h::with_description("Hello")?;

Trait Implementations§

source§

impl Debug for Ft232h

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FtdiCommon for Ft232h

source§

const DEVICE_TYPE: DeviceType = DeviceType::FT232H

FTDI device type.
source§

fn handle(&mut self) -> FT_HANDLE

Get the FTDI device handle.
source§

fn device_type(&mut self) -> Result<DeviceType, FtStatus>

Identify device type. Read more
source§

fn device_info(&mut self) -> Result<DeviceInfo, FtStatus>

Get device information for an open device. Read more
source§

fn driver_version(&mut self) -> Result<Version, FtStatus>

Returns the D2XX driver version number. Read more
source§

fn reset(&mut self) -> Result<(), FtStatus>

This function sends a reset command to the device. Read more
source§

fn set_usb_parameters(&mut self, in_transfer_size: u32) -> Result<(), FtStatus>

Set the USB request transfer size. Read more
source§

fn set_chars( &mut self, event_char: u8, event_enable: bool, error_char: u8, error_enable: bool ) -> Result<(), FtStatus>

This function sets the special characters for the device. Read more
source§

fn set_timeouts( &mut self, read_timeout: Duration, write_timeout: Duration ) -> Result<(), FtStatus>

This function sets the read and write timeouts for the device. Read more
source§

fn set_deadman_timeout(&mut self, timeout: Duration) -> Result<(), FtStatus>

This method allows the maximum time in milliseconds that a USB request can remain outstandingto be set. Read more
source§

fn set_latency_timer(&mut self, timer: Duration) -> Result<(), FtStatus>

Set the latency timer value. Read more
source§

fn latency_timer(&mut self) -> Result<Duration, FtStatus>

Get the current value of the latency timer. Read more
source§

fn set_flow_control_none(&mut self) -> Result<(), FtStatus>

This function disables flow control for the device. Read more
source§

fn set_flow_control_rts_cts(&mut self) -> Result<(), FtStatus>

This function sets RTS/CTS flow control for the device. Read more
source§

fn set_flow_control_dtr_dsr(&mut self) -> Result<(), FtStatus>

This function sets DTS/DSR flow control for the device. Read more
source§

fn set_flow_control_xon_xoff( &mut self, xon: u8, xoff: u8 ) -> Result<(), FtStatus>

This function sets XON/XOFF flow control for the device. Read more
source§

fn set_baud_rate(&mut self, baud_rate: u32) -> Result<(), FtStatus>

Set the baud rate for the device. Read more
source§

fn set_data_characteristics( &mut self, bits_per_word: BitsPerWord, stop_bits: StopBits, parity: Parity ) -> Result<(), FtStatus>

Set the data characteristics for the device. Read more
source§

fn set_dtr(&mut self) -> Result<(), FtStatus>

Set the Data Terminal Ready (DTR) control signal. Read more
source§

fn clear_dtr(&mut self) -> Result<(), FtStatus>

Clear the Data Terminal Ready (DTR) control signal. Read more
source§

fn set_rts(&mut self) -> Result<(), FtStatus>

Set the Request to Send (RTS) control signal. Read more
source§

fn clear_rts(&mut self) -> Result<(), FtStatus>

Clear the Request to Send (RTS) control signal. Read more
source§

fn set_bit_mode(&mut self, mask: u8, mode: BitMode) -> Result<(), FtStatus>

Enables different chip modes. Read more
source§

fn bit_mode(&mut self) -> Result<u8, FtStatus>

Get the instantaneous value of the data bus. Read more
source§

fn set_break_on(&mut self) -> Result<(), FtStatus>

Sets the BREAK condition for the device. Read more
source§

fn set_break_off(&mut self) -> Result<(), FtStatus>

Resets the BREAK condition for the device. Read more
source§

fn queue_status(&mut self) -> Result<usize, FtStatus>

Gets the number of bytes in the receive queue. Read more
source§

fn status(&mut self) -> Result<DeviceStatus, FtStatus>

Gets the device status including number of characters in the receive queue, number of characters in the transmit queue, and the current event status. Read more
source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, FtStatus>

Read data from the device, returning the number of bytes read. Read more
source§

fn read_all(&mut self, buf: &mut [u8]) -> Result<(), TimeoutError>

Read data from the device. Read more
source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), TimeoutError>

Write data to the device. Read more
source§

fn write(&mut self, buf: &[u8]) -> Result<usize, FtStatus>

Write data to the device, returning how many bytes were written. Read more
source§

fn purge_tx(&mut self) -> Result<(), FtStatus>

This function purges the transmit buffers in the device. Read more
source§

fn purge_rx(&mut self) -> Result<(), FtStatus>

This function purges the receive buffers in the device. Read more
source§

fn purge_all(&mut self) -> Result<(), FtStatus>

This function purges the transmit and receive buffers in the device. Read more
source§

fn close(&mut self) -> Result<(), FtStatus>

Close an open device. Read more
source§

fn com_port_number(&mut self) -> Result<Option<u32>, FtStatus>

Available on Windows only.
Get the COM port associated with a device. Read more
source§

fn reset_port(&mut self) -> Result<(), FtStatus>

Available on Windows only.
Send a reset command to the port. Read more
source§

fn cycle_port(&mut self) -> Result<(), FtStatus>

Available on Windows only.
Send a cycle command to the USB port. Read more
source§

fn modem_status(&mut self) -> Result<ModemStatus, FtStatus>

Gets the modem status and line status from the device. Read more
source§

fn eeprom_word_read(&mut self, offset: u32) -> Result<u16, FtStatus>

Read a value from an EEPROM location. Read more
source§

fn eeprom_word_write(&mut self, offset: u32, value: u16) -> Result<(), FtStatus>

Writes a value to an EEPROM location. Read more
source§

fn eeprom_erase(&mut self) -> Result<(), FtStatus>

Erases the entire contents of the EEPROM, including the user area. Read more
source§

fn eeprom_user_size(&mut self) -> Result<usize, FtStatus>

Get the available size of the EEPROM user area in bytes. Read more
source§

fn eeprom_user_read(&mut self, buf: &mut [u8]) -> Result<usize, FtStatus>

Read the contents of the EEPROM user area. Read more
source§

fn eeprom_user_write(&mut self, buf: &[u8]) -> Result<(), FtStatus>

Write to the EEPROM user area. Read more
source§

impl FtdiEeprom<ft_eeprom_232h, Eeprom232h> for Ft232h

source§

fn eeprom_read(&mut self) -> Result<(Eeprom, EepromStrings), FtStatus>

Read from the FTD2XX device EEPROM. Read more
source§

fn eeprom_program( &mut self, eeprom: Eeprom, strings: EepromStrings ) -> Result<(), FtStatus>

Program the FTD2XX EEPROM. Read more
source§

impl FtdiMpsse for Ft232h

source§

fn set_clock(&mut self, frequency: u32) -> Result<(), TimeoutError>

Set the clock frequency. Read more
source§

fn initialize_mpsse( &mut self, settings: &MpsseSettings ) -> Result<(), TimeoutError>

Initialize the MPSSE. Read more
source§

fn initialize_mpsse_default(&mut self) -> Result<(), TimeoutError>

Initializes the MPSSE to default settings. Read more
source§

fn synchronize_mpsse(&mut self) -> Result<(), TimeoutError>

Synchronize the MPSSE port with the application. Read more
source§

fn enable_loopback(&mut self) -> Result<(), TimeoutError>

Enable the MPSSE loopback state. Read more
source§

fn disable_loopback(&mut self) -> Result<(), TimeoutError>

Disable the MPSSE loopback state. Read more
source§

fn set_gpio_lower( &mut self, state: u8, direction: u8 ) -> Result<(), TimeoutError>

Set the pin direction and state of the lower byte (0-7) GPIO pins on the MPSSE interface. Read more
source§

fn gpio_lower(&mut self) -> Result<u8, TimeoutError>

Get the pin state state of the lower byte (0-7) GPIO pins on the MPSSE interface. Read more
source§

fn set_gpio_upper( &mut self, state: u8, direction: u8 ) -> Result<(), TimeoutError>

Set the pin direction and state of the upper byte (8-15) GPIO pins on the MPSSE interface. Read more
source§

fn gpio_upper(&mut self) -> Result<u8, TimeoutError>

Get the pin state state of the upper byte (8-15) GPIO pins on the MPSSE interface. Read more
source§

fn clock_data_out( &mut self, mode: ClockDataOut, data: &[u8] ) -> Result<(), TimeoutError>

Clock data out. Read more
source§

fn clock_data_in( &mut self, mode: ClockDataIn, data: &mut [u8] ) -> Result<(), TimeoutError>

Clock data in. Read more
source§

fn clock_data( &mut self, mode: ClockData, data: &mut [u8] ) -> Result<(), TimeoutError>

Clock data in and out at the same time.
source§

impl Ftx232hMpsse for Ft232h

source§

fn enable_3phase_data_clocking(&mut self) -> Result<(), TimeoutError>

Enable 3 phase data clocking. Read more
source§

fn disable_3phase_data_clocking(&mut self) -> Result<(), TimeoutError>

Disable 3 phase data clocking. Read more
source§

impl MpsseCmdExecutor for Ft232h

§

type Error = TimeoutError

Error type
source§

fn init(&mut self, settings: &MpsseSettings) -> Result<(), Self::Error>

Configure FTDI MPSSE mode
source§

fn send(&mut self, data: &[u8]) -> Result<(), Self::Error>

Execute MPSSE write command sequence
source§

fn recv(&mut self, data: &mut [u8]) -> Result<(), Self::Error>

Execute MPSSE read command sequence
source§

fn xfer(&mut self, txdata: &[u8], rxdata: &mut [u8]) -> Result<(), Self::Error>

Execute MPSSE command and read response
source§

impl TryFrom<Ftdi> for Ft232h

§

type Error = DeviceTypeError

The type returned in the event of a conversion error.
source§

fn try_from(ft: Ftdi) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.