Trait probe_rs::architecture::arm::RawDapAccess
source · pub trait RawDapAccess {
fn select_dp(&mut self, dp: DpAddress) -> Result<(), ArmError>;
fn raw_read_register(
&mut self,
port: PortType,
addr: u8
) -> Result<u32, ArmError>;
fn raw_write_register(
&mut self,
port: PortType,
addr: u8,
value: u32
) -> Result<(), ArmError>;
fn swj_sequence(
&mut self,
bit_len: u8,
bits: u64
) -> Result<(), DebugProbeError>;
fn swj_pins(
&mut self,
pin_out: u32,
pin_select: u32,
pin_wait: u32
) -> Result<u32, DebugProbeError>;
fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>;
fn raw_read_block(
&mut self,
port: PortType,
addr: u8,
values: &mut [u32]
) -> Result<(), ArmError> { ... }
fn raw_write_block(
&mut self,
port: PortType,
addr: u8,
values: &[u32]
) -> Result<(), ArmError> { ... }
fn raw_flush(&mut self) -> Result<(), ArmError> { ... }
}
Expand description
Low-level DAP register access.
Operations on this trait closely match the transactions on the wire. Implementors only do basic error handling, such as retrying WAIT errors.
Almost everything is the responsibility of the caller. For example, the caller must handle bank switching and AP selection.
Required Methods§
sourcefn select_dp(&mut self, dp: DpAddress) -> Result<(), ArmError>
fn select_dp(&mut self, dp: DpAddress) -> Result<(), ArmError>
Select the debug port to operate on.
If the probe is connected to a system with multiple debug ports, this will process all queued commands which haven’t been executed yet.
This means that returned errors can also come from these commands, not only from changing debug port.
sourcefn raw_read_register(&mut self, port: PortType, addr: u8) -> Result<u32, ArmError>
fn raw_read_register(&mut self, port: PortType, addr: u8) -> Result<u32, ArmError>
Read a DAP register.
Only the lowest 4 bits of addr
are used. Bank switching is the caller’s responsibility.
sourcefn raw_write_register(
&mut self,
port: PortType,
addr: u8,
value: u32
) -> Result<(), ArmError>
fn raw_write_register(
&mut self,
port: PortType,
addr: u8,
value: u32
) -> Result<(), ArmError>
Write a value to a DAP register.
Only the lowest 4 bits of addr
are used. Bank switching is the caller’s responsibility.
sourcefn swj_sequence(&mut self, bit_len: u8, bits: u64) -> Result<(), DebugProbeError>
fn swj_sequence(&mut self, bit_len: u8, bits: u64) -> Result<(), DebugProbeError>
Send a specific output sequence over JTAG or SWD.
This can only be used for output, and should be used to generate the initial reset sequence, for example.
sourcefn swj_pins(
&mut self,
pin_out: u32,
pin_select: u32,
pin_wait: u32
) -> Result<u32, DebugProbeError>
fn swj_pins(
&mut self,
pin_out: u32,
pin_select: u32,
pin_wait: u32
) -> Result<u32, DebugProbeError>
Set the state of debugger output pins directly.
The bits have the following meaning:
Bit 0: SWCLK/TCK Bit 1: SWDIO/TMS Bit 2: TDI Bit 3: TDO Bit 5: nTRST Bit 7: nRESET
sourcefn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
Cast this interface into a generic DebugProbe
.
Provided Methods§
sourcefn raw_read_block(
&mut self,
port: PortType,
addr: u8,
values: &mut [u32]
) -> Result<(), ArmError>
fn raw_read_block(
&mut self,
port: PortType,
addr: u8,
values: &mut [u32]
) -> Result<(), ArmError>
Read multiple values from the same DAP register.
If possible, this uses optimized read functions, otherwise it
falls back to the read_register
function.
Only the lowest 4 bits of addr
are used. Bank switching is the caller’s responsibility.
sourcefn raw_write_block(
&mut self,
port: PortType,
addr: u8,
values: &[u32]
) -> Result<(), ArmError>
fn raw_write_block(
&mut self,
port: PortType,
addr: u8,
values: &[u32]
) -> Result<(), ArmError>
Write multiple values to the same DAP register.
If possible, this uses optimized write functions, otherwise it
falls back to the write_register
function.
Only the lowest 4 bits of addr
are used. Bank switching is the caller’s responsibility.