fn synchronize_mpsse(&mut self) -> Result<(), TimeoutError> {
        self.purge_rx()?;
        debug_assert_eq!(self.queue_status()?, 0);
        self.write_all(&[ECHO_CMD_2])?;

        // the FTDI MPSSE basics polls the queue status here
        // we purged the RX buffer so the response should always be 2 bytes
        // this allows us to leverage the timeout built into read
        let mut buf: [u8; 2] = [0; 2];
        self.read_all(&mut buf)?;

        if buf[0] == 0xFA && buf[1] == ECHO_CMD_2 {
            Ok(())
        } else {
            Err(TimeoutError::from(FtStatus::OTHER_ERROR))
        }
    }
/// Synchronize the MPSSE port with the application.
///
/// There are various implementations of the synchronization flow, this
/// uses the flow from [FTDI MPSSE Basics].
///
/// [FTDI MPSSE Basics]: https://www.ftdichip.com/Support/Documents/AppNotes/AN_135_MPSSE_Basics.pdf
Synchronize the MPSSE port with the application.
There are various implementations of the synchronization flow, this
uses the flow from [FTDI MPSSE Basics].


Synchronize the MPSSE port with the application . There are various implementations of the synchronization flow this uses the flow from [ FTDI MPSSE Basics ] .
fn synchronize_mpsse(&mut self) -> Result<(), TimeoutError> {
        self.purge_rx()?;
        debug_assert_eq!(self.queue_status()?, 0);
        self.write_all(&[ECHO_CMD_2])?;
        // the FTDI MPSSE basics polls the queue status here
        // we purged the RX buffer so the response should always be 2 bytes
        // this allows us to leverage the timeout built into read
        let mut buf: [u8; 2] = [0; 2];
        self.read_all(&mut buf)?;
        if buf[0] == 0xFA && buf[1] == ECHO_CMD_2 {
            Ok(())
        } else {
            Err(TimeoutError::from(FtStatus::OTHER_ERROR))
        }
    }
fn synchronize_mpsse ( & mut self ) -> Result < ( ) , TimeoutError > { self . purge_rx ( ) ? ; debug_assert_eq ! ( self queue_status ( ) 0 ) ; self . write_all ( & [ ECHO_CMD_2 ] ) ? ; // the FTDI MPSSE basics polls the queue status here // we purged the RX buffer so the response should always be 2 bytes // this allows us to leverage the timeout built into read let mut buf : [ u8 ; 2 ] = [ 0 ; 2 ] ; self . read_all ( & mut buf ) ? ; if buf [ 0 ] == 0xFA && buf [ 1 ] == ECHO_CMD_2 { Ok ( ( ) ) } else { Err ( TimeoutError :: from ( FtStatus :: OTHER_ERROR ) ) } }
Synchronize the MPSSE port with the application.
Synchronize the MPSSE port with the application .
&mut self
&mut self