mimxrt685s-pac 0.5.0

Peripheral Access Crate for MIMXRT685s devices
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
#[doc = "Register `CMD_XFR_TYP` reader"]
pub type R = crate::R<CmdXfrTypSpec>;
#[doc = "Register `CMD_XFR_TYP` writer"]
pub type W = crate::W<CmdXfrTypSpec>;
#[doc = "Response Type Select\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rsptyp {
    #[doc = "0: No Response"]
    Rsptyp0 = 0,
    #[doc = "1: Response Length 136"]
    Rsptyp1 = 1,
    #[doc = "2: Response Length 48"]
    Rsptyp2 = 2,
    #[doc = "3: Response Length 48, check Busy after response"]
    Rsptyp3 = 3,
}
impl From<Rsptyp> for u8 {
    #[inline(always)]
    fn from(variant: Rsptyp) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rsptyp {
    type Ux = u8;
}
impl crate::IsEnum for Rsptyp {}
#[doc = "Field `RSPTYP` reader - Response Type Select"]
pub type RsptypR = crate::FieldReader<Rsptyp>;
impl RsptypR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rsptyp {
        match self.bits {
            0 => Rsptyp::Rsptyp0,
            1 => Rsptyp::Rsptyp1,
            2 => Rsptyp::Rsptyp2,
            3 => Rsptyp::Rsptyp3,
            _ => unreachable!(),
        }
    }
    #[doc = "No Response"]
    #[inline(always)]
    pub fn is_rsptyp_0(&self) -> bool {
        *self == Rsptyp::Rsptyp0
    }
    #[doc = "Response Length 136"]
    #[inline(always)]
    pub fn is_rsptyp_1(&self) -> bool {
        *self == Rsptyp::Rsptyp1
    }
    #[doc = "Response Length 48"]
    #[inline(always)]
    pub fn is_rsptyp_2(&self) -> bool {
        *self == Rsptyp::Rsptyp2
    }
    #[doc = "Response Length 48, check Busy after response"]
    #[inline(always)]
    pub fn is_rsptyp_3(&self) -> bool {
        *self == Rsptyp::Rsptyp3
    }
}
#[doc = "Field `RSPTYP` writer - Response Type Select"]
pub type RsptypW<'a, REG> = crate::FieldWriter<'a, REG, 2, Rsptyp, crate::Safe>;
impl<'a, REG> RsptypW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "No Response"]
    #[inline(always)]
    pub fn rsptyp_0(self) -> &'a mut crate::W<REG> {
        self.variant(Rsptyp::Rsptyp0)
    }
    #[doc = "Response Length 136"]
    #[inline(always)]
    pub fn rsptyp_1(self) -> &'a mut crate::W<REG> {
        self.variant(Rsptyp::Rsptyp1)
    }
    #[doc = "Response Length 48"]
    #[inline(always)]
    pub fn rsptyp_2(self) -> &'a mut crate::W<REG> {
        self.variant(Rsptyp::Rsptyp2)
    }
    #[doc = "Response Length 48, check Busy after response"]
    #[inline(always)]
    pub fn rsptyp_3(self) -> &'a mut crate::W<REG> {
        self.variant(Rsptyp::Rsptyp3)
    }
}
#[doc = "Command CRC Check Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cccen {
    #[doc = "0: Disable"]
    Cccen0 = 0,
    #[doc = "1: Enable"]
    Cccen1 = 1,
}
impl From<Cccen> for bool {
    #[inline(always)]
    fn from(variant: Cccen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CCCEN` reader - Command CRC Check Enable"]
pub type CccenR = crate::BitReader<Cccen>;
impl CccenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cccen {
        match self.bits {
            false => Cccen::Cccen0,
            true => Cccen::Cccen1,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_cccen_0(&self) -> bool {
        *self == Cccen::Cccen0
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_cccen_1(&self) -> bool {
        *self == Cccen::Cccen1
    }
}
#[doc = "Field `CCCEN` writer - Command CRC Check Enable"]
pub type CccenW<'a, REG> = crate::BitWriter<'a, REG, Cccen>;
impl<'a, REG> CccenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn cccen_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cccen::Cccen0)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn cccen_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cccen::Cccen1)
    }
}
#[doc = "Command Index Check Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cicen {
    #[doc = "0: Disable"]
    Cicen0 = 0,
    #[doc = "1: Enable"]
    Cicen1 = 1,
}
impl From<Cicen> for bool {
    #[inline(always)]
    fn from(variant: Cicen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CICEN` reader - Command Index Check Enable"]
pub type CicenR = crate::BitReader<Cicen>;
impl CicenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cicen {
        match self.bits {
            false => Cicen::Cicen0,
            true => Cicen::Cicen1,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_cicen_0(&self) -> bool {
        *self == Cicen::Cicen0
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_cicen_1(&self) -> bool {
        *self == Cicen::Cicen1
    }
}
#[doc = "Field `CICEN` writer - Command Index Check Enable"]
pub type CicenW<'a, REG> = crate::BitWriter<'a, REG, Cicen>;
impl<'a, REG> CicenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn cicen_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cicen::Cicen0)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn cicen_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cicen::Cicen1)
    }
}
#[doc = "Data Present Select\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dpsel {
    #[doc = "0: No Data Present"]
    Dpsel0 = 0,
    #[doc = "1: Data Present"]
    Dpsel1 = 1,
}
impl From<Dpsel> for bool {
    #[inline(always)]
    fn from(variant: Dpsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DPSEL` reader - Data Present Select"]
pub type DpselR = crate::BitReader<Dpsel>;
impl DpselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dpsel {
        match self.bits {
            false => Dpsel::Dpsel0,
            true => Dpsel::Dpsel1,
        }
    }
    #[doc = "No Data Present"]
    #[inline(always)]
    pub fn is_dpsel_0(&self) -> bool {
        *self == Dpsel::Dpsel0
    }
    #[doc = "Data Present"]
    #[inline(always)]
    pub fn is_dpsel_1(&self) -> bool {
        *self == Dpsel::Dpsel1
    }
}
#[doc = "Field `DPSEL` writer - Data Present Select"]
pub type DpselW<'a, REG> = crate::BitWriter<'a, REG, Dpsel>;
impl<'a, REG> DpselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No Data Present"]
    #[inline(always)]
    pub fn dpsel_0(self) -> &'a mut crate::W<REG> {
        self.variant(Dpsel::Dpsel0)
    }
    #[doc = "Data Present"]
    #[inline(always)]
    pub fn dpsel_1(self) -> &'a mut crate::W<REG> {
        self.variant(Dpsel::Dpsel1)
    }
}
#[doc = "Command Type\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cmdtyp {
    #[doc = "0: Normal Other commands"]
    Cmdtyp0 = 0,
    #[doc = "1: Suspend CMD52 for writing Bus Suspend in CCCR"]
    Cmdtyp1 = 1,
    #[doc = "2: Resume CMD52 for writing Function Select in CCCR"]
    Cmdtyp2 = 2,
    #[doc = "3: Abort CMD12, CMD52 for writing I/O Abort in CCCR"]
    Cmdtyp3 = 3,
}
impl From<Cmdtyp> for u8 {
    #[inline(always)]
    fn from(variant: Cmdtyp) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cmdtyp {
    type Ux = u8;
}
impl crate::IsEnum for Cmdtyp {}
#[doc = "Field `CMDTYP` reader - Command Type"]
pub type CmdtypR = crate::FieldReader<Cmdtyp>;
impl CmdtypR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmdtyp {
        match self.bits {
            0 => Cmdtyp::Cmdtyp0,
            1 => Cmdtyp::Cmdtyp1,
            2 => Cmdtyp::Cmdtyp2,
            3 => Cmdtyp::Cmdtyp3,
            _ => unreachable!(),
        }
    }
    #[doc = "Normal Other commands"]
    #[inline(always)]
    pub fn is_cmdtyp_0(&self) -> bool {
        *self == Cmdtyp::Cmdtyp0
    }
    #[doc = "Suspend CMD52 for writing Bus Suspend in CCCR"]
    #[inline(always)]
    pub fn is_cmdtyp_1(&self) -> bool {
        *self == Cmdtyp::Cmdtyp1
    }
    #[doc = "Resume CMD52 for writing Function Select in CCCR"]
    #[inline(always)]
    pub fn is_cmdtyp_2(&self) -> bool {
        *self == Cmdtyp::Cmdtyp2
    }
    #[doc = "Abort CMD12, CMD52 for writing I/O Abort in CCCR"]
    #[inline(always)]
    pub fn is_cmdtyp_3(&self) -> bool {
        *self == Cmdtyp::Cmdtyp3
    }
}
#[doc = "Field `CMDTYP` writer - Command Type"]
pub type CmdtypW<'a, REG> = crate::FieldWriter<'a, REG, 2, Cmdtyp, crate::Safe>;
impl<'a, REG> CmdtypW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Normal Other commands"]
    #[inline(always)]
    pub fn cmdtyp_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmdtyp::Cmdtyp0)
    }
    #[doc = "Suspend CMD52 for writing Bus Suspend in CCCR"]
    #[inline(always)]
    pub fn cmdtyp_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmdtyp::Cmdtyp1)
    }
    #[doc = "Resume CMD52 for writing Function Select in CCCR"]
    #[inline(always)]
    pub fn cmdtyp_2(self) -> &'a mut crate::W<REG> {
        self.variant(Cmdtyp::Cmdtyp2)
    }
    #[doc = "Abort CMD12, CMD52 for writing I/O Abort in CCCR"]
    #[inline(always)]
    pub fn cmdtyp_3(self) -> &'a mut crate::W<REG> {
        self.variant(Cmdtyp::Cmdtyp3)
    }
}
#[doc = "Field `CMDINX` reader - Command Index"]
pub type CmdinxR = crate::FieldReader;
#[doc = "Field `CMDINX` writer - Command Index"]
pub type CmdinxW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
impl R {
    #[doc = "Bits 16:17 - Response Type Select"]
    #[inline(always)]
    pub fn rsptyp(&self) -> RsptypR {
        RsptypR::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bit 19 - Command CRC Check Enable"]
    #[inline(always)]
    pub fn cccen(&self) -> CccenR {
        CccenR::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - Command Index Check Enable"]
    #[inline(always)]
    pub fn cicen(&self) -> CicenR {
        CicenR::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Data Present Select"]
    #[inline(always)]
    pub fn dpsel(&self) -> DpselR {
        DpselR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 22:23 - Command Type"]
    #[inline(always)]
    pub fn cmdtyp(&self) -> CmdtypR {
        CmdtypR::new(((self.bits >> 22) & 3) as u8)
    }
    #[doc = "Bits 24:29 - Command Index"]
    #[inline(always)]
    pub fn cmdinx(&self) -> CmdinxR {
        CmdinxR::new(((self.bits >> 24) & 0x3f) as u8)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CMD_XFR_TYP")
            .field("rsptyp", &self.rsptyp())
            .field("cccen", &self.cccen())
            .field("cicen", &self.cicen())
            .field("dpsel", &self.dpsel())
            .field("cmdtyp", &self.cmdtyp())
            .field("cmdinx", &self.cmdinx())
            .finish()
    }
}
impl W {
    #[doc = "Bits 16:17 - Response Type Select"]
    #[inline(always)]
    pub fn rsptyp(&mut self) -> RsptypW<CmdXfrTypSpec> {
        RsptypW::new(self, 16)
    }
    #[doc = "Bit 19 - Command CRC Check Enable"]
    #[inline(always)]
    pub fn cccen(&mut self) -> CccenW<CmdXfrTypSpec> {
        CccenW::new(self, 19)
    }
    #[doc = "Bit 20 - Command Index Check Enable"]
    #[inline(always)]
    pub fn cicen(&mut self) -> CicenW<CmdXfrTypSpec> {
        CicenW::new(self, 20)
    }
    #[doc = "Bit 21 - Data Present Select"]
    #[inline(always)]
    pub fn dpsel(&mut self) -> DpselW<CmdXfrTypSpec> {
        DpselW::new(self, 21)
    }
    #[doc = "Bits 22:23 - Command Type"]
    #[inline(always)]
    pub fn cmdtyp(&mut self) -> CmdtypW<CmdXfrTypSpec> {
        CmdtypW::new(self, 22)
    }
    #[doc = "Bits 24:29 - Command Index"]
    #[inline(always)]
    pub fn cmdinx(&mut self) -> CmdinxW<CmdXfrTypSpec> {
        CmdinxW::new(self, 24)
    }
}
#[doc = "Command Transfer Type\n\nYou can [`read`](crate::Reg::read) this register and get [`cmd_xfr_typ::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmd_xfr_typ::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CmdXfrTypSpec;
impl crate::RegisterSpec for CmdXfrTypSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`cmd_xfr_typ::R`](R) reader structure"]
impl crate::Readable for CmdXfrTypSpec {}
#[doc = "`write(|w| ..)` method takes [`cmd_xfr_typ::W`](W) writer structure"]
impl crate::Writable for CmdXfrTypSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CMD_XFR_TYP to value 0"]
impl crate::Resettable for CmdXfrTypSpec {
    const RESET_VALUE: u32 = 0;
}