efm32gg_pac/efm32gg230/etm/
etmauthstatus.rs

1#[doc = "Register `ETMAUTHSTATUS` reader"]
2pub struct R(crate::R<ETMAUTHSTATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ETMAUTHSTATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ETMAUTHSTATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ETMAUTHSTATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `NONSECINVDBG` reader - Non-secure invasive Debug Status"]
17pub type NONSECINVDBG_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `NONSECNONINVDBG` reader - Non-secure non-invasive Debug Status"]
19pub type NONSECNONINVDBG_R = crate::FieldReader<u8, NONSECNONINVDBG_A>;
20#[doc = "Non-secure non-invasive Debug Status\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22#[repr(u8)]
23pub enum NONSECNONINVDBG_A {
24    #[doc = "2: Non-secure non-invasive debug disable"]
25    DISABLE = 2,
26    #[doc = "3: Non-secure non-invasive debug enable"]
27    ENABLE = 3,
28}
29impl From<NONSECNONINVDBG_A> for u8 {
30    #[inline(always)]
31    fn from(variant: NONSECNONINVDBG_A) -> Self {
32        variant as _
33    }
34}
35impl NONSECNONINVDBG_R {
36    #[doc = "Get enumerated values variant"]
37    #[inline(always)]
38    pub fn variant(&self) -> Option<NONSECNONINVDBG_A> {
39        match self.bits {
40            2 => Some(NONSECNONINVDBG_A::DISABLE),
41            3 => Some(NONSECNONINVDBG_A::ENABLE),
42            _ => None,
43        }
44    }
45    #[doc = "Checks if the value of the field is `DISABLE`"]
46    #[inline(always)]
47    pub fn is_disable(&self) -> bool {
48        *self == NONSECNONINVDBG_A::DISABLE
49    }
50    #[doc = "Checks if the value of the field is `ENABLE`"]
51    #[inline(always)]
52    pub fn is_enable(&self) -> bool {
53        *self == NONSECNONINVDBG_A::ENABLE
54    }
55}
56#[doc = "Field `SECINVDBG` reader - Secure invasive Debug Status"]
57pub type SECINVDBG_R = crate::FieldReader<u8, u8>;
58#[doc = "Field `SECNONINVDBG` reader - Secure non-invasive Debug Status"]
59pub type SECNONINVDBG_R = crate::FieldReader<u8, u8>;
60impl R {
61    #[doc = "Bits 0:1 - Non-secure invasive Debug Status"]
62    #[inline(always)]
63    pub fn nonsecinvdbg(&self) -> NONSECINVDBG_R {
64        NONSECINVDBG_R::new((self.bits & 3) as u8)
65    }
66    #[doc = "Bits 2:3 - Non-secure non-invasive Debug Status"]
67    #[inline(always)]
68    pub fn nonsecnoninvdbg(&self) -> NONSECNONINVDBG_R {
69        NONSECNONINVDBG_R::new(((self.bits >> 2) & 3) as u8)
70    }
71    #[doc = "Bits 4:5 - Secure invasive Debug Status"]
72    #[inline(always)]
73    pub fn secinvdbg(&self) -> SECINVDBG_R {
74        SECINVDBG_R::new(((self.bits >> 4) & 3) as u8)
75    }
76    #[doc = "Bits 6:7 - Secure non-invasive Debug Status"]
77    #[inline(always)]
78    pub fn secnoninvdbg(&self) -> SECNONINVDBG_R {
79        SECNONINVDBG_R::new(((self.bits >> 6) & 3) as u8)
80    }
81}
82#[doc = "ETM Authentication Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [etmauthstatus](index.html) module"]
83pub struct ETMAUTHSTATUS_SPEC;
84impl crate::RegisterSpec for ETMAUTHSTATUS_SPEC {
85    type Ux = u32;
86}
87#[doc = "`read()` method returns [etmauthstatus::R](R) reader structure"]
88impl crate::Readable for ETMAUTHSTATUS_SPEC {
89    type Reader = R;
90}
91#[doc = "`reset()` method sets ETMAUTHSTATUS to value 0xc0"]
92impl crate::Resettable for ETMAUTHSTATUS_SPEC {
93    const RESET_VALUE: Self::Ux = 0xc0;
94}