ra2a1 0.2.0

Peripheral access API for ra2a1 microcontrollers (generated using svd2rust)
Documentation
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
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
#[doc = "Register `ECSR` reader"]
pub struct R(crate::R<ECSR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ECSR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<ECSR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<ECSR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ECSR` writer"]
pub struct W(crate::W<ECSR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ECSR_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<ECSR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<ECSR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `SEF` reader - Stuff Error Flag"]
pub type SEF_R = crate::BitReader<SEF_A>;
#[doc = "Stuff Error Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SEF_A {
    #[doc = "0: No stuff error detected"]
    _0 = 0,
    #[doc = "1: Stuff error detected"]
    _1 = 1,
}
impl From<SEF_A> for bool {
    #[inline(always)]
    fn from(variant: SEF_A) -> Self {
        variant as u8 != 0
    }
}
impl SEF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SEF_A {
        match self.bits {
            false => SEF_A::_0,
            true => SEF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == SEF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == SEF_A::_1
    }
}
#[doc = "Field `SEF` writer - Stuff Error Flag"]
pub type SEF_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, SEF_A, O>;
impl<'a, const O: u8> SEF_W<'a, O> {
    #[doc = "No stuff error detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(SEF_A::_0)
    }
    #[doc = "Stuff error detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(SEF_A::_1)
    }
}
#[doc = "Field `FEF` reader - Form Error Flag"]
pub type FEF_R = crate::BitReader<FEF_A>;
#[doc = "Form Error Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FEF_A {
    #[doc = "0: No form error detected"]
    _0 = 0,
    #[doc = "1: Form error detected"]
    _1 = 1,
}
impl From<FEF_A> for bool {
    #[inline(always)]
    fn from(variant: FEF_A) -> Self {
        variant as u8 != 0
    }
}
impl FEF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FEF_A {
        match self.bits {
            false => FEF_A::_0,
            true => FEF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == FEF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == FEF_A::_1
    }
}
#[doc = "Field `FEF` writer - Form Error Flag"]
pub type FEF_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, FEF_A, O>;
impl<'a, const O: u8> FEF_W<'a, O> {
    #[doc = "No form error detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(FEF_A::_0)
    }
    #[doc = "Form error detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(FEF_A::_1)
    }
}
#[doc = "Field `AEF` reader - ACK Error Flag"]
pub type AEF_R = crate::BitReader<AEF_A>;
#[doc = "ACK Error Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AEF_A {
    #[doc = "0: No ACK error detected"]
    _0 = 0,
    #[doc = "1: ACK error detected"]
    _1 = 1,
}
impl From<AEF_A> for bool {
    #[inline(always)]
    fn from(variant: AEF_A) -> Self {
        variant as u8 != 0
    }
}
impl AEF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AEF_A {
        match self.bits {
            false => AEF_A::_0,
            true => AEF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AEF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AEF_A::_1
    }
}
#[doc = "Field `AEF` writer - ACK Error Flag"]
pub type AEF_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, AEF_A, O>;
impl<'a, const O: u8> AEF_W<'a, O> {
    #[doc = "No ACK error detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AEF_A::_0)
    }
    #[doc = "ACK error detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AEF_A::_1)
    }
}
#[doc = "Field `CEF` reader - CRC Error Flag"]
pub type CEF_R = crate::BitReader<CEF_A>;
#[doc = "CRC Error Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CEF_A {
    #[doc = "0: No CRC error detected"]
    _0 = 0,
    #[doc = "1: CRC error detected"]
    _1 = 1,
}
impl From<CEF_A> for bool {
    #[inline(always)]
    fn from(variant: CEF_A) -> Self {
        variant as u8 != 0
    }
}
impl CEF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CEF_A {
        match self.bits {
            false => CEF_A::_0,
            true => CEF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == CEF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == CEF_A::_1
    }
}
#[doc = "Field `CEF` writer - CRC Error Flag"]
pub type CEF_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, CEF_A, O>;
impl<'a, const O: u8> CEF_W<'a, O> {
    #[doc = "No CRC error detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(CEF_A::_0)
    }
    #[doc = "CRC error detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(CEF_A::_1)
    }
}
#[doc = "Field `BE1F` reader - Bit Error (recessive) Flag"]
pub type BE1F_R = crate::BitReader<BE1F_A>;
#[doc = "Bit Error (recessive) Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BE1F_A {
    #[doc = "0: No bit error (recessive) detected"]
    _0 = 0,
    #[doc = "1: Bit error (recessive) detected"]
    _1 = 1,
}
impl From<BE1F_A> for bool {
    #[inline(always)]
    fn from(variant: BE1F_A) -> Self {
        variant as u8 != 0
    }
}
impl BE1F_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BE1F_A {
        match self.bits {
            false => BE1F_A::_0,
            true => BE1F_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == BE1F_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == BE1F_A::_1
    }
}
#[doc = "Field `BE1F` writer - Bit Error (recessive) Flag"]
pub type BE1F_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, BE1F_A, O>;
impl<'a, const O: u8> BE1F_W<'a, O> {
    #[doc = "No bit error (recessive) detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(BE1F_A::_0)
    }
    #[doc = "Bit error (recessive) detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(BE1F_A::_1)
    }
}
#[doc = "Field `BE0F` reader - Bit Error (dominant) Flag"]
pub type BE0F_R = crate::BitReader<BE0F_A>;
#[doc = "Bit Error (dominant) Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BE0F_A {
    #[doc = "0: No bit error (dominant) detected"]
    _0 = 0,
    #[doc = "1: Bit error (dominant) detected"]
    _1 = 1,
}
impl From<BE0F_A> for bool {
    #[inline(always)]
    fn from(variant: BE0F_A) -> Self {
        variant as u8 != 0
    }
}
impl BE0F_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BE0F_A {
        match self.bits {
            false => BE0F_A::_0,
            true => BE0F_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == BE0F_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == BE0F_A::_1
    }
}
#[doc = "Field `BE0F` writer - Bit Error (dominant) Flag"]
pub type BE0F_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, BE0F_A, O>;
impl<'a, const O: u8> BE0F_W<'a, O> {
    #[doc = "No bit error (dominant) detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(BE0F_A::_0)
    }
    #[doc = "Bit error (dominant) detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(BE0F_A::_1)
    }
}
#[doc = "Field `ADEF` reader - ACK Delimiter Error Flag"]
pub type ADEF_R = crate::BitReader<ADEF_A>;
#[doc = "ACK Delimiter Error Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADEF_A {
    #[doc = "0: No ACK delimiter error detected"]
    _0 = 0,
    #[doc = "1: ACK delimiter error detected"]
    _1 = 1,
}
impl From<ADEF_A> for bool {
    #[inline(always)]
    fn from(variant: ADEF_A) -> Self {
        variant as u8 != 0
    }
}
impl ADEF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ADEF_A {
        match self.bits {
            false => ADEF_A::_0,
            true => ADEF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == ADEF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == ADEF_A::_1
    }
}
#[doc = "Field `ADEF` writer - ACK Delimiter Error Flag"]
pub type ADEF_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, ADEF_A, O>;
impl<'a, const O: u8> ADEF_W<'a, O> {
    #[doc = "No ACK delimiter error detected"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(ADEF_A::_0)
    }
    #[doc = "ACK delimiter error detected"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(ADEF_A::_1)
    }
}
#[doc = "Field `EDPM` reader - Error Display Mode Select"]
pub type EDPM_R = crate::BitReader<EDPM_A>;
#[doc = "Error Display Mode Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EDPM_A {
    #[doc = "0: Output of first detected error code"]
    _0 = 0,
    #[doc = "1: Output of accumulated error code"]
    _1 = 1,
}
impl From<EDPM_A> for bool {
    #[inline(always)]
    fn from(variant: EDPM_A) -> Self {
        variant as u8 != 0
    }
}
impl EDPM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EDPM_A {
        match self.bits {
            false => EDPM_A::_0,
            true => EDPM_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == EDPM_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == EDPM_A::_1
    }
}
#[doc = "Field `EDPM` writer - Error Display Mode Select"]
pub type EDPM_W<'a, const O: u8> = crate::BitWriter<'a, u8, ECSR_SPEC, EDPM_A, O>;
impl<'a, const O: u8> EDPM_W<'a, O> {
    #[doc = "Output of first detected error code"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(EDPM_A::_0)
    }
    #[doc = "Output of accumulated error code"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(EDPM_A::_1)
    }
}
impl R {
    #[doc = "Bit 0 - Stuff Error Flag"]
    #[inline(always)]
    pub fn sef(&self) -> SEF_R {
        SEF_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Form Error Flag"]
    #[inline(always)]
    pub fn fef(&self) -> FEF_R {
        FEF_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - ACK Error Flag"]
    #[inline(always)]
    pub fn aef(&self) -> AEF_R {
        AEF_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - CRC Error Flag"]
    #[inline(always)]
    pub fn cef(&self) -> CEF_R {
        CEF_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Bit Error (recessive) Flag"]
    #[inline(always)]
    pub fn be1f(&self) -> BE1F_R {
        BE1F_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Bit Error (dominant) Flag"]
    #[inline(always)]
    pub fn be0f(&self) -> BE0F_R {
        BE0F_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - ACK Delimiter Error Flag"]
    #[inline(always)]
    pub fn adef(&self) -> ADEF_R {
        ADEF_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Error Display Mode Select"]
    #[inline(always)]
    pub fn edpm(&self) -> EDPM_R {
        EDPM_R::new(((self.bits >> 7) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Stuff Error Flag"]
    #[inline(always)]
    #[must_use]
    pub fn sef(&mut self) -> SEF_W<0> {
        SEF_W::new(self)
    }
    #[doc = "Bit 1 - Form Error Flag"]
    #[inline(always)]
    #[must_use]
    pub fn fef(&mut self) -> FEF_W<1> {
        FEF_W::new(self)
    }
    #[doc = "Bit 2 - ACK Error Flag"]
    #[inline(always)]
    #[must_use]
    pub fn aef(&mut self) -> AEF_W<2> {
        AEF_W::new(self)
    }
    #[doc = "Bit 3 - CRC Error Flag"]
    #[inline(always)]
    #[must_use]
    pub fn cef(&mut self) -> CEF_W<3> {
        CEF_W::new(self)
    }
    #[doc = "Bit 4 - Bit Error (recessive) Flag"]
    #[inline(always)]
    #[must_use]
    pub fn be1f(&mut self) -> BE1F_W<4> {
        BE1F_W::new(self)
    }
    #[doc = "Bit 5 - Bit Error (dominant) Flag"]
    #[inline(always)]
    #[must_use]
    pub fn be0f(&mut self) -> BE0F_W<5> {
        BE0F_W::new(self)
    }
    #[doc = "Bit 6 - ACK Delimiter Error Flag"]
    #[inline(always)]
    #[must_use]
    pub fn adef(&mut self) -> ADEF_W<6> {
        ADEF_W::new(self)
    }
    #[doc = "Bit 7 - Error Display Mode Select"]
    #[inline(always)]
    #[must_use]
    pub fn edpm(&mut self) -> EDPM_W<7> {
        EDPM_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Error Code Store 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 [ecsr](index.html) module"]
pub struct ECSR_SPEC;
impl crate::RegisterSpec for ECSR_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [ecsr::R](R) reader structure"]
impl crate::Readable for ECSR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ecsr::W](W) writer structure"]
impl crate::Writable for ECSR_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 ECSR to value 0"]
impl crate::Resettable for ECSR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}