[−][src]Struct libftd2xx::Ftdi
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]
const DEVICE_TYPE: DeviceType
[src]
fn handle(&mut self) -> FT_HANDLE
[src]
fn device_info(&mut self) -> Result<DeviceInfo, FtStatus>
[src]
fn driver_version(&mut self) -> Result<Version, FtStatus>
[src]
fn reset(&mut self) -> Result<(), FtStatus>
[src]
fn set_usb_parameters(&mut self, in_transfer_size: u32) -> Result<(), FtStatus>
[src]
fn set_chars(
&mut self,
event_char: u8,
event_enable: bool,
error_char: u8,
error_enable: bool
) -> Result<(), FtStatus>
[src]
&mut self,
event_char: u8,
event_enable: bool,
error_char: u8,
error_enable: bool
) -> Result<(), FtStatus>
fn set_timeouts(
&mut self,
read_timeout: Duration,
write_timeout: Duration
) -> Result<(), FtStatus>
[src]
&mut self,
read_timeout: Duration,
write_timeout: Duration
) -> Result<(), FtStatus>
fn set_deadman_timeout(&mut self, timeout: Duration) -> Result<(), FtStatus>
[src]
fn set_latency_timer(&mut self, timer: Duration) -> Result<(), FtStatus>
[src]
fn latency_timer(&mut self) -> Result<Duration, FtStatus>
[src]
fn set_flow_control_none(&mut self) -> Result<(), FtStatus>
[src]
fn set_flow_control_rts_cts(&mut self) -> Result<(), FtStatus>
[src]
fn set_flow_control_dtr_dsr(&mut self) -> Result<(), FtStatus>
[src]
fn set_flow_control_xon_xoff(
&mut self,
xon: u8,
xoff: u8
) -> Result<(), FtStatus>
[src]
&mut self,
xon: u8,
xoff: u8
) -> Result<(), FtStatus>
fn set_baud_rate(&mut self, baud_rate: u32) -> Result<(), FtStatus>
[src]
fn set_data_characteristics(
&mut self,
bits_per_word: BitsPerWord,
stop_bits: StopBits,
parity: Parity
) -> Result<(), FtStatus>
[src]
&mut self,
bits_per_word: BitsPerWord,
stop_bits: StopBits,
parity: Parity
) -> Result<(), FtStatus>
fn set_dtr(&mut self) -> Result<(), FtStatus>
[src]
fn clear_dtr(&mut self) -> Result<(), FtStatus>
[src]
fn set_rts(&mut self) -> Result<(), FtStatus>
[src]
fn clear_rts(&mut self) -> Result<(), FtStatus>
[src]
fn set_bit_mode(&mut self, mask: u8, mode: BitMode) -> Result<(), FtStatus>
[src]
fn bit_mode(&mut self) -> Result<u8, FtStatus>
[src]
fn set_break_on(&mut self) -> Result<(), FtStatus>
[src]
fn set_break_off(&mut self) -> Result<(), FtStatus>
[src]
fn queue_status(&mut self) -> Result<usize, FtStatus>
[src]
fn status(&mut self) -> Result<DeviceStatus, FtStatus>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<(), TimeoutError>
[src]
fn write(&mut self, buf: &[u8]) -> Result<(), TimeoutError>
[src]
fn purge_tx(&mut self) -> Result<(), FtStatus>
[src]
fn purge_rx(&mut self) -> Result<(), FtStatus>
[src]
fn purge_all(&mut self) -> Result<(), FtStatus>
[src]
fn close(&mut self) -> Result<(), FtStatus>
[src]
fn modem_status(&mut self) -> Result<ModemStatus, FtStatus>
[src]
fn eeprom_word_read(&mut self, offset: u32) -> Result<u16, FtStatus>
[src]
fn eeprom_word_write(&mut self, offset: u32, value: u16) -> Result<(), FtStatus>
[src]
fn eeprom_erase(&mut self) -> Result<(), FtStatus>
[src]
fn eeprom_user_size(&mut self) -> Result<usize, FtStatus>
[src]
fn eeprom_user_read(&mut self, buf: &mut [u8]) -> Result<usize, FtStatus>
[src]
fn eeprom_user_write(&mut self, buf: &[u8]) -> Result<(), FtStatus>
[src]
impl<'_> TryFrom<&'_ mut Ftdi> for Ft232h
[src]
type Error = DeviceTypeError
The type returned in the event of a conversion error.
fn try_from(ft: &mut Ftdi) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ mut Ftdi> for Ft4232h
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,