pub struct Ft4232h { /* private fields */ }
Expand description
FT4232H device.
§Example
Converting from an unknown FTDI device.
use libftd2xx::{Ft4232h, Ftdi};
let ft4232h: Ft4232h = Ftdi::new()?.try_into()?;
Implementations§
Source§impl Ft4232h
impl Ft4232h
Sourcepub unsafe fn with_serial_number_unchecked(
serial_number: &str,
) -> Result<Ft4232h, FtStatus>
pub unsafe fn with_serial_number_unchecked( serial_number: &str, ) -> Result<Ft4232h, 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::Ft4232h;
let mut ft = unsafe { Ft4232h::with_serial_number_unchecked("FT4PWSEOA")? };
Sourcepub fn with_serial_number(
serial_number: &str,
) -> Result<Ft4232h, DeviceTypeError>
pub fn with_serial_number( serial_number: &str, ) -> Result<Ft4232h, DeviceTypeError>
Open a Ft4232h
device and initialize the handle.
§Example
use libftd2xx::Ft4232h;
Ft4232h::with_serial_number("FT4PWSEOA")?;
Sourcepub fn with_description(description: &str) -> Result<Ft4232h, DeviceTypeError>
pub fn with_description(description: &str) -> Result<Ft4232h, DeviceTypeError>
Open a Ft4232h
device by its device description.
§Example
use libftd2xx::Ft4232h;
Ft4232h::with_description("FT4232H-56Q MiniModule A")?;
Trait Implementations§
Source§impl FtdiCommon for Ft4232h
impl FtdiCommon for Ft4232h
Source§const DEVICE_TYPE: DeviceType = DeviceType::FT4232H
const DEVICE_TYPE: DeviceType = DeviceType::FT4232H
FTDI device type.
Source§fn device_type(&mut self) -> Result<DeviceType, FtStatus>
fn device_type(&mut self) -> Result<DeviceType, FtStatus>
Identify device type. Read more
Source§fn device_info(&mut self) -> Result<DeviceInfo, FtStatus>
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>
fn driver_version(&mut self) -> Result<Version, FtStatus>
Returns the D2XX driver version number. Read more
Source§fn reset(&mut self) -> Result<(), FtStatus>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn purge_all(&mut self) -> Result<(), FtStatus>
This function purges the transmit and receive buffers in the device. Read more
Source§fn com_port_number(&mut self) -> Result<Option<u32>, FtStatus>
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>
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>
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>
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>
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>
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>
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>
fn eeprom_user_size(&mut self) -> Result<usize, FtStatus>
Get the available size of the EEPROM user area in bytes. Read more
Source§impl FtdiEeprom<ft_eeprom_4232h, Eeprom4232h> for Ft4232h
impl FtdiEeprom<ft_eeprom_4232h, Eeprom4232h> for Ft4232h
Source§fn eeprom_read(&mut self) -> Result<(Eeprom, EepromStrings), FtStatus>
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>
fn eeprom_program( &mut self, eeprom: Eeprom, strings: EepromStrings, ) -> Result<(), FtStatus>
Program the FTD2XX EEPROM. Read more
Source§impl FtdiMpsse for Ft4232h
impl FtdiMpsse for Ft4232h
Source§fn set_clock(&mut self, frequency: u32) -> Result<(), TimeoutError>
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>
fn initialize_mpsse( &mut self, settings: &MpsseSettings, ) -> Result<(), TimeoutError>
Initialize the MPSSE. Read more
Source§fn initialize_mpsse_default(&mut self) -> Result<(), TimeoutError>
fn initialize_mpsse_default(&mut self) -> Result<(), TimeoutError>
Initializes the MPSSE to default settings. Read more
Source§fn synchronize_mpsse(&mut self) -> Result<(), TimeoutError>
fn synchronize_mpsse(&mut self) -> Result<(), TimeoutError>
Synchronize the MPSSE port with the application. Read more
Source§fn enable_loopback(&mut self) -> Result<(), TimeoutError>
fn enable_loopback(&mut self) -> Result<(), TimeoutError>
Enable the MPSSE loopback state. Read more
Source§fn disable_loopback(&mut self) -> Result<(), TimeoutError>
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>
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>
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>
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>
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>
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>
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>
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 Ft4232h
impl Ftx232hMpsse for Ft4232h
Source§fn enable_3phase_data_clocking(&mut self) -> Result<(), TimeoutError>
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>
fn disable_3phase_data_clocking(&mut self) -> Result<(), TimeoutError>
Disable 3 phase data clocking. Read more
Source§impl MpsseCmdExecutor for Ft4232h
impl MpsseCmdExecutor for Ft4232h
Source§type Error = TimeoutError
type Error = TimeoutError
Error type
Source§fn init(&mut self, settings: &MpsseSettings) -> Result<(), Self::Error>
fn init(&mut self, settings: &MpsseSettings) -> Result<(), Self::Error>
Configure FTDI MPSSE mode
Source§fn send(&mut self, data: &[u8]) -> Result<(), Self::Error>
fn send(&mut self, data: &[u8]) -> Result<(), Self::Error>
Execute MPSSE write command sequence
Auto Trait Implementations§
impl Freeze for Ft4232h
impl RefUnwindSafe for Ft4232h
impl Send for Ft4232h
impl Sync for Ft4232h
impl Unpin for Ft4232h
impl UnwindSafe for Ft4232h
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more