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
#[doc = "Register `AMPTRM` reader"]
pub struct R(crate::R<AMPTRM_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<AMPTRM_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<AMPTRM_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<AMPTRM_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `AMPTRM` writer"]
pub struct W(crate::W<AMPTRM_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<AMPTRM_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<AMPTRM_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<AMPTRM_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `AMPTRM00` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM00_R = crate::BitReader<AMPTRM00_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM00_A {
    #[doc = "0: Software trigger mode(AMPTRM01=0)/Setting prohibited(AMPTRM01=1)."]
    _0 = 0,
    #[doc = "1: An activation trigger mode(AMPTRM01=0)/An activation and A/D trigger mode(AMPTRM01=1)."]
    _1 = 1,
}
impl From<AMPTRM00_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM00_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM00_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM00_A {
        match self.bits {
            false => AMPTRM00_A::_0,
            true => AMPTRM00_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM00_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM00_A::_1
    }
}
#[doc = "Field `AMPTRM00` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM00_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM00_A, O>;
impl<'a, const O: u8> AMPTRM00_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM01=0)/Setting prohibited(AMPTRM01=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM00_A::_0)
    }
    #[doc = "An activation trigger mode(AMPTRM01=0)/An activation and A/D trigger mode(AMPTRM01=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM00_A::_1)
    }
}
#[doc = "Field `AMPTRM01` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM01_R = crate::BitReader<AMPTRM01_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM01_A {
    #[doc = "0: Software trigger mode(AMPTRM00=0)/An activation trigger mode(AMPTRM00=1)."]
    _0 = 0,
    #[doc = "1: Setting prohibited(AMPTRM00=0)/An activation and A/D trigger mode(AMPTRM00=1)."]
    _1 = 1,
}
impl From<AMPTRM01_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM01_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM01_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM01_A {
        match self.bits {
            false => AMPTRM01_A::_0,
            true => AMPTRM01_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM01_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM01_A::_1
    }
}
#[doc = "Field `AMPTRM01` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM01_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM01_A, O>;
impl<'a, const O: u8> AMPTRM01_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM00=0)/An activation trigger mode(AMPTRM00=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM01_A::_0)
    }
    #[doc = "Setting prohibited(AMPTRM00=0)/An activation and A/D trigger mode(AMPTRM00=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM01_A::_1)
    }
}
#[doc = "Field `AMPTRM10` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM10_R = crate::BitReader<AMPTRM10_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM10_A {
    #[doc = "0: Software trigger mode(AMPTRM11=0)/Setting prohibited(AMPTRM11=1)."]
    _0 = 0,
    #[doc = "1: An activation trigger mode(AMPTRM11=0)/An activation and A/D trigger mode(AMPTRM11=1)."]
    _1 = 1,
}
impl From<AMPTRM10_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM10_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM10_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM10_A {
        match self.bits {
            false => AMPTRM10_A::_0,
            true => AMPTRM10_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM10_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM10_A::_1
    }
}
#[doc = "Field `AMPTRM10` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM10_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM10_A, O>;
impl<'a, const O: u8> AMPTRM10_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM11=0)/Setting prohibited(AMPTRM11=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM10_A::_0)
    }
    #[doc = "An activation trigger mode(AMPTRM11=0)/An activation and A/D trigger mode(AMPTRM11=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM10_A::_1)
    }
}
#[doc = "Field `AMPTRM11` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM11_R = crate::BitReader<AMPTRM11_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM11_A {
    #[doc = "0: Software trigger mode(AMPTRM10=0)/An activation trigger mode(AMPTRM10=1)."]
    _0 = 0,
    #[doc = "1: Setting prohibited(AMPTRM10=0)/An activation and A/D trigger mode(AMPTRM10=1)."]
    _1 = 1,
}
impl From<AMPTRM11_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM11_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM11_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM11_A {
        match self.bits {
            false => AMPTRM11_A::_0,
            true => AMPTRM11_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM11_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM11_A::_1
    }
}
#[doc = "Field `AMPTRM11` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM11_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM11_A, O>;
impl<'a, const O: u8> AMPTRM11_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM10=0)/An activation trigger mode(AMPTRM10=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM11_A::_0)
    }
    #[doc = "Setting prohibited(AMPTRM10=0)/An activation and A/D trigger mode(AMPTRM10=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM11_A::_1)
    }
}
#[doc = "Field `AMPTRM20` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM20_R = crate::BitReader<AMPTRM20_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM20_A {
    #[doc = "0: Software trigger mode(AMPTRM21=0)/Setting prohibited(AMPTRM21=1)."]
    _0 = 0,
    #[doc = "1: An activation trigger mode(AMPTRM21=0)/An activation and A/D trigger mode(AMPTRM21=1)."]
    _1 = 1,
}
impl From<AMPTRM20_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM20_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM20_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM20_A {
        match self.bits {
            false => AMPTRM20_A::_0,
            true => AMPTRM20_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM20_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM20_A::_1
    }
}
#[doc = "Field `AMPTRM20` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM20_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM20_A, O>;
impl<'a, const O: u8> AMPTRM20_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM21=0)/Setting prohibited(AMPTRM21=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM20_A::_0)
    }
    #[doc = "An activation trigger mode(AMPTRM21=0)/An activation and A/D trigger mode(AMPTRM21=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM20_A::_1)
    }
}
#[doc = "Field `AMPTRM21` reader - OPAMP function activation/stop trigger control"]
pub type AMPTRM21_R = crate::BitReader<AMPTRM21_A>;
#[doc = "OPAMP function activation/stop trigger control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMPTRM21_A {
    #[doc = "0: Software trigger mode(AMPTRM20=0)/An activation trigger mode(AMPTRM20=1)."]
    _0 = 0,
    #[doc = "1: Setting prohibited(AMPTRM20=0)/An activation and A/D trigger mode(AMPTRM20=1)."]
    _1 = 1,
}
impl From<AMPTRM21_A> for bool {
    #[inline(always)]
    fn from(variant: AMPTRM21_A) -> Self {
        variant as u8 != 0
    }
}
impl AMPTRM21_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMPTRM21_A {
        match self.bits {
            false => AMPTRM21_A::_0,
            true => AMPTRM21_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == AMPTRM21_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == AMPTRM21_A::_1
    }
}
#[doc = "Field `AMPTRM21` writer - OPAMP function activation/stop trigger control"]
pub type AMPTRM21_W<'a, const O: u8> = crate::BitWriter<'a, u8, AMPTRM_SPEC, AMPTRM21_A, O>;
impl<'a, const O: u8> AMPTRM21_W<'a, O> {
    #[doc = "Software trigger mode(AMPTRM20=0)/An activation trigger mode(AMPTRM20=1)."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AMPTRM21_A::_0)
    }
    #[doc = "Setting prohibited(AMPTRM20=0)/An activation and A/D trigger mode(AMPTRM20=1)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AMPTRM21_A::_1)
    }
}
impl R {
    #[doc = "Bit 0 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm00(&self) -> AMPTRM00_R {
        AMPTRM00_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm01(&self) -> AMPTRM01_R {
        AMPTRM01_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm10(&self) -> AMPTRM10_R {
        AMPTRM10_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm11(&self) -> AMPTRM11_R {
        AMPTRM11_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm20(&self) -> AMPTRM20_R {
        AMPTRM20_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    pub fn amptrm21(&self) -> AMPTRM21_R {
        AMPTRM21_R::new(((self.bits >> 5) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm00(&mut self) -> AMPTRM00_W<0> {
        AMPTRM00_W::new(self)
    }
    #[doc = "Bit 1 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm01(&mut self) -> AMPTRM01_W<1> {
        AMPTRM01_W::new(self)
    }
    #[doc = "Bit 2 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm10(&mut self) -> AMPTRM10_W<2> {
        AMPTRM10_W::new(self)
    }
    #[doc = "Bit 3 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm11(&mut self) -> AMPTRM11_W<3> {
        AMPTRM11_W::new(self)
    }
    #[doc = "Bit 4 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm20(&mut self) -> AMPTRM20_W<4> {
        AMPTRM20_W::new(self)
    }
    #[doc = "Bit 5 - OPAMP function activation/stop trigger control"]
    #[inline(always)]
    #[must_use]
    pub fn amptrm21(&mut self) -> AMPTRM21_W<5> {
        AMPTRM21_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 = "Operational amplifier trigger mode 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 [amptrm](index.html) module"]
pub struct AMPTRM_SPEC;
impl crate::RegisterSpec for AMPTRM_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [amptrm::R](R) reader structure"]
impl crate::Readable for AMPTRM_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [amptrm::W](W) writer structure"]
impl crate::Writable for AMPTRM_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 AMPTRM to value 0"]
impl crate::Resettable for AMPTRM_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}