use embedded_hal::blocking::spi::Transfer; use cortex_m_semihosting::hprintln; use crate::Error; pub struct DDS { spi: SPI, } impl DDS where SPI: Transfer { pub fn new(spi: SPI) -> Self { DDS { spi } } } impl Transfer for ConfigRegister where SPI: Transfer { type Error = Error; fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error> { self.spi.transfer(words).map_err(Error::SPI) } }