pub trait DapAccess {
    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: ApAddress,
        addr: u8
    ) -> Result<u32, ArmError>; fn write_raw_ap_register(
        &mut self,
        ap: ApAddress,
        addr: u8,
        value: u32
    ) -> Result<(), ArmError>; fn read_raw_ap_register_repeated(
        &mut self,
        ap: ApAddress,
        addr: u8,
        values: &mut [u32]
    ) -> Result<(), ArmError> { ... } fn write_raw_ap_register_repeated(
        &mut self,
        ap: ApAddress,
        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§

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.

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.

Read an Access Port register.

Highest 4 bits of addr are interpreted as the bank number, implementations will do bank switching if necessary.

Write an AP register.

Highest 4 bits of addr are interpreted as the bank number, implementations will do bank switching if necessary.

Provided Methods§

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.

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.

Implementors§