atsamv71j21/efc/
eefc_fsr.rs

1#[doc = "Register `EEFC_FSR` reader"]
2pub struct R(crate::R<EEFC_FSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<EEFC_FSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<EEFC_FSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<EEFC_FSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `FRDY` reader - Flash Ready Status (cleared when Flash is busy)"]
17pub struct FRDY_R(crate::FieldReader<bool, bool>);
18impl FRDY_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        FRDY_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for FRDY_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `FCMDE` reader - Flash Command Error Status (cleared on read or by writing EEFC_FCR)"]
32pub struct FCMDE_R(crate::FieldReader<bool, bool>);
33impl FCMDE_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        FCMDE_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for FCMDE_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `FLOCKE` reader - Flash Lock Error Status (cleared on read)"]
47pub struct FLOCKE_R(crate::FieldReader<bool, bool>);
48impl FLOCKE_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: bool) -> Self {
51        FLOCKE_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for FLOCKE_R {
55    type Target = crate::FieldReader<bool, bool>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `FLERR` reader - Flash Error Status (cleared when a programming operation starts)"]
62pub struct FLERR_R(crate::FieldReader<bool, bool>);
63impl FLERR_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        FLERR_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for FLERR_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76#[doc = "Field `UECCELSB` reader - Unique ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read)"]
77pub struct UECCELSB_R(crate::FieldReader<bool, bool>);
78impl UECCELSB_R {
79    #[inline(always)]
80    pub(crate) fn new(bits: bool) -> Self {
81        UECCELSB_R(crate::FieldReader::new(bits))
82    }
83}
84impl core::ops::Deref for UECCELSB_R {
85    type Target = crate::FieldReader<bool, bool>;
86    #[inline(always)]
87    fn deref(&self) -> &Self::Target {
88        &self.0
89    }
90}
91#[doc = "Field `MECCELSB` reader - Multiple ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read)"]
92pub struct MECCELSB_R(crate::FieldReader<bool, bool>);
93impl MECCELSB_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: bool) -> Self {
96        MECCELSB_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for MECCELSB_R {
100    type Target = crate::FieldReader<bool, bool>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `UECCEMSB` reader - Unique ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read)"]
107pub struct UECCEMSB_R(crate::FieldReader<bool, bool>);
108impl UECCEMSB_R {
109    #[inline(always)]
110    pub(crate) fn new(bits: bool) -> Self {
111        UECCEMSB_R(crate::FieldReader::new(bits))
112    }
113}
114impl core::ops::Deref for UECCEMSB_R {
115    type Target = crate::FieldReader<bool, bool>;
116    #[inline(always)]
117    fn deref(&self) -> &Self::Target {
118        &self.0
119    }
120}
121#[doc = "Field `MECCEMSB` reader - Multiple ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read)"]
122pub struct MECCEMSB_R(crate::FieldReader<bool, bool>);
123impl MECCEMSB_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        MECCEMSB_R(crate::FieldReader::new(bits))
127    }
128}
129impl core::ops::Deref for MECCEMSB_R {
130    type Target = crate::FieldReader<bool, bool>;
131    #[inline(always)]
132    fn deref(&self) -> &Self::Target {
133        &self.0
134    }
135}
136impl R {
137    #[doc = "Bit 0 - Flash Ready Status (cleared when Flash is busy)"]
138    #[inline(always)]
139    pub fn frdy(&self) -> FRDY_R {
140        FRDY_R::new((self.bits & 0x01) != 0)
141    }
142    #[doc = "Bit 1 - Flash Command Error Status (cleared on read or by writing EEFC_FCR)"]
143    #[inline(always)]
144    pub fn fcmde(&self) -> FCMDE_R {
145        FCMDE_R::new(((self.bits >> 1) & 0x01) != 0)
146    }
147    #[doc = "Bit 2 - Flash Lock Error Status (cleared on read)"]
148    #[inline(always)]
149    pub fn flocke(&self) -> FLOCKE_R {
150        FLOCKE_R::new(((self.bits >> 2) & 0x01) != 0)
151    }
152    #[doc = "Bit 3 - Flash Error Status (cleared when a programming operation starts)"]
153    #[inline(always)]
154    pub fn flerr(&self) -> FLERR_R {
155        FLERR_R::new(((self.bits >> 3) & 0x01) != 0)
156    }
157    #[doc = "Bit 16 - Unique ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read)"]
158    #[inline(always)]
159    pub fn ueccelsb(&self) -> UECCELSB_R {
160        UECCELSB_R::new(((self.bits >> 16) & 0x01) != 0)
161    }
162    #[doc = "Bit 17 - Multiple ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read)"]
163    #[inline(always)]
164    pub fn meccelsb(&self) -> MECCELSB_R {
165        MECCELSB_R::new(((self.bits >> 17) & 0x01) != 0)
166    }
167    #[doc = "Bit 18 - Unique ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read)"]
168    #[inline(always)]
169    pub fn ueccemsb(&self) -> UECCEMSB_R {
170        UECCEMSB_R::new(((self.bits >> 18) & 0x01) != 0)
171    }
172    #[doc = "Bit 19 - Multiple ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read)"]
173    #[inline(always)]
174    pub fn meccemsb(&self) -> MECCEMSB_R {
175        MECCEMSB_R::new(((self.bits >> 19) & 0x01) != 0)
176    }
177}
178#[doc = "EEFC Flash 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 [eefc_fsr](index.html) module"]
179pub struct EEFC_FSR_SPEC;
180impl crate::RegisterSpec for EEFC_FSR_SPEC {
181    type Ux = u32;
182}
183#[doc = "`read()` method returns [eefc_fsr::R](R) reader structure"]
184impl crate::Readable for EEFC_FSR_SPEC {
185    type Reader = R;
186}
187#[doc = "`reset()` method sets EEFC_FSR to value 0"]
188impl crate::Resettable for EEFC_FSR_SPEC {
189    #[inline(always)]
190    fn reset_value() -> Self::Ux {
191        0
192    }
193}