1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
#[doc = "Register `FCR` reader"]
pub struct R(crate::R<FCR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<FCR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<FCR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<FCR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `FCR` writer"]
pub struct W(crate::W<FCR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<FCR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<FCR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<FCR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `FRDY` reader - Flash Ready Interrupt Enable"]
pub type FRDY_R = crate::BitReader<FRDYSELECT_A>;
#[doc = "Flash Ready Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FRDYSELECT_A {
    #[doc = "0: Flash Ready does not generate an interrupt"]
    _0 = 0,
    #[doc = "1: Flash Ready generates an interrupt"]
    _1 = 1,
}
impl From<FRDYSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: FRDYSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl FRDY_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FRDYSELECT_A {
        match self.bits {
            false => FRDYSELECT_A::_0,
            true => FRDYSELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == FRDYSELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == FRDYSELECT_A::_1
    }
}
#[doc = "Field `FRDY` writer - Flash Ready Interrupt Enable"]
pub type FRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, FRDYSELECT_A, O>;
impl<'a, const O: u8> FRDY_W<'a, O> {
    #[doc = "Flash Ready does not generate an interrupt"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(FRDYSELECT_A::_0)
    }
    #[doc = "Flash Ready generates an interrupt"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(FRDYSELECT_A::_1)
    }
}
#[doc = "Field `LOCKE` reader - Lock Error Interrupt Enable"]
pub type LOCKE_R = crate::BitReader<LOCKESELECT_A>;
#[doc = "Lock Error Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LOCKESELECT_A {
    #[doc = "0: Lock Error does not generate an interrupt"]
    _0 = 0,
    #[doc = "1: Lock Error generates an interrupt"]
    _1 = 1,
}
impl From<LOCKESELECT_A> for bool {
    #[inline(always)]
    fn from(variant: LOCKESELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl LOCKE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> LOCKESELECT_A {
        match self.bits {
            false => LOCKESELECT_A::_0,
            true => LOCKESELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == LOCKESELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == LOCKESELECT_A::_1
    }
}
#[doc = "Field `LOCKE` writer - Lock Error Interrupt Enable"]
pub type LOCKE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, LOCKESELECT_A, O>;
impl<'a, const O: u8> LOCKE_W<'a, O> {
    #[doc = "Lock Error does not generate an interrupt"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(LOCKESELECT_A::_0)
    }
    #[doc = "Lock Error generates an interrupt"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(LOCKESELECT_A::_1)
    }
}
#[doc = "Field `PROGE` reader - Programming Error Interrupt Enable"]
pub type PROGE_R = crate::BitReader<PROGESELECT_A>;
#[doc = "Programming Error Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PROGESELECT_A {
    #[doc = "0: Programming Error does not generate an interrupt"]
    _0 = 0,
    #[doc = "1: Programming Error generates an interrupt"]
    _1 = 1,
}
impl From<PROGESELECT_A> for bool {
    #[inline(always)]
    fn from(variant: PROGESELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl PROGE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PROGESELECT_A {
        match self.bits {
            false => PROGESELECT_A::_0,
            true => PROGESELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == PROGESELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == PROGESELECT_A::_1
    }
}
#[doc = "Field `PROGE` writer - Programming Error Interrupt Enable"]
pub type PROGE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, PROGESELECT_A, O>;
impl<'a, const O: u8> PROGE_W<'a, O> {
    #[doc = "Programming Error does not generate an interrupt"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(PROGESELECT_A::_0)
    }
    #[doc = "Programming Error generates an interrupt"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(PROGESELECT_A::_1)
    }
}
#[doc = "Field `FWS` reader - Flash Wait State"]
pub type FWS_R = crate::BitReader<FWSSELECT_A>;
#[doc = "Flash Wait State\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FWSSELECT_A {
    #[doc = "0: The flash is read with 0 wait states"]
    _0 = 0,
    #[doc = "1: The flash is read with 1 wait states"]
    _1 = 1,
}
impl From<FWSSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: FWSSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl FWS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FWSSELECT_A {
        match self.bits {
            false => FWSSELECT_A::_0,
            true => FWSSELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == FWSSELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == FWSSELECT_A::_1
    }
}
#[doc = "Field `FWS` writer - Flash Wait State"]
pub type FWS_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, FWSSELECT_A, O>;
impl<'a, const O: u8> FWS_W<'a, O> {
    #[doc = "The flash is read with 0 wait states"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(FWSSELECT_A::_0)
    }
    #[doc = "The flash is read with 1 wait states"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(FWSSELECT_A::_1)
    }
}
#[doc = "Field `WS1OPT` reader - Wait State 1 Optimization"]
pub type WS1OPT_R = crate::BitReader<bool>;
#[doc = "Field `WS1OPT` writer - Wait State 1 Optimization"]
pub type WS1OPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, bool, O>;
impl R {
    #[doc = "Bit 0 - Flash Ready Interrupt Enable"]
    #[inline(always)]
    pub fn frdy(&self) -> FRDY_R {
        FRDY_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 2 - Lock Error Interrupt Enable"]
    #[inline(always)]
    pub fn locke(&self) -> LOCKE_R {
        LOCKE_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Programming Error Interrupt Enable"]
    #[inline(always)]
    pub fn proge(&self) -> PROGE_R {
        PROGE_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 6 - Flash Wait State"]
    #[inline(always)]
    pub fn fws(&self) -> FWS_R {
        FWS_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Wait State 1 Optimization"]
    #[inline(always)]
    pub fn ws1opt(&self) -> WS1OPT_R {
        WS1OPT_R::new(((self.bits >> 7) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Flash Ready Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn frdy(&mut self) -> FRDY_W<0> {
        FRDY_W::new(self)
    }
    #[doc = "Bit 2 - Lock Error Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn locke(&mut self) -> LOCKE_W<2> {
        LOCKE_W::new(self)
    }
    #[doc = "Bit 3 - Programming Error Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn proge(&mut self) -> PROGE_W<3> {
        PROGE_W::new(self)
    }
    #[doc = "Bit 6 - Flash Wait State"]
    #[inline(always)]
    #[must_use]
    pub fn fws(&mut self) -> FWS_W<6> {
        FWS_W::new(self)
    }
    #[doc = "Bit 7 - Wait State 1 Optimization"]
    #[inline(always)]
    #[must_use]
    pub fn ws1opt(&mut self) -> WS1OPT_W<7> {
        WS1OPT_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Flash Controller Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcr](index.html) module"]
pub struct FCR_SPEC;
impl crate::RegisterSpec for FCR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [fcr::R](R) reader structure"]
impl crate::Readable for FCR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [fcr::W](W) writer structure"]
impl crate::Writable for FCR_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets FCR to value 0"]
impl crate::Resettable for FCR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}