fn read_word(&mut self, address: u32) -> Result<u32, Error> {
        let command = CString::new(format!("w{:08X},#", address)).unwrap();
        self.bus.write(command.as_bytes())?;

        let mut buffer = [0u8; 4];
        self.bus.read_exact(&mut buffer)
            .map_err(|_| FdfuError::SamBaRead(format!("a word from {:08X}", address)))?;
        let word = Cursor::new(buffer).read_u32::<BigEndian>().unwrap();
        Ok(word)
    }
/// Reads a 4 byte word from a given address in the ATSAM's memory.
Reads a 4 byte word from a given address in the ATSAM's memory.
Reads a 4 byte word from a given address in the ATSAM ' s memory .
fn read_word(&mut self, address: u32) -> Result<u32, Error> {
        let command = CString::new(format!("w{:08X},#", address)).unwrap();
        self.bus.write(command.as_bytes())?;
        let mut buffer = [0u8; 4];
        self.bus.read_exact(&mut buffer)
            .map_err(|_| FdfuError::SamBaRead(format!("a word from {:08X}", address)))?;
        let word = Cursor::new(buffer).read_u32::<BigEndian>().unwrap();
        Ok(word)
    }
fn read_word ( & mut self , address : u32 ) -> Result < u32 , Error > { let command = CString :: new ( format ! ( " " address ) ) . unwrap ( ) ; self . bus . write ( command . as_bytes ( ) ) ? ; let mut buffer = [ 0u8 ; 4 ] ; self . bus . read_exact ( & mut buffer ) . map_err ( | _ | FdfuError :: SamBaRead ( format ! ( " " address ) ) ) ? ; let word = Cursor :: new ( buffer ) . read_u32 :: < BigEndian > ( ) . unwrap ( ) ; Ok ( word ) }
Reads a 4 byte word from a given address in the ATSAM's memory.
Reads a 4 byte word from a given address in the ATSAM ' s memory .
&mut self
address
u32
&mut self
address
u32