From 4596dc29cbb00e53bb7694deeaaca2a5ec21cade Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 11 Aug 2020 11:32:10 +0800 Subject: [PATCH] generic_spi_dev: removed --- src/generic_spi_device.rs | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/generic_spi_device.rs diff --git a/src/generic_spi_device.rs b/src/generic_spi_device.rs deleted file mode 100644 index e28dffb..0000000 --- a/src/generic_spi_device.rs +++ /dev/null @@ -1,27 +0,0 @@ -use embedded_hal::blocking::spi::Transfer; -use cortex_m::asm::nop; -use cortex_m_semihosting::hprintln; -use crate::Error; - -pub struct SPIStub { - spi: SPI -} - -impl SPIStub -where - SPI: Transfer -{ - pub fn new(spi: SPI) -> Self { - SPIStub{ - spi - } - } - - pub fn do_something(&mut self) { - let mut buffer :[u8; 4]= [0xDE, 0xAD, 0xBE, 0xEF]; - match self.spi.transfer(&mut buffer).map_err(Error::SPI) { - Ok(arr) => hprintln!("{:?}", arr).unwrap(), - Err(_) => nop(), - } - } -}