Struct Backdoor

Source
pub struct Backdoor { /* private fields */ }
Expand description

A struct which represents an active backdoor loader connection.

Implementations§

Source§

impl Backdoor

Source

pub fn new( dmi: OpenOcdDmi, jtag_speed_khz: u64, enumerate: bool, ) -> Result<Self>

Construct a Backdoor from a DMI connection to the backdoor TAP. Optionally enumerate and discover information about all available targets.

Source

pub fn enumerate(&mut self) -> Result<()>

Source

pub fn set_done(self) -> Result<()>

Communicate with the backdoor loader that we are finished using it.

This transitions the bkdr_loader from it from its “Preload” state to “Mission mode”, causing it to re-route incoming JTAG back to the regular downstream interface.

Source

pub fn targets(&self) -> &[BackdoorTargetInfo]

Retrieve information about all of the targets available via the backdoor interface.

Source

pub fn target_by_id(&mut self, id: u32) -> Option<BackdoorTarget<'_>>

Borrow a target by its integer identifier. Only one BackdoorTarget can exist at a time.

Source

pub fn target_by_id_str( &mut self, id: &str, ) -> Result<Option<BackdoorTarget<'_>>>

Borrow a target by its string identifier. Only one BackdoorTarget can exist at a time.

Source

pub fn write_target( &mut self, target_index: u8, start: u32, words: &[Word], write_all: bool, check_status: bool, ) -> Result<()>

Write a sequence of words at a given offset (word index) to a specified target’s memory.

The write_all parameter is used to control whether writes can be optimized by maintaining shadow CSRs to determine when register contents have actually changed. The check_status parameter is used to control whether the status bit is polled after all words are written, to check for any errors.

Source

pub fn read_target( &mut self, target_index: u8, start: u32, count: u32, check_status: bool, ) -> Result<Vec<Word>>

Read a sequence of words at a given offset (word index) from a specified target’s memory.

The check_status parameter is used to control whether the status bit is polled after each word read, to check for any errors.

Source

pub fn clear_target( &mut self, target_index: u8, word: &Word, check_status: bool, ) -> Result<()>

Clear the entire memory of a specified target with a given word.

An optimized fast-path for clearing memories, primarily used to replicate existing bitstream synthesis defaults. The check_status parameter is used to control whether the status bit is polled after clearing, to check for any errors.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V