Struct Debug

Source
pub struct Debug<'a> { /* private fields */ }
Expand description

Debug operations for the HackRF, including programming operations.

Borrows the interface while doing operations.

The way to get to this struct is by calling HackRf::debug with an open peripheral, like so:



use waverave_hackrf::debug::*;

let mut hackrf = waverave_hackrf::open_hackrf()?;
// Mutably borrow - make sure no other operations are in progress.
let mut debug = hackrf.debug();

// Just grab the internal state of the M0 processor and dump it
let state = debug.get_m0_state().await?;
dbg!(&state);

Implementations§

Source§

impl<'a> Debug<'a>

Source

pub async fn get_m0_state(&self) -> Result<M0State, Error>

Get the internal state of the M0 code of the LPC43xx MCU.

Requires API version 0x0106 or higher.

Source

pub fn spi_flash(&self) -> SpiFlash<'_>

Access the attached SPI flash.

See SpiFlash for what to do with it.

Source

pub async fn cpld_write<F>( &mut self, data: &[u8], callback: Option<F>, ) -> Result<(), Error>
where F: FnMut(usize, usize),

Update the XC2C64A-7VQ100C CPLD with a new bitstream.

After every transfer completes, an optional callback will be invoked with the number of bytes transferred as the first argument, and the total number of bytes to be transferred as the second argument.

Source

pub async fn cpld_checksum(&self) -> Result<u32, Error>

Get the checksum of the CPLD bitstream.

Requires API version 0x0103 or higher.

Source

pub async fn si5351c_read(&self, register: u8) -> Result<u8, Error>

Read a register from the SI5351C.

Source

pub async fn si5351c_write(&self, register: u8, value: u8) -> Result<(), Error>

Write a register to the SI5351C.

Source

pub async fn rffc5071_read(&self, register: u8) -> Result<u16, Error>

Read a register from the RFFC5071.

Source

pub async fn rffc5071_write( &self, register: u8, value: u16, ) -> Result<(), Error>

Write a register to the RFFC5071.

Source

pub async fn max2837_read(&self, register: u8) -> Result<u16, Error>

Read a register from the MAX2837.

Source

pub async fn max2837_write(&self, register: u8, value: u16) -> Result<(), Error>

Write a register to the MAX2837.

Auto Trait Implementations§

§

impl<'a> Freeze for Debug<'a>

§

impl<'a> !RefUnwindSafe for Debug<'a>

§

impl<'a> Send for Debug<'a>

§

impl<'a> !Sync for Debug<'a>

§

impl<'a> Unpin for Debug<'a>

§

impl<'a> !UnwindSafe for Debug<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.