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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
#[doc = "Register `FLCTL_PRGBRST_CTLSTAT` reader"]
pub struct R(crate::R<FLCTL_PRGBRST_CTLSTAT_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<FLCTL_PRGBRST_CTLSTAT_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<FLCTL_PRGBRST_CTLSTAT_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<FLCTL_PRGBRST_CTLSTAT_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `FLCTL_PRGBRST_CTLSTAT` writer"]
pub struct W(crate::W<FLCTL_PRGBRST_CTLSTAT_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<FLCTL_PRGBRST_CTLSTAT_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<FLCTL_PRGBRST_CTLSTAT_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<FLCTL_PRGBRST_CTLSTAT_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `START` writer - Trigger start of burst program operation"]
pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, bool, O>;
#[doc = "Type of memory that burst program is carried out on\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TYPE_A {
    #[doc = "0: Main Memory"]
    TYPE_0 = 0,
    #[doc = "1: Information Memory"]
    TYPE_1 = 1,
    #[doc = "3: Engineering Memory"]
    TYPE_3 = 3,
}
impl From<TYPE_A> for u8 {
    #[inline(always)]
    fn from(variant: TYPE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `TYPE` reader - Type of memory that burst program is carried out on"]
pub type TYPE_R = crate::FieldReader<u8, TYPE_A>;
impl TYPE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<TYPE_A> {
        match self.bits {
            0 => Some(TYPE_A::TYPE_0),
            1 => Some(TYPE_A::TYPE_1),
            3 => Some(TYPE_A::TYPE_3),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `TYPE_0`"]
    #[inline(always)]
    pub fn is_type_0(&self) -> bool {
        *self == TYPE_A::TYPE_0
    }
    #[doc = "Checks if the value of the field is `TYPE_1`"]
    #[inline(always)]
    pub fn is_type_1(&self) -> bool {
        *self == TYPE_A::TYPE_1
    }
    #[doc = "Checks if the value of the field is `TYPE_3`"]
    #[inline(always)]
    pub fn is_type_3(&self) -> bool {
        *self == TYPE_A::TYPE_3
    }
}
#[doc = "Field `TYPE` writer - Type of memory that burst program is carried out on"]
pub type TYPE_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, u8, TYPE_A, 2, O>;
impl<'a, const O: u8> TYPE_W<'a, O> {
    #[doc = "Main Memory"]
    #[inline(always)]
    pub fn type_0(self) -> &'a mut W {
        self.variant(TYPE_A::TYPE_0)
    }
    #[doc = "Information Memory"]
    #[inline(always)]
    pub fn type_1(self) -> &'a mut W {
        self.variant(TYPE_A::TYPE_1)
    }
    #[doc = "Engineering Memory"]
    #[inline(always)]
    pub fn type_3(self) -> &'a mut W {
        self.variant(TYPE_A::TYPE_3)
    }
}
#[doc = "Length of burst\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum LEN_A {
    #[doc = "0: No burst operation"]
    LEN_0 = 0,
    #[doc = "1: 1 word burst of 128 bits, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    LEN_1 = 1,
    #[doc = "2: 2*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    LEN_2 = 2,
    #[doc = "3: 3*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    LEN_3 = 3,
    #[doc = "4: 4*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    LEN_4 = 4,
}
impl From<LEN_A> for u8 {
    #[inline(always)]
    fn from(variant: LEN_A) -> Self {
        variant as _
    }
}
#[doc = "Field `LEN` reader - Length of burst"]
pub type LEN_R = crate::FieldReader<u8, LEN_A>;
impl LEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<LEN_A> {
        match self.bits {
            0 => Some(LEN_A::LEN_0),
            1 => Some(LEN_A::LEN_1),
            2 => Some(LEN_A::LEN_2),
            3 => Some(LEN_A::LEN_3),
            4 => Some(LEN_A::LEN_4),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `LEN_0`"]
    #[inline(always)]
    pub fn is_len_0(&self) -> bool {
        *self == LEN_A::LEN_0
    }
    #[doc = "Checks if the value of the field is `LEN_1`"]
    #[inline(always)]
    pub fn is_len_1(&self) -> bool {
        *self == LEN_A::LEN_1
    }
    #[doc = "Checks if the value of the field is `LEN_2`"]
    #[inline(always)]
    pub fn is_len_2(&self) -> bool {
        *self == LEN_A::LEN_2
    }
    #[doc = "Checks if the value of the field is `LEN_3`"]
    #[inline(always)]
    pub fn is_len_3(&self) -> bool {
        *self == LEN_A::LEN_3
    }
    #[doc = "Checks if the value of the field is `LEN_4`"]
    #[inline(always)]
    pub fn is_len_4(&self) -> bool {
        *self == LEN_A::LEN_4
    }
}
#[doc = "Field `LEN` writer - Length of burst"]
pub type LEN_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, u8, LEN_A, 3, O>;
impl<'a, const O: u8> LEN_W<'a, O> {
    #[doc = "No burst operation"]
    #[inline(always)]
    pub fn len_0(self) -> &'a mut W {
        self.variant(LEN_A::LEN_0)
    }
    #[doc = "1 word burst of 128 bits, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    #[inline(always)]
    pub fn len_1(self) -> &'a mut W {
        self.variant(LEN_A::LEN_1)
    }
    #[doc = "2*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    #[inline(always)]
    pub fn len_2(self) -> &'a mut W {
        self.variant(LEN_A::LEN_2)
    }
    #[doc = "3*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    #[inline(always)]
    pub fn len_3(self) -> &'a mut W {
        self.variant(LEN_A::LEN_3)
    }
    #[doc = "4*128 bits burst write, starting with address in the FLCTL_PRGBRST_STARTADDR Register"]
    #[inline(always)]
    pub fn len_4(self) -> &'a mut W {
        self.variant(LEN_A::LEN_4)
    }
}
#[doc = "Auto-Verify operation before the Burst Program\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AUTO_PRE_A {
    #[doc = "0: No program verify operations carried out"]
    AUTO_PRE_0 = 0,
    #[doc = "1: Causes an automatic Burst Program Verify after the Burst Program Operation"]
    AUTO_PRE_1 = 1,
}
impl From<AUTO_PRE_A> for bool {
    #[inline(always)]
    fn from(variant: AUTO_PRE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AUTO_PRE` reader - Auto-Verify operation before the Burst Program"]
pub type AUTO_PRE_R = crate::BitReader<AUTO_PRE_A>;
impl AUTO_PRE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AUTO_PRE_A {
        match self.bits {
            false => AUTO_PRE_A::AUTO_PRE_0,
            true => AUTO_PRE_A::AUTO_PRE_1,
        }
    }
    #[doc = "Checks if the value of the field is `AUTO_PRE_0`"]
    #[inline(always)]
    pub fn is_auto_pre_0(&self) -> bool {
        *self == AUTO_PRE_A::AUTO_PRE_0
    }
    #[doc = "Checks if the value of the field is `AUTO_PRE_1`"]
    #[inline(always)]
    pub fn is_auto_pre_1(&self) -> bool {
        *self == AUTO_PRE_A::AUTO_PRE_1
    }
}
#[doc = "Field `AUTO_PRE` writer - Auto-Verify operation before the Burst Program"]
pub type AUTO_PRE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, AUTO_PRE_A, O>;
impl<'a, const O: u8> AUTO_PRE_W<'a, O> {
    #[doc = "No program verify operations carried out"]
    #[inline(always)]
    pub fn auto_pre_0(self) -> &'a mut W {
        self.variant(AUTO_PRE_A::AUTO_PRE_0)
    }
    #[doc = "Causes an automatic Burst Program Verify after the Burst Program Operation"]
    #[inline(always)]
    pub fn auto_pre_1(self) -> &'a mut W {
        self.variant(AUTO_PRE_A::AUTO_PRE_1)
    }
}
#[doc = "Auto-Verify operation after the Burst Program\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AUTO_PST_A {
    #[doc = "0: No program verify operations carried out"]
    AUTO_PST_0 = 0,
    #[doc = "1: Causes an automatic Burst Program Verify before the Burst Program Operation"]
    AUTO_PST_1 = 1,
}
impl From<AUTO_PST_A> for bool {
    #[inline(always)]
    fn from(variant: AUTO_PST_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AUTO_PST` reader - Auto-Verify operation after the Burst Program"]
pub type AUTO_PST_R = crate::BitReader<AUTO_PST_A>;
impl AUTO_PST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AUTO_PST_A {
        match self.bits {
            false => AUTO_PST_A::AUTO_PST_0,
            true => AUTO_PST_A::AUTO_PST_1,
        }
    }
    #[doc = "Checks if the value of the field is `AUTO_PST_0`"]
    #[inline(always)]
    pub fn is_auto_pst_0(&self) -> bool {
        *self == AUTO_PST_A::AUTO_PST_0
    }
    #[doc = "Checks if the value of the field is `AUTO_PST_1`"]
    #[inline(always)]
    pub fn is_auto_pst_1(&self) -> bool {
        *self == AUTO_PST_A::AUTO_PST_1
    }
}
#[doc = "Field `AUTO_PST` writer - Auto-Verify operation after the Burst Program"]
pub type AUTO_PST_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, AUTO_PST_A, O>;
impl<'a, const O: u8> AUTO_PST_W<'a, O> {
    #[doc = "No program verify operations carried out"]
    #[inline(always)]
    pub fn auto_pst_0(self) -> &'a mut W {
        self.variant(AUTO_PST_A::AUTO_PST_0)
    }
    #[doc = "Causes an automatic Burst Program Verify before the Burst Program Operation"]
    #[inline(always)]
    pub fn auto_pst_1(self) -> &'a mut W {
        self.variant(AUTO_PST_A::AUTO_PST_1)
    }
}
#[doc = "Status of a Burst Operation\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum BURST_STATUS_A {
    #[doc = "0: Idle (Burst not active)"]
    BURST_STATUS_0 = 0,
    #[doc = "1: Burst program started but pending"]
    BURST_STATUS_1 = 1,
    #[doc = "2: Burst active, with 1st 128 bit word being written into Flash"]
    BURST_STATUS_2 = 2,
    #[doc = "3: Burst active, with 2nd 128 bit word being written into Flash"]
    BURST_STATUS_3 = 3,
    #[doc = "4: Burst active, with 3rd 128 bit word being written into Flash"]
    BURST_STATUS_4 = 4,
    #[doc = "5: Burst active, with 4th 128 bit word being written into Flash"]
    BURST_STATUS_5 = 5,
    #[doc = "7: Burst Complete (status of completed burst remains in this state unless explicitly cleared by SW)"]
    BURST_STATUS_7 = 7,
}
impl From<BURST_STATUS_A> for u8 {
    #[inline(always)]
    fn from(variant: BURST_STATUS_A) -> Self {
        variant as _
    }
}
#[doc = "Field `BURST_STATUS` reader - Status of a Burst Operation"]
pub type BURST_STATUS_R = crate::FieldReader<u8, BURST_STATUS_A>;
impl BURST_STATUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<BURST_STATUS_A> {
        match self.bits {
            0 => Some(BURST_STATUS_A::BURST_STATUS_0),
            1 => Some(BURST_STATUS_A::BURST_STATUS_1),
            2 => Some(BURST_STATUS_A::BURST_STATUS_2),
            3 => Some(BURST_STATUS_A::BURST_STATUS_3),
            4 => Some(BURST_STATUS_A::BURST_STATUS_4),
            5 => Some(BURST_STATUS_A::BURST_STATUS_5),
            7 => Some(BURST_STATUS_A::BURST_STATUS_7),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_0`"]
    #[inline(always)]
    pub fn is_burst_status_0(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_0
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_1`"]
    #[inline(always)]
    pub fn is_burst_status_1(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_1
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_2`"]
    #[inline(always)]
    pub fn is_burst_status_2(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_2
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_3`"]
    #[inline(always)]
    pub fn is_burst_status_3(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_3
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_4`"]
    #[inline(always)]
    pub fn is_burst_status_4(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_4
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_5`"]
    #[inline(always)]
    pub fn is_burst_status_5(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_5
    }
    #[doc = "Checks if the value of the field is `BURST_STATUS_7`"]
    #[inline(always)]
    pub fn is_burst_status_7(&self) -> bool {
        *self == BURST_STATUS_A::BURST_STATUS_7
    }
}
#[doc = "Field `PRE_ERR` reader - Burst Operation encountered preprogram auto-verify errors"]
pub type PRE_ERR_R = crate::BitReader<bool>;
#[doc = "Field `PST_ERR` reader - Burst Operation encountered postprogram auto-verify errors"]
pub type PST_ERR_R = crate::BitReader<bool>;
#[doc = "Field `ADDR_ERR` reader - Burst Operation was terminated due to attempted program of reserved memory"]
pub type ADDR_ERR_R = crate::BitReader<bool>;
#[doc = "Field `CLR_STAT` writer - Clear status bits 21-16 of this register"]
pub type CLR_STAT_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, FLCTL_PRGBRST_CTLSTAT_SPEC, bool, O>;
impl R {
    #[doc = "Bits 1:2 - Type of memory that burst program is carried out on"]
    #[inline(always)]
    pub fn type_(&self) -> TYPE_R {
        TYPE_R::new(((self.bits >> 1) & 3) as u8)
    }
    #[doc = "Bits 3:5 - Length of burst"]
    #[inline(always)]
    pub fn len(&self) -> LEN_R {
        LEN_R::new(((self.bits >> 3) & 7) as u8)
    }
    #[doc = "Bit 6 - Auto-Verify operation before the Burst Program"]
    #[inline(always)]
    pub fn auto_pre(&self) -> AUTO_PRE_R {
        AUTO_PRE_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Auto-Verify operation after the Burst Program"]
    #[inline(always)]
    pub fn auto_pst(&self) -> AUTO_PST_R {
        AUTO_PST_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 16:18 - Status of a Burst Operation"]
    #[inline(always)]
    pub fn burst_status(&self) -> BURST_STATUS_R {
        BURST_STATUS_R::new(((self.bits >> 16) & 7) as u8)
    }
    #[doc = "Bit 19 - Burst Operation encountered preprogram auto-verify errors"]
    #[inline(always)]
    pub fn pre_err(&self) -> PRE_ERR_R {
        PRE_ERR_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - Burst Operation encountered postprogram auto-verify errors"]
    #[inline(always)]
    pub fn pst_err(&self) -> PST_ERR_R {
        PST_ERR_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Burst Operation was terminated due to attempted program of reserved memory"]
    #[inline(always)]
    pub fn addr_err(&self) -> ADDR_ERR_R {
        ADDR_ERR_R::new(((self.bits >> 21) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Trigger start of burst program operation"]
    #[inline(always)]
    pub fn start(&mut self) -> START_W<0> {
        START_W::new(self)
    }
    #[doc = "Bits 1:2 - Type of memory that burst program is carried out on"]
    #[inline(always)]
    pub fn type_(&mut self) -> TYPE_W<1> {
        TYPE_W::new(self)
    }
    #[doc = "Bits 3:5 - Length of burst"]
    #[inline(always)]
    pub fn len(&mut self) -> LEN_W<3> {
        LEN_W::new(self)
    }
    #[doc = "Bit 6 - Auto-Verify operation before the Burst Program"]
    #[inline(always)]
    pub fn auto_pre(&mut self) -> AUTO_PRE_W<6> {
        AUTO_PRE_W::new(self)
    }
    #[doc = "Bit 7 - Auto-Verify operation after the Burst Program"]
    #[inline(always)]
    pub fn auto_pst(&mut self) -> AUTO_PST_W<7> {
        AUTO_PST_W::new(self)
    }
    #[doc = "Bit 23 - Clear status bits 21-16 of this register"]
    #[inline(always)]
    pub fn clr_stat(&mut self) -> CLR_STAT_W<23> {
        CLR_STAT_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 = "Program Burst Control and Status 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 [flctl_prgbrst_ctlstat](index.html) module"]
pub struct FLCTL_PRGBRST_CTLSTAT_SPEC;
impl crate::RegisterSpec for FLCTL_PRGBRST_CTLSTAT_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [flctl_prgbrst_ctlstat::R](R) reader structure"]
impl crate::Readable for FLCTL_PRGBRST_CTLSTAT_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [flctl_prgbrst_ctlstat::W](W) writer structure"]
impl crate::Writable for FLCTL_PRGBRST_CTLSTAT_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets FLCTL_PRGBRST_CTLSTAT to value 0xc0"]
impl crate::Resettable for FLCTL_PRGBRST_CTLSTAT_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0xc0
    }
}