Trait libftd2xx::FtdiEeprom [−][src]
FTDI device-specific EEPROM trait.
Provided methods
fn eeprom_read(&mut self) -> Result<(Eeprom, EepromStrings), FtStatus>
[src]
Read from the FTD2XX device EEPROM.
Example
This example uses the FT232H.
use libftd2xx::{Ft4232h, Ftdi, FtdiEeprom}; use std::convert::TryFrom; let mut ftdi = Ftdi::new()?; let mut ft = Ft4232h::try_from(&mut ftdi)?; let (eeprom, eeprom_strings) = ft.eeprom_read()?; println!("FT4232H EEPROM contents: {:?}", eeprom); println!("FT4232H EEPROM strings: {:?}", eeprom_strings);
fn eeprom_program(
&mut self,
eeprom: Eeprom,
strings: EepromStrings
) -> Result<(), FtStatus>
[src]
&mut self,
eeprom: Eeprom,
strings: EepromStrings
) -> Result<(), FtStatus>
Program the FTD2XX EEPROM.
Warning
Writing bad values to the EEPROM can brick your device. Please take a moment to read the license for this crate before using this function.
Example
This example uses the FT232H.
use libftd2xx::{DriverType, Eeprom232h, EepromStrings, Ft232h, Ftdi, FtdiEeprom}; let mut ft = Ft232h::with_serial_number("FT4PWSEOA")?; let strings = EepromStrings::with_strs("FTDI", "FT", "Hello World", "FT1234567")?; let mut eeprom = Eeprom232h::default(); eeprom.set_driver_type(DriverType::D2XX); ft.eeprom_program(eeprom, strings)?;