ra6m1 0.2.0

Peripheral access API for ra6m1 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 `ADEXICR` reader"]
pub struct R(crate::R<ADEXICR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ADEXICR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<ADEXICR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<ADEXICR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ADEXICR` writer"]
pub struct W(crate::W<ADEXICR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ADEXICR_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<ADEXICR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<ADEXICR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `TSSAD` reader - Temperature Sensor Output A/D converted Value Addition/Average Mode Select"]
pub type TSSAD_R = crate::BitReader<TSSAD_A>;
#[doc = "Temperature Sensor Output A/D converted Value Addition/Average Mode Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSSAD_A {
    #[doc = "0: Temperature sensor output A/D-converted value addition/average mode is not selected."]
    _0 = 0,
    #[doc = "1: Temperature sensor output A/D-converted value addition/average mode is selected."]
    _1 = 1,
}
impl From<TSSAD_A> for bool {
    #[inline(always)]
    fn from(variant: TSSAD_A) -> Self {
        variant as u8 != 0
    }
}
impl TSSAD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TSSAD_A {
        match self.bits {
            false => TSSAD_A::_0,
            true => TSSAD_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TSSAD_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TSSAD_A::_1
    }
}
#[doc = "Field `TSSAD` writer - Temperature Sensor Output A/D converted Value Addition/Average Mode Select"]
pub type TSSAD_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, TSSAD_A, O>;
impl<'a, const O: u8> TSSAD_W<'a, O> {
    #[doc = "Temperature sensor output A/D-converted value addition/average mode is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TSSAD_A::_0)
    }
    #[doc = "Temperature sensor output A/D-converted value addition/average mode is selected."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TSSAD_A::_1)
    }
}
#[doc = "Field `OCSAD` reader - Internal Reference Voltage A/D converted Value Addition/Average Mode Select"]
pub type OCSAD_R = crate::BitReader<OCSAD_A>;
#[doc = "Internal Reference Voltage A/D converted Value Addition/Average Mode Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OCSAD_A {
    #[doc = "0: Internal reference voltage A/D-converted value addition/average mode is not selected."]
    _0 = 0,
    #[doc = "1: Internal reference voltage A/D-converted value addition/average mode is selected."]
    _1 = 1,
}
impl From<OCSAD_A> for bool {
    #[inline(always)]
    fn from(variant: OCSAD_A) -> Self {
        variant as u8 != 0
    }
}
impl OCSAD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OCSAD_A {
        match self.bits {
            false => OCSAD_A::_0,
            true => OCSAD_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OCSAD_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OCSAD_A::_1
    }
}
#[doc = "Field `OCSAD` writer - Internal Reference Voltage A/D converted Value Addition/Average Mode Select"]
pub type OCSAD_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, OCSAD_A, O>;
impl<'a, const O: u8> OCSAD_W<'a, O> {
    #[doc = "Internal reference voltage A/D-converted value addition/average mode is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OCSAD_A::_0)
    }
    #[doc = "Internal reference voltage A/D-converted value addition/average mode is selected."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OCSAD_A::_1)
    }
}
#[doc = "Field `TSSA` reader - Temperature Sensor Output A/D Conversion Select"]
pub type TSSA_R = crate::BitReader<TSSA_A>;
#[doc = "Temperature Sensor Output A/D Conversion Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSSA_A {
    #[doc = "0: The temperature sensor output is not selected."]
    _0 = 0,
    #[doc = "1: The temperature sensor output is selected."]
    _1 = 1,
}
impl From<TSSA_A> for bool {
    #[inline(always)]
    fn from(variant: TSSA_A) -> Self {
        variant as u8 != 0
    }
}
impl TSSA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TSSA_A {
        match self.bits {
            false => TSSA_A::_0,
            true => TSSA_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TSSA_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TSSA_A::_1
    }
}
#[doc = "Field `TSSA` writer - Temperature Sensor Output A/D Conversion Select"]
pub type TSSA_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, TSSA_A, O>;
impl<'a, const O: u8> TSSA_W<'a, O> {
    #[doc = "The temperature sensor output is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TSSA_A::_0)
    }
    #[doc = "The temperature sensor output is selected."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TSSA_A::_1)
    }
}
#[doc = "Field `OCSA` reader - Internal Reference Voltage A/D Conversion Select"]
pub type OCSA_R = crate::BitReader<OCSA_A>;
#[doc = "Internal Reference Voltage A/D Conversion Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OCSA_A {
    #[doc = "0: The internal reference voltage is not selected."]
    _0 = 0,
    #[doc = "1: The internal reference voltage is selected for group A in single scan mode, continuous scan mode, or group scan mode."]
    _1 = 1,
}
impl From<OCSA_A> for bool {
    #[inline(always)]
    fn from(variant: OCSA_A) -> Self {
        variant as u8 != 0
    }
}
impl OCSA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OCSA_A {
        match self.bits {
            false => OCSA_A::_0,
            true => OCSA_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OCSA_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OCSA_A::_1
    }
}
#[doc = "Field `OCSA` writer - Internal Reference Voltage A/D Conversion Select"]
pub type OCSA_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, OCSA_A, O>;
impl<'a, const O: u8> OCSA_W<'a, O> {
    #[doc = "The internal reference voltage is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OCSA_A::_0)
    }
    #[doc = "The internal reference voltage is selected for group A in single scan mode, continuous scan mode, or group scan mode."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OCSA_A::_1)
    }
}
#[doc = "Field `TSSB` reader - Temperature Sensor Output A/D Conversion Select for Group B"]
pub type TSSB_R = crate::BitReader<TSSB_A>;
#[doc = "Temperature Sensor Output A/D Conversion Select for Group B\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSSB_A {
    #[doc = "0: The temperature sensor output is not selected."]
    _0 = 0,
    #[doc = "1: The temperature sensor output is not selected for group B in group scan mode."]
    _1 = 1,
}
impl From<TSSB_A> for bool {
    #[inline(always)]
    fn from(variant: TSSB_A) -> Self {
        variant as u8 != 0
    }
}
impl TSSB_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TSSB_A {
        match self.bits {
            false => TSSB_A::_0,
            true => TSSB_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TSSB_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TSSB_A::_1
    }
}
#[doc = "Field `TSSB` writer - Temperature Sensor Output A/D Conversion Select for Group B"]
pub type TSSB_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, TSSB_A, O>;
impl<'a, const O: u8> TSSB_W<'a, O> {
    #[doc = "The temperature sensor output is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TSSB_A::_0)
    }
    #[doc = "The temperature sensor output is not selected for group B in group scan mode."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TSSB_A::_1)
    }
}
#[doc = "Field `OCSB` reader - Internal Reference Voltage A/D Conversion Select for Group B"]
pub type OCSB_R = crate::BitReader<OCSB_A>;
#[doc = "Internal Reference Voltage A/D Conversion Select for Group B\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OCSB_A {
    #[doc = "0: The internal reference voltage is not selected."]
    _0 = 0,
    #[doc = "1: The internal reference voltage is selected for group B in group scan mode."]
    _1 = 1,
}
impl From<OCSB_A> for bool {
    #[inline(always)]
    fn from(variant: OCSB_A) -> Self {
        variant as u8 != 0
    }
}
impl OCSB_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OCSB_A {
        match self.bits {
            false => OCSB_A::_0,
            true => OCSB_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OCSB_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OCSB_A::_1
    }
}
#[doc = "Field `OCSB` writer - Internal Reference Voltage A/D Conversion Select for Group B"]
pub type OCSB_W<'a, const O: u8> = crate::BitWriter<'a, u16, ADEXICR_SPEC, OCSB_A, O>;
impl<'a, const O: u8> OCSB_W<'a, O> {
    #[doc = "The internal reference voltage is not selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OCSB_A::_0)
    }
    #[doc = "The internal reference voltage is selected for group B in group scan mode."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OCSB_A::_1)
    }
}
impl R {
    #[doc = "Bit 0 - Temperature Sensor Output A/D converted Value Addition/Average Mode Select"]
    #[inline(always)]
    pub fn tssad(&self) -> TSSAD_R {
        TSSAD_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Internal Reference Voltage A/D converted Value Addition/Average Mode Select"]
    #[inline(always)]
    pub fn ocsad(&self) -> OCSAD_R {
        OCSAD_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 8 - Temperature Sensor Output A/D Conversion Select"]
    #[inline(always)]
    pub fn tssa(&self) -> TSSA_R {
        TSSA_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Internal Reference Voltage A/D Conversion Select"]
    #[inline(always)]
    pub fn ocsa(&self) -> OCSA_R {
        OCSA_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Temperature Sensor Output A/D Conversion Select for Group B"]
    #[inline(always)]
    pub fn tssb(&self) -> TSSB_R {
        TSSB_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Internal Reference Voltage A/D Conversion Select for Group B"]
    #[inline(always)]
    pub fn ocsb(&self) -> OCSB_R {
        OCSB_R::new(((self.bits >> 11) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Temperature Sensor Output A/D converted Value Addition/Average Mode Select"]
    #[inline(always)]
    #[must_use]
    pub fn tssad(&mut self) -> TSSAD_W<0> {
        TSSAD_W::new(self)
    }
    #[doc = "Bit 1 - Internal Reference Voltage A/D converted Value Addition/Average Mode Select"]
    #[inline(always)]
    #[must_use]
    pub fn ocsad(&mut self) -> OCSAD_W<1> {
        OCSAD_W::new(self)
    }
    #[doc = "Bit 8 - Temperature Sensor Output A/D Conversion Select"]
    #[inline(always)]
    #[must_use]
    pub fn tssa(&mut self) -> TSSA_W<8> {
        TSSA_W::new(self)
    }
    #[doc = "Bit 9 - Internal Reference Voltage A/D Conversion Select"]
    #[inline(always)]
    #[must_use]
    pub fn ocsa(&mut self) -> OCSA_W<9> {
        OCSA_W::new(self)
    }
    #[doc = "Bit 10 - Temperature Sensor Output A/D Conversion Select for Group B"]
    #[inline(always)]
    #[must_use]
    pub fn tssb(&mut self) -> TSSB_W<10> {
        TSSB_W::new(self)
    }
    #[doc = "Bit 11 - Internal Reference Voltage A/D Conversion Select for Group B"]
    #[inline(always)]
    #[must_use]
    pub fn ocsb(&mut self) -> OCSB_W<11> {
        OCSB_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "A/D Conversion Extended Input 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 [adexicr](index.html) module"]
pub struct ADEXICR_SPEC;
impl crate::RegisterSpec for ADEXICR_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [adexicr::R](R) reader structure"]
impl crate::Readable for ADEXICR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [adexicr::W](W) writer structure"]
impl crate::Writable for ADEXICR_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 ADEXICR to value 0"]
impl crate::Resettable for ADEXICR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}