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
#[doc = "Register `AGTCR` reader"]
pub struct R(crate::R<AGTCR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<AGTCR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<AGTCR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<AGTCR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `AGTCR` writer"]
pub struct W(crate::W<AGTCR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<AGTCR_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<AGTCR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<AGTCR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `TSTART` reader - AGT count start"]
pub type TSTART_R = crate::BitReader<TSTART_A>;
#[doc = "AGT count start\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSTART_A {
    #[doc = "0: Count stops"]
    _0 = 0,
    #[doc = "1: Count starts"]
    _1 = 1,
}
impl From<TSTART_A> for bool {
    #[inline(always)]
    fn from(variant: TSTART_A) -> Self {
        variant as u8 != 0
    }
}
impl TSTART_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TSTART_A {
        match self.bits {
            false => TSTART_A::_0,
            true => TSTART_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TSTART_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TSTART_A::_1
    }
}
#[doc = "Field `TSTART` writer - AGT count start"]
pub type TSTART_W<'a, const O: u8> = crate::BitWriter<'a, u8, AGTCR_SPEC, TSTART_A, O>;
impl<'a, const O: u8> TSTART_W<'a, O> {
    #[doc = "Count stops"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TSTART_A::_0)
    }
    #[doc = "Count starts"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TSTART_A::_1)
    }
}
#[doc = "Field `TCSTF` reader - AGT count status flag"]
pub type TCSTF_R = crate::BitReader<TCSTF_A>;
#[doc = "AGT count status flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCSTF_A {
    #[doc = "0: Count stops"]
    _0 = 0,
    #[doc = "1: Count starts"]
    _1 = 1,
}
impl From<TCSTF_A> for bool {
    #[inline(always)]
    fn from(variant: TCSTF_A) -> Self {
        variant as u8 != 0
    }
}
impl TCSTF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TCSTF_A {
        match self.bits {
            false => TCSTF_A::_0,
            true => TCSTF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TCSTF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TCSTF_A::_1
    }
}
#[doc = "AGT count forced stop\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSTOP_AW {
    #[doc = "0: no effect"]
    _0 = 0,
    #[doc = "1: The count is forcibly stopped."]
    _1 = 1,
}
impl From<TSTOP_AW> for bool {
    #[inline(always)]
    fn from(variant: TSTOP_AW) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TSTOP` writer - AGT count forced stop"]
pub type TSTOP_W<'a, const O: u8> = crate::BitWriter<'a, u8, AGTCR_SPEC, TSTOP_AW, O>;
impl<'a, const O: u8> TSTOP_W<'a, O> {
    #[doc = "no effect"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TSTOP_AW::_0)
    }
    #[doc = "The count is forcibly stopped."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TSTOP_AW::_1)
    }
}
#[doc = "Field `TEDGF` reader - Active edge judgement flag\n\nThe field is **modified** in some way after a read operation."]
pub type TEDGF_R = crate::BitReader<TEDGF_A>;
#[doc = "Active edge judgement flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TEDGF_A {
    #[doc = "0: No active edge received"]
    _0 = 0,
    #[doc = "1: Active edge received"]
    _1 = 1,
}
impl From<TEDGF_A> for bool {
    #[inline(always)]
    fn from(variant: TEDGF_A) -> Self {
        variant as u8 != 0
    }
}
impl TEDGF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TEDGF_A {
        match self.bits {
            false => TEDGF_A::_0,
            true => TEDGF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TEDGF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TEDGF_A::_1
    }
}
#[doc = "Field `TEDGF` writer - Active edge judgement flag"]
pub type TEDGF_W<'a, const O: u8> = crate::BitWriter0C<'a, u8, AGTCR_SPEC, TEDGF_A, O>;
impl<'a, const O: u8> TEDGF_W<'a, O> {
    #[doc = "No active edge received"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TEDGF_A::_0)
    }
    #[doc = "Active edge received"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TEDGF_A::_1)
    }
}
#[doc = "Field `TUNDF` reader - AGT underflow flag\n\nThe field is **modified** in some way after a read operation."]
pub type TUNDF_R = crate::BitReader<TUNDF_A>;
#[doc = "AGT underflow flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TUNDF_A {
    #[doc = "0: No underflow"]
    _0 = 0,
    #[doc = "1: Underflow"]
    _1 = 1,
}
impl From<TUNDF_A> for bool {
    #[inline(always)]
    fn from(variant: TUNDF_A) -> Self {
        variant as u8 != 0
    }
}
impl TUNDF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TUNDF_A {
        match self.bits {
            false => TUNDF_A::_0,
            true => TUNDF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TUNDF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TUNDF_A::_1
    }
}
#[doc = "Field `TUNDF` writer - AGT underflow flag"]
pub type TUNDF_W<'a, const O: u8> = crate::BitWriter0C<'a, u8, AGTCR_SPEC, TUNDF_A, O>;
impl<'a, const O: u8> TUNDF_W<'a, O> {
    #[doc = "No underflow"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TUNDF_A::_0)
    }
    #[doc = "Underflow"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TUNDF_A::_1)
    }
}
#[doc = "Field `TCMAF` reader - AGT compare match A flag\n\nThe field is **modified** in some way after a read operation."]
pub type TCMAF_R = crate::BitReader<TCMAF_A>;
#[doc = "AGT compare match A flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCMAF_A {
    #[doc = "0: No Match"]
    _0 = 0,
    #[doc = "1: Match"]
    _1 = 1,
}
impl From<TCMAF_A> for bool {
    #[inline(always)]
    fn from(variant: TCMAF_A) -> Self {
        variant as u8 != 0
    }
}
impl TCMAF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TCMAF_A {
        match self.bits {
            false => TCMAF_A::_0,
            true => TCMAF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TCMAF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TCMAF_A::_1
    }
}
#[doc = "Field `TCMAF` writer - AGT compare match A flag"]
pub type TCMAF_W<'a, const O: u8> = crate::BitWriter0C<'a, u8, AGTCR_SPEC, TCMAF_A, O>;
impl<'a, const O: u8> TCMAF_W<'a, O> {
    #[doc = "No Match"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TCMAF_A::_0)
    }
    #[doc = "Match"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TCMAF_A::_1)
    }
}
#[doc = "Field `TCMBF` reader - AGT compare match B flag\n\nThe field is **modified** in some way after a read operation."]
pub type TCMBF_R = crate::BitReader<TCMBF_A>;
#[doc = "AGT compare match B flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCMBF_A {
    #[doc = "0: No Match"]
    _0 = 0,
    #[doc = "1: Match"]
    _1 = 1,
}
impl From<TCMBF_A> for bool {
    #[inline(always)]
    fn from(variant: TCMBF_A) -> Self {
        variant as u8 != 0
    }
}
impl TCMBF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TCMBF_A {
        match self.bits {
            false => TCMBF_A::_0,
            true => TCMBF_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TCMBF_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TCMBF_A::_1
    }
}
#[doc = "Field `TCMBF` writer - AGT compare match B flag"]
pub type TCMBF_W<'a, const O: u8> = crate::BitWriter0C<'a, u8, AGTCR_SPEC, TCMBF_A, O>;
impl<'a, const O: u8> TCMBF_W<'a, O> {
    #[doc = "No Match"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TCMBF_A::_0)
    }
    #[doc = "Match"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TCMBF_A::_1)
    }
}
impl R {
    #[doc = "Bit 0 - AGT count start"]
    #[inline(always)]
    pub fn tstart(&self) -> TSTART_R {
        TSTART_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - AGT count status flag"]
    #[inline(always)]
    pub fn tcstf(&self) -> TCSTF_R {
        TCSTF_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 4 - Active edge judgement flag"]
    #[inline(always)]
    pub fn tedgf(&self) -> TEDGF_R {
        TEDGF_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - AGT underflow flag"]
    #[inline(always)]
    pub fn tundf(&self) -> TUNDF_R {
        TUNDF_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - AGT compare match A flag"]
    #[inline(always)]
    pub fn tcmaf(&self) -> TCMAF_R {
        TCMAF_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - AGT compare match B flag"]
    #[inline(always)]
    pub fn tcmbf(&self) -> TCMBF_R {
        TCMBF_R::new(((self.bits >> 7) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - AGT count start"]
    #[inline(always)]
    #[must_use]
    pub fn tstart(&mut self) -> TSTART_W<0> {
        TSTART_W::new(self)
    }
    #[doc = "Bit 2 - AGT count forced stop"]
    #[inline(always)]
    #[must_use]
    pub fn tstop(&mut self) -> TSTOP_W<2> {
        TSTOP_W::new(self)
    }
    #[doc = "Bit 4 - Active edge judgement flag"]
    #[inline(always)]
    #[must_use]
    pub fn tedgf(&mut self) -> TEDGF_W<4> {
        TEDGF_W::new(self)
    }
    #[doc = "Bit 5 - AGT underflow flag"]
    #[inline(always)]
    #[must_use]
    pub fn tundf(&mut self) -> TUNDF_W<5> {
        TUNDF_W::new(self)
    }
    #[doc = "Bit 6 - AGT compare match A flag"]
    #[inline(always)]
    #[must_use]
    pub fn tcmaf(&mut self) -> TCMAF_W<6> {
        TCMAF_W::new(self)
    }
    #[doc = "Bit 7 - AGT compare match B flag"]
    #[inline(always)]
    #[must_use]
    pub fn tcmbf(&mut self) -> TCMBF_W<7> {
        TCMBF_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 = "AGT 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 [agtcr](index.html) module"]
pub struct AGTCR_SPEC;
impl crate::RegisterSpec for AGTCR_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [agtcr::R](R) reader structure"]
impl crate::Readable for AGTCR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [agtcr::W](W) writer structure"]
impl crate::Writable for AGTCR_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0xf0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets AGTCR to value 0"]
impl crate::Resettable for AGTCR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}