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>
impl<'a> Debug<'a>
Sourcepub async fn get_m0_state(&self) -> Result<M0State, Error>
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.
Sourcepub fn spi_flash(&self) -> SpiFlash<'_>
pub fn spi_flash(&self) -> SpiFlash<'_>
Access the attached SPI flash.
See SpiFlash for what to do with it.
Sourcepub async fn cpld_write<F>(
&mut self,
data: &[u8],
callback: Option<F>,
) -> Result<(), Error>
pub async fn cpld_write<F>( &mut self, data: &[u8], callback: Option<F>, ) -> Result<(), Error>
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.
Sourcepub async fn cpld_checksum(&self) -> Result<u32, Error>
pub async fn cpld_checksum(&self) -> Result<u32, Error>
Get the checksum of the CPLD bitstream.
Requires API version 0x0103 or higher.
Sourcepub async fn si5351c_read(&self, register: u8) -> Result<u8, Error>
pub async fn si5351c_read(&self, register: u8) -> Result<u8, Error>
Read a register from the SI5351C.
Sourcepub async fn si5351c_write(&self, register: u8, value: u8) -> Result<(), Error>
pub async fn si5351c_write(&self, register: u8, value: u8) -> Result<(), Error>
Write a register to the SI5351C.
Sourcepub async fn rffc5071_read(&self, register: u8) -> Result<u16, Error>
pub async fn rffc5071_read(&self, register: u8) -> Result<u16, Error>
Read a register from the RFFC5071.
Sourcepub async fn rffc5071_write(
&self,
register: u8,
value: u16,
) -> Result<(), Error>
pub async fn rffc5071_write( &self, register: u8, value: u16, ) -> Result<(), Error>
Write a register to the RFFC5071.