#[doc = "Reader of register SRS1"]
pub type R = crate::R<u8, super::SRS1>;
#[doc = "Core Lockup\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LOCKUP_A {
#[doc = "0: Reset not caused by core LOCKUP event"]
_0 = 0,
#[doc = "1: Reset caused by core LOCKUP event"]
_1 = 1,
}
impl From<LOCKUP_A> for bool {
#[inline(always)]
fn from(variant: LOCKUP_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `LOCKUP`"]
pub type LOCKUP_R = crate::R<bool, LOCKUP_A>;
impl LOCKUP_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LOCKUP_A {
match self.bits {
false => LOCKUP_A::_0,
true => LOCKUP_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == LOCKUP_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == LOCKUP_A::_1
}
}
#[doc = "Software\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SW_A {
#[doc = "0: Reset not caused by software setting of SYSRESETREQ bit"]
_0 = 0,
#[doc = "1: Reset caused by software setting of SYSRESETREQ bit"]
_1 = 1,
}
impl From<SW_A> for bool {
#[inline(always)]
fn from(variant: SW_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `SW`"]
pub type SW_R = crate::R<bool, SW_A>;
impl SW_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SW_A {
match self.bits {
false => SW_A::_0,
true => SW_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == SW_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == SW_A::_1
}
}
#[doc = "MDM-AP System Reset Request\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MDM_AP_A {
#[doc = "0: Reset not caused by host debugger system setting of the System Reset Request bit"]
_0 = 0,
#[doc = "1: Reset caused by host debugger system setting of the System Reset Request bit"]
_1 = 1,
}
impl From<MDM_AP_A> for bool {
#[inline(always)]
fn from(variant: MDM_AP_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `MDM_AP`"]
pub type MDM_AP_R = crate::R<bool, MDM_AP_A>;
impl MDM_AP_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> MDM_AP_A {
match self.bits {
false => MDM_AP_A::_0,
true => MDM_AP_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == MDM_AP_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == MDM_AP_A::_1
}
}
#[doc = "Stop Mode Acknowledge Error Reset\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SACKERR_A {
#[doc = "0: Reset not caused by peripheral failure to acknowledge attempt to enter stop mode"]
_0 = 0,
#[doc = "1: Reset caused by peripheral failure to acknowledge attempt to enter stop mode"]
_1 = 1,
}
impl From<SACKERR_A> for bool {
#[inline(always)]
fn from(variant: SACKERR_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `SACKERR`"]
pub type SACKERR_R = crate::R<bool, SACKERR_A>;
impl SACKERR_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SACKERR_A {
match self.bits {
false => SACKERR_A::_0,
true => SACKERR_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == SACKERR_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == SACKERR_A::_1
}
}
impl R {
#[doc = "Bit 1 - Core Lockup"]
#[inline(always)]
pub fn lockup(&self) -> LOCKUP_R {
LOCKUP_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Software"]
#[inline(always)]
pub fn sw(&self) -> SW_R {
SW_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - MDM-AP System Reset Request"]
#[inline(always)]
pub fn mdm_ap(&self) -> MDM_AP_R {
MDM_AP_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 5 - Stop Mode Acknowledge Error Reset"]
#[inline(always)]
pub fn sackerr(&self) -> SACKERR_R {
SACKERR_R::new(((self.bits >> 5) & 0x01) != 0)
}
}