fn send_command_bytes(
        &mut self,
        instruction: Instruction,
        buf: &[u8],
    ) -> Result<Status, TransferError<SPIErr, PinErr>> {
        // Use tx buffer to copy the values into
        // First byte will be the opcode
        self.tx_buf[0] = instruction.opcode();
        self.tx_buf[1..=buf.len()].copy_from_slice(buf);
        // Write to spi
        self.set_ncs_low()?;
        let r = self.spi_transfer_tx_buf(buf.len())?;
        let status = Status::from(r[0]);
        self.set_ncs_high()?;

        Ok(status)
    }
// Sends an instruction with some payload data over the SPI bus
//
// Returns the status from the device
Sends an instruction with some payload data over the SPI bus
Returns the status from the device
Sends an instruction with some payload data over the SPI bus Returns the status from the device
fn send_command_bytes(
        &mut self,
        instruction: Instruction,
        buf: &[u8],
    ) -> Result<Status, TransferError<SPIErr, PinErr>> {
        // Use tx buffer to copy the values into
        // First byte will be the opcode
        self.tx_buf[0] = instruction.opcode();
        self.tx_buf[1..=buf.len()].copy_from_slice(buf);
        // Write to spi
        self.set_ncs_low()?;
        let r = self.spi_transfer_tx_buf(buf.len())?;
        let status = Status::from(r[0]);
        self.set_ncs_high()?;
        Ok(status)
    }
fn send_command_bytes ( & mut self , instruction : Instruction , buf : & [ u8 ] , ) -> Result < Status , TransferError < SPIErr , PinErr > > { // Use tx buffer to copy the values into // First byte will be the opcode self . tx_buf [ 0 ] = instruction . opcode ( ) ; self . tx_buf [ 1 ..= buf . len ( ) ] . copy_from_slice ( buf ) ; // Write to spi self . set_ncs_low ( ) ? ; let r = self . spi_transfer_tx_buf ( buf . len ( ) ) ? ; let status = Status :: from ( r [ 0 ] ) ; self . set_ncs_high ( ) ? ; Ok ( status ) }
Sends an instruction with some payload data over the SPI bus
Returns the status from the device
Sends an instruction with some payload data over the SPI bus Returns the status from the device
&mut self
instruction
Instruction
buf
&[u8]
&mut self
instruction
Instruction
buf
&[u8]