pub trait DapAccess {
// Required methods
fn read_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
) -> Result<u32, ArmError>;
fn write_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
value: u32,
) -> Result<(), ArmError>;
fn read_raw_ap_register(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
) -> Result<u32, ArmError>;
fn write_raw_ap_register(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
value: u32,
) -> Result<(), ArmError>;
// Provided methods
fn read_raw_ap_register_repeated(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
values: &mut [u32],
) -> Result<(), ArmError> { ... }
fn write_raw_ap_register_repeated(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
values: &[u32],
) -> Result<(), ArmError> { ... }
}
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§
Sourcefn read_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
) -> Result<u32, ArmError>
fn read_raw_dp_register( &mut self, dp: DpAddress, addr: u8, ) -> Result<u32, ArmError>
Read a Debug Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
If the device uses multiple debug ports, this will switch the active debug port if necessary. In case this happens, all queued operations will be performed, and returned errors can be from these operations as well.
Sourcefn write_raw_dp_register(
&mut self,
dp: DpAddress,
addr: u8,
value: u32,
) -> Result<(), ArmError>
fn write_raw_dp_register( &mut self, dp: DpAddress, addr: u8, value: u32, ) -> Result<(), ArmError>
Write a Debug Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
If the device uses multiple debug ports, this will switch the active debug port if necessary. In case this happens, all queued operations will be performed, and returned errors can be from these operations as well.
Sourcefn read_raw_ap_register(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
) -> Result<u32, ArmError>
fn read_raw_ap_register( &mut self, ap: &FullyQualifiedApAddress, addr: u8, ) -> Result<u32, ArmError>
Read an Access Port register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
Sourcefn write_raw_ap_register(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
value: u32,
) -> Result<(), ArmError>
fn write_raw_ap_register( &mut self, ap: &FullyQualifiedApAddress, addr: u8, value: u32, ) -> Result<(), ArmError>
Write an AP register.
Highest 4 bits of addr
are interpreted as the bank number, implementations
will do bank switching if necessary.
Provided Methods§
Sourcefn read_raw_ap_register_repeated(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
values: &mut [u32],
) -> Result<(), ArmError>
fn read_raw_ap_register_repeated( &mut self, ap: &FullyQualifiedApAddress, addr: u8, values: &mut [u32], ) -> Result<(), ArmError>
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.
Sourcefn write_raw_ap_register_repeated(
&mut self,
ap: &FullyQualifiedApAddress,
addr: u8,
values: &[u32],
) -> Result<(), ArmError>
fn write_raw_ap_register_repeated( &mut self, ap: &FullyQualifiedApAddress, addr: u8, values: &[u32], ) -> Result<(), ArmError>
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.