pub struct JTAG { /* private fields */ }
Implementations
sourceimpl JTAG
impl JTAG
sourcepub fn new(dap: DAP) -> JTAG
pub fn new(dap: DAP) -> JTAG
Create a new JTAG object which takes ownership of the provided DAP.
The initial state is TAPState::Unknown; the only way to enter a
known state is by calling enter_test_logic_reset()
to reset.
sourcepub fn set_max_length(&mut self, max_length: usize)
pub fn set_max_length(&mut self, max_length: usize)
Set the maximum scan chain length to attempt to detect.
sourcepub fn pulse_nrst(&self, duration: Duration) -> Result<()>
pub fn pulse_nrst(&self, duration: Duration) -> Result<()>
Pulse nRST low for duration
.
sourcepub fn scan(&mut self, ir_lengths: Option<&[usize]>) -> Result<JTAGChain>
pub fn scan(&mut self, ir_lengths: Option<&[usize]>) -> Result<JTAGChain>
Scan JTAG chain, detecting TAPs and their IDCODEs and IR lengths.
If IR lengths for each TAP are known, provide them in ir_lengths
.
Returns a new JTAGChain, which contains detected IDCODEs and can be used to create a JTAGTAP at a specific index.
sourcepub fn into_tap(self, chain: JTAGChain, index: usize) -> Result<JTAGTAP>
pub fn into_tap(self, chain: JTAGChain, index: usize) -> Result<JTAGTAP>
Create a new JTAG TAP, allowing read/write access to a single TAP on the chain.
sourcepub fn enter_test_logic_reset(&mut self) -> Result<()>
pub fn enter_test_logic_reset(&mut self) -> Result<()>
Force all TAPs into Test-Logic-Reset state from any current state.
sourcepub fn enter_run_test_idle(&mut self) -> Result<()>
pub fn enter_run_test_idle(&mut self) -> Result<()>
Enter Run-Test/Idle state from TestLogicReset, Exit1*, Pause*, or Update*.
sourcepub fn run_test_idle(&mut self, n: usize) -> Result<()>
pub fn run_test_idle(&mut self, n: usize) -> Result<()>
Enter Run-Test/Idle and remain there for n
clock cycles.
sourcepub fn enter_shift_dr(&mut self) -> Result<()>
pub fn enter_shift_dr(&mut self) -> Result<()>
Enter Shift-DR state from Test-Logic-Reset, Run-Test/Idle, Update*, or Pause*.
sourcepub fn enter_pause_dr(&mut self) -> Result<()>
pub fn enter_pause_dr(&mut self) -> Result<()>
Enter Pause-DR from Exit1-DR.
sourcepub fn enter_update_dr(&mut self) -> Result<()>
pub fn enter_update_dr(&mut self) -> Result<()>
Enter Update-DR from Shift-DR or Exit1-DR.
sourcepub fn enter_shift_ir(&mut self) -> Result<()>
pub fn enter_shift_ir(&mut self) -> Result<()>
Enter Shift-IR state from Test-Logic-Reset, Run-Test/Idle, Update*, or Pause*.
sourcepub fn enter_pause_ir(&mut self) -> Result<()>
pub fn enter_pause_ir(&mut self) -> Result<()>
Enter Pause-IR from Exit1-IR.
sourcepub fn enter_update_ir(&mut self) -> Result<()>
pub fn enter_update_ir(&mut self) -> Result<()>
Enter Update-IR from Shift-IR or Exit1-IR.
sourcepub fn write_ir(&mut self, tdi: &[bool]) -> Result<()>
pub fn write_ir(&mut self, tdi: &[bool]) -> Result<()>
Move to Shift-IR, write tdi
to IR, then enter Update-IR.
sourcepub fn read_ir(&mut self, n: usize) -> Result<Vec<bool>>
pub fn read_ir(&mut self, n: usize) -> Result<Vec<bool>>
Move to Shift-IR, read n
bits of IR while writing 0xFF, then enter Update-IR.
Returns the captured bits from TDO.
sourcepub fn exchange_ir(&mut self, tdi: &[bool]) -> Result<Vec<bool>>
pub fn exchange_ir(&mut self, tdi: &[bool]) -> Result<Vec<bool>>
Move to Shift-IR, write tdi
to IR while capturing TDO, then enter Update-IR.
Returns the captured bits from TDO.
sourcepub fn write_dr(&mut self, tdi: &[bool]) -> Result<()>
pub fn write_dr(&mut self, tdi: &[bool]) -> Result<()>
Move to Shift-DR, write tdi
to DR, then enter Exit1-DR.
sourcepub fn write_dr_cb<F: Fn(usize)>(&mut self, tdi: &[bool], cb: F) -> Result<()>
pub fn write_dr_cb<F: Fn(usize)>(&mut self, tdi: &[bool], cb: F) -> Result<()>
Move to Shift-DR, write tdi
to DR, then enter Exit1-DR.
Additionally, call cb
at regular intervals with the number of
bits written so far.
Auto Trait Implementations
impl RefUnwindSafe for JTAG
impl Send for JTAG
impl !Sync for JTAG
impl Unpin for JTAG
impl UnwindSafe for JTAG
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more