pub struct Dhcsr(pub u32);
Expand description
Debug Halting Control and Status Register, DHCSR (see armv6-M Architecture Reference Manual C1.6.3)
To write this register successfully, you need to set the debug key via Dhcsr::enable_write
first!
Tuple Fields§
§0: u32
Implementations§
Source§impl Dhcsr
impl Dhcsr
Sourcepub fn s_reset_st(&self) -> bool
pub fn s_reset_st(&self) -> bool
Indicates whether the processor has been reset since the last read of DHCSR:
0
: No reset since last DHCSR read.
1
: At least one reset since last DHCSR read.
This is a sticky bit, that clears to 0
on a read of DHCSR.
Sourcepub fn s_retire_st(&self) -> bool
pub fn s_retire_st(&self) -> bool
When not in Debug state, indicates whether the processor has completed the execution of an instruction since the last read of DHCSR:
0
: No instruction has completed since last DHCSR read.
1
: At least one instructions has completed since last DHCSR read.
This is a sticky bit, that clears to 0
on a read of DHCSR.
This bit is UNKNOWN:
- after a Local reset, but is set to
1
as soon as the processor completes execution of an instruction. - when S_LOCKUP is set to 1.
- when S_HALT is set to 1.
When the processor is not in Debug state, a debugger can check this bit to determine if the processor is stalled on a load, store or fetch access.
Sourcepub fn s_lockup(&self) -> bool
pub fn s_lockup(&self) -> bool
Indicates whether the processor is locked up because of an unrecoverable exception:
0
: Not locked up.
1
: Locked up.
See Unrecoverable exception cases on page B1-206 for more information.
This bit can only read as 1
when accessed by a remote debugger using the
DAP. The value of 1
indicates that the processor is running but locked up.
The bit clears to 0
when the processor enters Debug state.
Sourcepub fn s_sleep(&self) -> bool
pub fn s_sleep(&self) -> bool
Indicates whether the processor is sleeping:
0
: Not sleeping.
1
: Sleeping.
The debugger must set the DHCSR.C_HALT bit to 1
to gain control, or
wait for an interrupt or other wakeup event to wakeup the system
Sourcepub fn s_halt(&self) -> bool
pub fn s_halt(&self) -> bool
Indicates whether the processor is in Debug state:
0
: Not in Debug state.
1
: In Debug state.
Sourcepub fn s_regrdy(&self) -> bool
pub fn s_regrdy(&self) -> bool
A handshake flag for transfers through the DCRDR:
- Writing to DCRSR clears the bit to
0
. - Completion of the DCRDR transfer then sets the bit to
1
.
For more information about DCRDR transfers see Debug Core Register Data Register, DCRDR on page C1-292.
0
: There has been a write to the DCRDR, but the transfer is
not complete.
1
: The transfer to or from the DCRDR is complete.
This bit is only valid when the processor is in Debug state, otherwise the bit is UNKNOWN.
Sourcepub fn c_maskints(&self) -> bool
pub fn c_maskints(&self) -> bool
When debug is enabled, the debugger can write to this bit to mask PendSV, SysTick and external configurable interrupts:
0
: Do not mask.
1
: Mask PendSV, SysTick and external configurable interrupts.
The effect of any attempt to change the value of this bit is UNPREDICTABLE unless both:
- before the write to DHCSR, the value of the C_HALT bit is 1.
- the write to the DHCSR that changes the C_MASKINTS bit also
writes
1
to the C_HALT bit.
This means that a single write to DHCSR cannot set the C_HALT to 0
and
change the value of the C_MASKINTS bit.
The bit does not affect NMI. When DHCSR.C_DEBUGEN is set to 0
, the
value of this bit is UNKNOWN.
For more information about the use of this bit see Table C1-9 on page C1-282.
This bit is UNKNOWN after a power-on reset.
Sourcepub fn c_step(&self) -> bool
pub fn c_step(&self) -> bool
Processor step bit. The effects of writes to this bit are:
0
: Single-stepping disabled.
1
: Single-stepping enabled.
For more information about the use of this bit see Table C1-9 on page C1-282.
This bit is UNKNOWN after a power-on reset.
Sourcepub fn c_halt(&self) -> bool
pub fn c_halt(&self) -> bool
Processor halt bit. The effects of writes to this bit are:
0
: Request a halted processor to run.
1
: Request a running processor to halt.
Table C1-9 on page C1-282 shows the effect of writes to this bit when the processor is in Debug state.
This bit is 0
after a System reset.
Sourcepub fn c_debugen(&self) -> bool
pub fn c_debugen(&self) -> bool
Halting debug enable bit:
0
: Halting debug disabled.
1
: Halting debug enabled.
If a debugger writes to DHCSR to change the value of this bit from 0
to
1, it must also write 0
to the C_MASKINTS bit, otherwise behavior is UNPREDICTABLE.
This bit can only be written from the DAP. Access to the DHCSR from software running on the processor is IMPLEMENTATION DEFINED. However, writes to this bit from software running on the processor are ignored.
This bit is 0
after a power-on reset.
Sourcepub fn set_c_maskints(&mut self, value: bool)
pub fn set_c_maskints(&mut self, value: bool)
When debug is enabled, the debugger can write to this bit to mask PendSV, SysTick and external configurable interrupts:
0
: Do not mask.
1
: Mask PendSV, SysTick and external configurable interrupts.
The effect of any attempt to change the value of this bit is UNPREDICTABLE unless both:
- before the write to DHCSR, the value of the C_HALT bit is 1.
- the write to the DHCSR that changes the C_MASKINTS bit also
writes
1
to the C_HALT bit.
This means that a single write to DHCSR cannot set the C_HALT to 0
and
change the value of the C_MASKINTS bit.
The bit does not affect NMI. When DHCSR.C_DEBUGEN is set to 0
, the
value of this bit is UNKNOWN.
For more information about the use of this bit see Table C1-9 on page C1-282.
This bit is UNKNOWN after a power-on reset.
Sourcepub fn set_c_step(&mut self, value: bool)
pub fn set_c_step(&mut self, value: bool)
Processor step bit. The effects of writes to this bit are:
0
: Single-stepping disabled.
1
: Single-stepping enabled.
For more information about the use of this bit see Table C1-9 on page C1-282.
This bit is UNKNOWN after a power-on reset.
Sourcepub fn set_c_halt(&mut self, value: bool)
pub fn set_c_halt(&mut self, value: bool)
Processor halt bit. The effects of writes to this bit are:
0
: Request a halted processor to run.
1
: Request a running processor to halt.
Table C1-9 on page C1-282 shows the effect of writes to this bit when the processor is in Debug state.
This bit is 0
after a System reset.
Sourcepub fn set_c_debugen(&mut self, value: bool)
pub fn set_c_debugen(&mut self, value: bool)
Halting debug enable bit:
0
: Halting debug disabled.
1
: Halting debug enabled.
If a debugger writes to DHCSR to change the value of this bit from 0
to
1, it must also write 0
to the C_MASKINTS bit, otherwise behavior is UNPREDICTABLE.
This bit can only be written from the DAP. Access to the DHCSR from software running on the processor is IMPLEMENTATION DEFINED. However, writes to this bit from software running on the processor are ignored.
This bit is 0
after a power-on reset.
Source§impl Dhcsr
impl Dhcsr
Sourcepub fn enable_write(&mut self)
pub fn enable_write(&mut self)
This function sets the bit to enable writes to this register.
Trait Implementations§
Source§impl<T> BitRangeMut<T> for Dhcsrwhere
u32: BitRangeMut<T>,
impl<T> BitRangeMut<T> for Dhcsrwhere
u32: BitRangeMut<T>,
Source§fn set_bit_range(&mut self, msb: usize, lsb: usize, value: T)
fn set_bit_range(&mut self, msb: usize, lsb: usize, value: T)
Source§impl MemoryMappedRegister<u32> for Dhcsr
impl MemoryMappedRegister<u32> for Dhcsr
Source§const ADDRESS_OFFSET: u64 = 3_758_157_296u64
const ADDRESS_OFFSET: u64 = 3_758_157_296u64
Source§fn get_mmio_address_from_base(
base_address: u64,
) -> Result<u64, RegisterAddressOutOfBounds>
fn get_mmio_address_from_base( base_address: u64, ) -> Result<u64, RegisterAddressOutOfBounds>
MemoryMappedRegister::get_mmio_address
.Source§fn get_mmio_address() -> u64
fn get_mmio_address() -> u64
MemoryMappedRegister::ADDRESS_OFFSET
.
For other architectures (e.g. ARM Cortex-A) where this address is offset from a base address, please use MemoryMappedRegister::get_mmio_address_from_base
.impl Copy for Dhcsr
Auto Trait Implementations§
impl Freeze for Dhcsr
impl RefUnwindSafe for Dhcsr
impl Send for Dhcsr
impl Sync for Dhcsr
impl Unpin for Dhcsr
impl UnwindSafe for Dhcsr
Blanket Implementations§
Source§impl<T> BitMut for Twhere
T: BitRangeMut<u8>,
impl<T> BitMut for Twhere
T: BitRangeMut<u8>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.