use crate::semihosting::SemihostingCommand;
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum CoreStatus {
Running,
Halted(HaltReason),
LockedUp,
Sleeping,
Unknown,
}
impl CoreStatus {
pub fn is_halted(&self) -> bool {
matches!(self, CoreStatus::Halted(_))
}
pub fn is_running(&self) -> bool {
self == &Self::Running
}
}
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum BreakpointCause {
Hardware,
Software,
Unknown,
Semihosting(SemihostingCommand),
}
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum HaltReason {
Multiple,
Breakpoint(BreakpointCause),
Exception,
Watchpoint,
Step,
Request,
External,
Unknown,
}
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum VectorCatchCondition {
HardFault,
CoreReset,
SecureFault,
All,
}