Enum DeviceType

Source
#[repr(u32)]
pub enum DeviceType {
Show 25 variants FTBM = 0, FTAM = 1, FT100AX = 2, Unknown = 3, FT2232C = 4, FT232R = 5, FT2232H = 6, FT4232H = 7, FT232H = 8, FT_X_SERIES = 9, FT4222H_0 = 10, FT4222H_1_2 = 11, FT4222H_3 = 12, FT4222_PROG = 13, FT900 = 14, FT930 = 15, FTUMFTPD3A = 16, FT2233HP = 17, FT4233HP = 18, FT2232HP = 19, FT4232HP = 20, FT233HP = 21, FT232HP = 22, FT2232HA = 23, FT4232HA = 24,
}
Expand description

FTDI device types.

There is an unfortunate lack of documentation for which chip shows up as which device with the FTD2XX driver.

This is used in the DeviceInfo struct.

Variants§

§

FTBM = 0

FTDI BM device.

§

FTAM = 1

FTDI AM device.

§

FT100AX = 2

FTDI 100AX device.

§

Unknown = 3

Unknown FTDI device.

This frequently occurs on Linux when the VCP FTDI driver is in use.

The driver can be removed with these commands.

sudo rmmod ftdi_sio
sudo rmmod usbserial

See FTDI Drivers Installation Guide for Linux for more details.

§

FT2232C = 4

FTDI 2232C device.

The FTDI 2232D also appears as a FTDI 2232C.

§

FT232R = 5

FTDI 232R device.

§

FT2232H = 6

FT2232H device.

§

FT4232H = 7

FT4232H device.

§

FT232H = 8

FT232H device.

§

FT_X_SERIES = 9

FTDI x series device.

§

FT4222H_0 = 10

FT4222H device.

§

FT4222H_1_2 = 11

FT4222H device.

§

FT4222H_3 = 12

FT4222H device.

§

FT4222_PROG = 13

FT4222 device.

§

FT900 = 14

FT900 device.

§

FT930 = 15

FT930 device.

§

FTUMFTPD3A = 16

FTUMFTPD3A device.

§

FT2233HP = 17

FT2233HP device.

§

FT4233HP = 18

FT4233HP device.

§

FT2232HP = 19

FT2232HP device.

§

FT4232HP = 20

FT4232HP device.

§

FT233HP = 21

FT233HP device.

§

FT232HP = 22

FT232HP device.

§

FT2232HA = 23

FT2232HA device.

§

FT4232HA = 24

FT4232HA device.

Implementations§

Source§

impl DeviceType

Source

pub const fn with_pid(pid: u16) -> Option<DeviceType>

Get a device type with a USB product ID.

This is not entirely accurate since some devices share the same PID.

§Example
use libftd2xx::DeviceType;

let my_device: Option<DeviceType> = DeviceType::with_pid(0x6014);
assert_eq!(my_device, Some(DeviceType::FT232H));

Trait Implementations§

Source§

impl Clone for DeviceType

Source§

fn clone(&self) -> DeviceType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceType

Source§

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

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

impl Default for DeviceType

Source§

fn default() -> DeviceType

Returns the “default value” for a type. Read more
Source§

impl From<u32> for DeviceType

Source§

fn from(value: u32) -> DeviceType

Converts to this type from the input type.
Source§

impl Ord for DeviceType

Source§

fn cmp(&self, other: &DeviceType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for DeviceType

Source§

fn eq(&self, other: &DeviceType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for DeviceType

Source§

fn partial_cmp(&self, other: &DeviceType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for DeviceType

Source§

impl Eq for DeviceType

Source§

impl StructuralPartialEq for DeviceType

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.