probe_rs::architecture::riscv::communication_interface

Trait RiscvInterfaceBuilder

Source
pub trait RiscvInterfaceBuilder<'probe> {
    // Required methods
    fn create_state(&self) -> RiscvDebugInterfaceState;
    fn attach<'state>(
        self: Box<Self>,
        state: &'state mut RiscvDebugInterfaceState,
    ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
       where 'probe: 'state;

    // Provided methods
    fn attach_tunneled<'state>(
        self: Box<Self>,
        _tunnel_ir_id: u32,
        _tunnel_ir_width: u32,
        _state: &'state mut RiscvDebugInterfaceState,
    ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
       where 'probe: 'state { ... }
    fn attach_auto<'state>(
        self: Box<Self>,
        target: &Target,
        state: &'state mut RiscvDebugInterfaceState,
    ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
       where 'probe: 'state { ... }
}
Expand description

A single-use factory for creating RISC-V communication interfaces and their states.

Required Methods§

Source

fn create_state(&self) -> RiscvDebugInterfaceState

Creates a new RISC-V communication interface state object.

The state object needs to be stored separately from the communication interface and can be used to restore the state of the interface at a later time.

Source

fn attach<'state>( self: Box<Self>, state: &'state mut RiscvDebugInterfaceState, ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
where 'probe: 'state,

Consumes the factory and creates a communication interface object initialised with the given state.

Provided Methods§

Source

fn attach_tunneled<'state>( self: Box<Self>, _tunnel_ir_id: u32, _tunnel_ir_width: u32, _state: &'state mut RiscvDebugInterfaceState, ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
where 'probe: 'state,

Consumes the factory and creates a communication interface object using a JTAG tunnel initialised with the given state.

Source

fn attach_auto<'state>( self: Box<Self>, target: &Target, state: &'state mut RiscvDebugInterfaceState, ) -> Result<RiscvCommunicationInterface<'state>, DebugProbeError>
where 'probe: 'state,

Consumes the factory and creates a communication interface object initialised with the given state.

Automatically determines whether to use JTAG tunneling or not from the target.

Implementors§