Struct libftd2xx::EepromHeader

source ·
pub struct EepromHeader(/* private fields */);
Expand description

FTDI EEPROM header common to all FTDI devices.

Implementations§

source§

impl EepromHeader

source

pub fn set_device_type(&mut self, device_type: DeviceType)

Set the FTDI device type.

source

pub fn vendor_id(&self) -> u16

FTDI USB device vendor ID.

This is typically 0x0403.

source

pub fn set_vendor_id(&mut self, value: u16)

Set the FTDI USB device vendor ID.

source

pub fn product_id(&self) -> u16

FTDI USB product ID.

Typical FTDI product IDs:

  • 0x6001 FT232AM/FT232BM/FT232R
  • 0x6010 FT2232C/FT2232D/FT2232H
  • 0x6011 FT4232/FT4232H
  • 0x6014 FT232H
  • 0x6015 FT230X/FT231X/FT234X
source

pub fn set_product_id(&mut self, value: u16)

Set the FTDI USB product ID.

source

pub fn serial_number_enable(&self) -> bool

Serial Number Enable.

true if the serial number is to be used.

The documentation is unclear what exactly this means.

source

pub fn set_serial_number_enable(&mut self, value: bool)

Set Serial Number Enable.

source

pub fn max_current(&self) -> u16

Maximum bus current.

The unit for this value is milliamps, and the value range is 0-500 mA.

source

pub fn set_max_current(&mut self, value: u16)

Set maximum bus current in milliamps.

Values greater than 500 mA (500u16) will result in panic.

source

pub fn self_powered(&self) -> bool

Device power source.

  • true if the device is self-powered (not powered by USB bus).
  • false if the device is powered by the USB bus.
source

pub fn set_self_powered(&mut self, value: bool)

Set device power source.

  • true if the device is self-powered (not powered by USB bus).
  • false if the device is powered by the USB bus.
source

pub fn remote_wakeup(&self) -> bool

Remote wakeup capabilities.

USB remote wakeup is the ability for the device to resume the PC from USB suspend (sleep) state.

  • true if the device is capable of remote wakeup.
  • false if the device is not capable of remote wakeup.
source

pub fn set_remote_wakeup(&mut self, value: bool)

Set remote wakeup capabilities.

USB remote wakeup is the ability for the device to resume the PC from USB suspend (sleep) state.

  • true if the device is capable of remote wakeup.
  • false if the device is not capable of remote wakeup.
source

pub fn pull_down_enable(&self) -> bool

Pull down in suspend mode.

  • true if pull-down in suspend is enabled.
  • false if pull-down in suspend is disabled.
source

pub fn set_pull_down_enable(&mut self, value: bool)

Set pull down in suspend mode.

  • true if pull-down in suspend is enabled.
  • false if pull-down in suspend is disabled.

Trait Implementations§

source§

impl Clone for EepromHeader

source§

fn clone(&self) -> EepromHeader

Returns a copy 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 EepromHeader

source§

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

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

impl Default for EepromHeader

source§

fn default() -> Self

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

impl From<EepromHeader> for FT_EEPROM_HEADER

source§

fn from(val: EepromHeader) -> FT_EEPROM_HEADER

Converts to this type from the input type.
source§

impl From<ft_eeprom_header> for EepromHeader

source§

fn from(val: FT_EEPROM_HEADER) -> EepromHeader

Converts to this type from the input type.
source§

impl Copy for EepromHeader

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

§

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

§

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.