ra2e2 0.2.0

Peripheral access API for ra2e2 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
#[doc = "Register `SVDCT` reader"]
pub struct R(crate::R<SVDCT_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SVDCT_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SVDCT_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SVDCT_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SVDCT` writer"]
pub struct W(crate::W<SVDCT_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SVDCT_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<SVDCT_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SVDCT_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `TDCR` reader - Transfar Device Characteristic Register"]
pub type TDCR_R = crate::FieldReader<u8, u8>;
#[doc = "Field `TDCR` writer - Transfar Device Characteristic Register"]
pub type TDCR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SVDCT_SPEC, u8, u8, 8, O>;
#[doc = "Field `TBCR0` reader - Max Data Speed Limitation"]
pub type TBCR0_R = crate::BitReader<TBCR0_A>;
#[doc = "Max Data Speed Limitation\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBCR0_A {
    #[doc = "0: No Limitation"]
    _0 = 0,
    #[doc = "1: Limitation"]
    _1 = 1,
}
impl From<TBCR0_A> for bool {
    #[inline(always)]
    fn from(variant: TBCR0_A) -> Self {
        variant as u8 != 0
    }
}
impl TBCR0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TBCR0_A {
        match self.bits {
            false => TBCR0_A::_0,
            true => TBCR0_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TBCR0_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TBCR0_A::_1
    }
}
#[doc = "Field `TBCR0` writer - Max Data Speed Limitation"]
pub type TBCR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SVDCT_SPEC, TBCR0_A, O>;
impl<'a, const O: u8> TBCR0_W<'a, O> {
    #[doc = "No Limitation"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TBCR0_A::_0)
    }
    #[doc = "Limitation"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TBCR0_A::_1)
    }
}
#[doc = "Field `TBCR1` reader - IBI Request Capable"]
pub type TBCR1_R = crate::BitReader<TBCR1_A>;
#[doc = "IBI Request Capable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBCR1_A {
    #[doc = "0: Not Capable"]
    _0 = 0,
    #[doc = "1: Capable"]
    _1 = 1,
}
impl From<TBCR1_A> for bool {
    #[inline(always)]
    fn from(variant: TBCR1_A) -> Self {
        variant as u8 != 0
    }
}
impl TBCR1_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TBCR1_A {
        match self.bits {
            false => TBCR1_A::_0,
            true => TBCR1_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TBCR1_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TBCR1_A::_1
    }
}
#[doc = "Field `TBCR1` writer - IBI Request Capable"]
pub type TBCR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SVDCT_SPEC, TBCR1_A, O>;
impl<'a, const O: u8> TBCR1_W<'a, O> {
    #[doc = "Not Capable"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TBCR1_A::_0)
    }
    #[doc = "Capable"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TBCR1_A::_1)
    }
}
#[doc = "Field `TBCR2` reader - IBI Payload"]
pub type TBCR2_R = crate::BitReader<TBCR2_A>;
#[doc = "IBI Payload\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBCR2_A {
    #[doc = "0: No data byte follows the accepted IBI."]
    _0 = 0,
    #[doc = "1: Mandatory one or more data bytes follow the accepted IBI. Data byte continuation is indicated by T-Bit."]
    _1 = 1,
}
impl From<TBCR2_A> for bool {
    #[inline(always)]
    fn from(variant: TBCR2_A) -> Self {
        variant as u8 != 0
    }
}
impl TBCR2_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TBCR2_A {
        match self.bits {
            false => TBCR2_A::_0,
            true => TBCR2_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TBCR2_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TBCR2_A::_1
    }
}
#[doc = "Field `TBCR2` writer - IBI Payload"]
pub type TBCR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SVDCT_SPEC, TBCR2_A, O>;
impl<'a, const O: u8> TBCR2_W<'a, O> {
    #[doc = "No data byte follows the accepted IBI."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TBCR2_A::_0)
    }
    #[doc = "Mandatory one or more data bytes follow the accepted IBI. Data byte continuation is indicated by T-Bit."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TBCR2_A::_1)
    }
}
#[doc = "Field `TBCR3` reader - Offline Capable"]
pub type TBCR3_R = crate::BitReader<TBCR3_A>;
#[doc = "Offline Capable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBCR3_A {
    #[doc = "0: Device will always respond to I3C bus commands."]
    _0 = 0,
    #[doc = "1: Device will not always respond to I3C bus commands."]
    _1 = 1,
}
impl From<TBCR3_A> for bool {
    #[inline(always)]
    fn from(variant: TBCR3_A) -> Self {
        variant as u8 != 0
    }
}
impl TBCR3_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TBCR3_A {
        match self.bits {
            false => TBCR3_A::_0,
            true => TBCR3_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == TBCR3_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == TBCR3_A::_1
    }
}
#[doc = "Field `TBCR3` writer - Offline Capable"]
pub type TBCR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SVDCT_SPEC, TBCR3_A, O>;
impl<'a, const O: u8> TBCR3_W<'a, O> {
    #[doc = "Device will always respond to I3C bus commands."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(TBCR3_A::_0)
    }
    #[doc = "Device will not always respond to I3C bus commands."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(TBCR3_A::_1)
    }
}
#[doc = "Field `TBCR76` reader - Device Role"]
pub type TBCR76_R = crate::FieldReader<u8, TBCR76_A>;
#[doc = "Device Role\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TBCR76_A {
    #[doc = "0: I3C Slave"]
    _00 = 0,
    #[doc = "1: I3C Master"]
    _01 = 1,
    #[doc = "2: Reserved for future definition by MIPI Sensor WG"]
    _10 = 2,
    #[doc = "3: Reserved for future definition by MIPI Sensor WG"]
    _11 = 3,
}
impl From<TBCR76_A> for u8 {
    #[inline(always)]
    fn from(variant: TBCR76_A) -> Self {
        variant as _
    }
}
impl TBCR76_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TBCR76_A {
        match self.bits {
            0 => TBCR76_A::_00,
            1 => TBCR76_A::_01,
            2 => TBCR76_A::_10,
            3 => TBCR76_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == TBCR76_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == TBCR76_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == TBCR76_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == TBCR76_A::_11
    }
}
#[doc = "Field `TBCR76` writer - Device Role"]
pub type TBCR76_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, SVDCT_SPEC, u8, TBCR76_A, 2, O>;
impl<'a, const O: u8> TBCR76_W<'a, O> {
    #[doc = "I3C Slave"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(TBCR76_A::_00)
    }
    #[doc = "I3C Master"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(TBCR76_A::_01)
    }
    #[doc = "Reserved for future definition by MIPI Sensor WG"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(TBCR76_A::_10)
    }
    #[doc = "Reserved for future definition by MIPI Sensor WG"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(TBCR76_A::_11)
    }
}
impl R {
    #[doc = "Bits 0:7 - Transfar Device Characteristic Register"]
    #[inline(always)]
    pub fn tdcr(&self) -> TDCR_R {
        TDCR_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bit 8 - Max Data Speed Limitation"]
    #[inline(always)]
    pub fn tbcr0(&self) -> TBCR0_R {
        TBCR0_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - IBI Request Capable"]
    #[inline(always)]
    pub fn tbcr1(&self) -> TBCR1_R {
        TBCR1_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - IBI Payload"]
    #[inline(always)]
    pub fn tbcr2(&self) -> TBCR2_R {
        TBCR2_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Offline Capable"]
    #[inline(always)]
    pub fn tbcr3(&self) -> TBCR3_R {
        TBCR3_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bits 14:15 - Device Role"]
    #[inline(always)]
    pub fn tbcr76(&self) -> TBCR76_R {
        TBCR76_R::new(((self.bits >> 14) & 3) as u8)
    }
}
impl W {
    #[doc = "Bits 0:7 - Transfar Device Characteristic Register"]
    #[inline(always)]
    #[must_use]
    pub fn tdcr(&mut self) -> TDCR_W<0> {
        TDCR_W::new(self)
    }
    #[doc = "Bit 8 - Max Data Speed Limitation"]
    #[inline(always)]
    #[must_use]
    pub fn tbcr0(&mut self) -> TBCR0_W<8> {
        TBCR0_W::new(self)
    }
    #[doc = "Bit 9 - IBI Request Capable"]
    #[inline(always)]
    #[must_use]
    pub fn tbcr1(&mut self) -> TBCR1_W<9> {
        TBCR1_W::new(self)
    }
    #[doc = "Bit 10 - IBI Payload"]
    #[inline(always)]
    #[must_use]
    pub fn tbcr2(&mut self) -> TBCR2_W<10> {
        TBCR2_W::new(self)
    }
    #[doc = "Bit 11 - Offline Capable"]
    #[inline(always)]
    #[must_use]
    pub fn tbcr3(&mut self) -> TBCR3_W<11> {
        TBCR3_W::new(self)
    }
    #[doc = "Bits 14:15 - Device Role"]
    #[inline(always)]
    #[must_use]
    pub fn tbcr76(&mut self) -> TBCR76_W<14> {
        TBCR76_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 = "Slave Device Characteristic Table 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 [svdct](index.html) module"]
pub struct SVDCT_SPEC;
impl crate::RegisterSpec for SVDCT_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [svdct::R](R) reader structure"]
impl crate::Readable for SVDCT_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [svdct::W](W) writer structure"]
impl crate::Writable for SVDCT_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 SVDCT to value 0"]
impl crate::Resettable for SVDCT_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}