atsame70q20/icm/
icm_uasr.rs1#[doc = "Register `ICM_UASR` reader"]
2pub struct R(crate::R<ICM_UASR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ICM_UASR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ICM_UASR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ICM_UASR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Undefined Register Access Trace\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u8)]
19pub enum URAT_A {
20 #[doc = "0: Unspecified structure member set to one detected when the descriptor is loaded."]
21 UNSPEC_STRUCT_MEMBER = 0,
22 #[doc = "1: ICM_CFG modified during active monitoring."]
23 ICM_CFG_MODIFIED = 1,
24 #[doc = "2: ICM_DSCR modified during active monitoring."]
25 ICM_DSCR_MODIFIED = 2,
26 #[doc = "3: ICM_HASH modified during active monitoring"]
27 ICM_HASH_MODIFIED = 3,
28 #[doc = "4: Write-only register read access"]
29 READ_ACCESS = 4,
30}
31impl From<URAT_A> for u8 {
32 #[inline(always)]
33 fn from(variant: URAT_A) -> Self {
34 variant as _
35 }
36}
37#[doc = "Field `URAT` reader - Undefined Register Access Trace"]
38pub struct URAT_R(crate::FieldReader<u8, URAT_A>);
39impl URAT_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u8) -> Self {
42 URAT_R(crate::FieldReader::new(bits))
43 }
44 #[doc = r"Get enumerated values variant"]
45 #[inline(always)]
46 pub fn variant(&self) -> Option<URAT_A> {
47 match self.bits {
48 0 => Some(URAT_A::UNSPEC_STRUCT_MEMBER),
49 1 => Some(URAT_A::ICM_CFG_MODIFIED),
50 2 => Some(URAT_A::ICM_DSCR_MODIFIED),
51 3 => Some(URAT_A::ICM_HASH_MODIFIED),
52 4 => Some(URAT_A::READ_ACCESS),
53 _ => None,
54 }
55 }
56 #[doc = "Checks if the value of the field is `UNSPEC_STRUCT_MEMBER`"]
57 #[inline(always)]
58 pub fn is_unspec_struct_member(&self) -> bool {
59 **self == URAT_A::UNSPEC_STRUCT_MEMBER
60 }
61 #[doc = "Checks if the value of the field is `ICM_CFG_MODIFIED`"]
62 #[inline(always)]
63 pub fn is_icm_cfg_modified(&self) -> bool {
64 **self == URAT_A::ICM_CFG_MODIFIED
65 }
66 #[doc = "Checks if the value of the field is `ICM_DSCR_MODIFIED`"]
67 #[inline(always)]
68 pub fn is_icm_dscr_modified(&self) -> bool {
69 **self == URAT_A::ICM_DSCR_MODIFIED
70 }
71 #[doc = "Checks if the value of the field is `ICM_HASH_MODIFIED`"]
72 #[inline(always)]
73 pub fn is_icm_hash_modified(&self) -> bool {
74 **self == URAT_A::ICM_HASH_MODIFIED
75 }
76 #[doc = "Checks if the value of the field is `READ_ACCESS`"]
77 #[inline(always)]
78 pub fn is_read_access(&self) -> bool {
79 **self == URAT_A::READ_ACCESS
80 }
81}
82impl core::ops::Deref for URAT_R {
83 type Target = crate::FieldReader<u8, URAT_A>;
84 #[inline(always)]
85 fn deref(&self) -> &Self::Target {
86 &self.0
87 }
88}
89impl R {
90 #[doc = "Bits 0:2 - Undefined Register Access Trace"]
91 #[inline(always)]
92 pub fn urat(&self) -> URAT_R {
93 URAT_R::new((self.bits & 0x07) as u8)
94 }
95}
96#[doc = "Undefined Access 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 [icm_uasr](index.html) module"]
97pub struct ICM_UASR_SPEC;
98impl crate::RegisterSpec for ICM_UASR_SPEC {
99 type Ux = u32;
100}
101#[doc = "`read()` method returns [icm_uasr::R](R) reader structure"]
102impl crate::Readable for ICM_UASR_SPEC {
103 type Reader = R;
104}
105#[doc = "`reset()` method sets ICM_UASR to value 0"]
106impl crate::Resettable for ICM_UASR_SPEC {
107 #[inline(always)]
108 fn reset_value() -> Self::Ux {
109 0
110 }
111}