pub trait DapAccess {
fn read_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8
) -> Result<u32, DebugProbeError>;
fn write_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>;
fn read_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8
) -> Result<u32, DebugProbeError>;
fn write_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>;
fn read_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &mut [u32]
) -> Result<(), DebugProbeError> { ... }
fn write_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &[u32]
) -> Result<(), DebugProbeError> { ... }
}
Expand description
High-level DAP register access.
Operations on this trait perform logical register reads/writes. Implementations are responsible for bank switching and AP selection, so one method call can result in multiple transactions on the wire, if necessary.
Required Methods
fn read_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8
) -> Result<u32, DebugProbeError>
fn read_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8
) -> Result<u32, DebugProbeError>
Read a Debug Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
fn write_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>
fn write_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>
Write a Debug Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
fn read_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8
) -> Result<u32, DebugProbeError>
fn read_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8
) -> Result<u32, DebugProbeError>
Read an Access Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
fn write_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>
fn write_raw_ap_register(
&mut self,
ap: ApAddress,
addr: u8,
value: u32
) -> Result<(), DebugProbeError>
Write an AP register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
Provided Methods
fn read_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &mut [u32]
) -> Result<(), DebugProbeError>
fn read_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &mut [u32]
) -> Result<(), DebugProbeError>
Read multiple values from the same Access Port register.
If possible, this uses optimized read functions, otherwise it
falls back to the read_raw_ap_register
function.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
fn write_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &[u32]
) -> Result<(), DebugProbeError>
fn write_raw_ap_register_repeated(
&mut self,
ap: ApAddress,
addr: u8,
values: &[u32]
) -> Result<(), DebugProbeError>
Write multiple values to the same Access Port register.
If possible, this uses optimized write functions, otherwise it
falls back to the write_raw_ap_register
function.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.