pub fn debug_view(
        &mut self,
    ) -> Result<crate::config::DebugInfo, TransferError<SPIErr, PinErr>> {
        let channel = self.channel()?;
        let data_rate = self.data_rate()?;
        let pa_level = self.power_amp_level()?;
        // doesn't read actual payload TODO: fix
        let payload_size = self.payload_size();
        let crc_encoding_scheme = self.crc_encoding_scheme()?;
        let retry_setup = self.retries()?;

        let config_reg = self.read_register(Register::CONFIG)?;
        let mode = if config_reg & 1 == 0 {
            Mode::TransmissionMode
        } else {
            Mode::ReceiverMode
        };

        let addr_width = AddressWidth::from_register(self.read_register(Register::SETUP_AW)?);

        let tx_addr = self.read_tx()?;
        let rx1_addr = self.read_rx()?;
        let auto_ack = self.read_register(Register::EN_AA)?;
        let open_read_pipes = self.read_register(Register::EN_RXADDR)?;

        Ok(crate::config::DebugInfo {
            channel,
            data_rate,
            pa_level,
            crc_encoding_scheme,
            payload_size,
            retry_setup,
            mode,
            addr_width,
            tx_addr,
            auto_ack,
            open_read_pipes,
            rx1_addr,
        })
    }
/// Returns a debug struct for printing information regarding current setup
///
/// # Example
/// ```rust
/// ```
Returns a debug struct for printing information regarding current setup
Returns a debug struct for printing information regarding current setup
pub fn debug_view(
        &mut self,
    ) -> Result<crate::config::DebugInfo, TransferError<SPIErr, PinErr>> {
        let channel = self.channel()?;
        let data_rate = self.data_rate()?;
        let pa_level = self.power_amp_level()?;
        // doesn't read actual payload TODO: fix
        let payload_size = self.payload_size();
        let crc_encoding_scheme = self.crc_encoding_scheme()?;
        let retry_setup = self.retries()?;
        let config_reg = self.read_register(Register::CONFIG)?;
        let mode = if config_reg & 1 == 0 {
            Mode::TransmissionMode
        } else {
            Mode::ReceiverMode
        };
        let addr_width = AddressWidth::from_register(self.read_register(Register::SETUP_AW)?);
        let tx_addr = self.read_tx()?;
        let rx1_addr = self.read_rx()?;
        let auto_ack = self.read_register(Register::EN_AA)?;
        let open_read_pipes = self.read_register(Register::EN_RXADDR)?;
        Ok(crate::config::DebugInfo {
            channel,
            data_rate,
            pa_level,
            crc_encoding_scheme,
            payload_size,
            retry_setup,
            mode,
            addr_width,
            tx_addr,
            auto_ack,
            open_read_pipes,
            rx1_addr,
        })
    }
pub fn debug_view ( & mut self , ) -> Result < crate :: config :: DebugInfo , TransferError < SPIErr , PinErr > > { let channel = self . channel ( ) ? ; let data_rate = self . data_rate ( ) ? ; let pa_level = self . power_amp_level ( ) ? ; // doesn't read actual payload TODO: fix let payload_size = self . payload_size ( ) ; let crc_encoding_scheme = self . crc_encoding_scheme ( ) ? ; let retry_setup = self . retries ( ) ? ; let config_reg = self . read_register ( Register :: CONFIG ) ? ; let mode = if config_reg & 1 == 0 { Mode :: TransmissionMode } else { Mode :: ReceiverMode } ; let addr_width = AddressWidth :: from_register ( self . read_register ( Register :: SETUP_AW ) ? ) ; let tx_addr = self . read_tx ( ) ? ; let rx1_addr = self . read_rx ( ) ? ; let auto_ack = self . read_register ( Register :: EN_AA ) ? ; let open_read_pipes = self . read_register ( Register :: EN_RXADDR ) ? ; Ok ( crate :: config :: DebugInfo { channel , data_rate , pa_level , crc_encoding_scheme , payload_size , retry_setup , mode , addr_width , tx_addr , auto_ack , open_read_pipes , rx1_addr , } ) }
Returns a debug struct for printing information regarding current setup
Returns a debug struct for printing information regarding current setup
&mut self
&mut self
example
None