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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
#[doc = "Register `SCAPABILITIES` reader"]
pub type R = crate::R<ScapabilitiesSpec>;
#[doc = "ID 48b handler\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Idena {
    #[doc = "0: APPLICATION: Application handles ID 48b"]
    Application = 0,
    #[doc = "1: HW: Hardware handles ID 48b"]
    Hw = 1,
    #[doc = "2: HW_BUT: in hardware but the I3C module instance handles ID 48b."]
    HwBut = 2,
    #[doc = "3: PARTNO: a part number register (PARTNO) handles ID 48b"]
    Partno = 3,
}
impl From<Idena> for u8 {
    #[inline(always)]
    fn from(variant: Idena) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Idena {
    type Ux = u8;
}
impl crate::IsEnum for Idena {}
#[doc = "Field `IDENA` reader - ID 48b handler"]
pub type IdenaR = crate::FieldReader<Idena>;
impl IdenaR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Idena {
        match self.bits {
            0 => Idena::Application,
            1 => Idena::Hw,
            2 => Idena::HwBut,
            3 => Idena::Partno,
            _ => unreachable!(),
        }
    }
    #[doc = "APPLICATION: Application handles ID 48b"]
    #[inline(always)]
    pub fn is_application(&self) -> bool {
        *self == Idena::Application
    }
    #[doc = "HW: Hardware handles ID 48b"]
    #[inline(always)]
    pub fn is_hw(&self) -> bool {
        *self == Idena::Hw
    }
    #[doc = "HW_BUT: in hardware but the I3C module instance handles ID 48b."]
    #[inline(always)]
    pub fn is_hw_but(&self) -> bool {
        *self == Idena::HwBut
    }
    #[doc = "PARTNO: a part number register (PARTNO) handles ID 48b"]
    #[inline(always)]
    pub fn is_partno(&self) -> bool {
        *self == Idena::Partno
    }
}
#[doc = "Field `IDREG` reader - ID register"]
pub type IdregR = crate::FieldReader;
#[doc = "Field `HDRSUPP` reader - HDR support"]
pub type HdrsuppR = crate::FieldReader;
#[doc = "Master\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Master {
    #[doc = "0: MASTERNOTSUPPORTED: master capability is not supported."]
    Masternotsupported = 0,
    #[doc = "1: MASTERSUPPORTED: master capability is supported."]
    Mastersupported = 1,
}
impl From<Master> for bool {
    #[inline(always)]
    fn from(variant: Master) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MASTER` reader - Master"]
pub type MasterR = crate::BitReader<Master>;
impl MasterR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Master {
        match self.bits {
            false => Master::Masternotsupported,
            true => Master::Mastersupported,
        }
    }
    #[doc = "MASTERNOTSUPPORTED: master capability is not supported."]
    #[inline(always)]
    pub fn is_masternotsupported(&self) -> bool {
        *self == Master::Masternotsupported
    }
    #[doc = "MASTERSUPPORTED: master capability is supported."]
    #[inline(always)]
    pub fn is_mastersupported(&self) -> bool {
        *self == Master::Mastersupported
    }
}
#[doc = "Static address\n\nValue on reset: 3"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Saddr {
    #[doc = "0: NO_STATIC: No static address"]
    NoStatic = 0,
    #[doc = "1: STATIC: Static address is fixed in hardware"]
    Static = 1,
    #[doc = "2: HW_CONTROL: Hardware controls the static address dynamically (for example, from the pin strap)"]
    HwControl = 2,
    #[doc = "3: CONFIG: SCONFIG register supplies the static address"]
    Config = 3,
}
impl From<Saddr> for u8 {
    #[inline(always)]
    fn from(variant: Saddr) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Saddr {
    type Ux = u8;
}
impl crate::IsEnum for Saddr {}
#[doc = "Field `SADDR` reader - Static address"]
pub type SaddrR = crate::FieldReader<Saddr>;
impl SaddrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Saddr {
        match self.bits {
            0 => Saddr::NoStatic,
            1 => Saddr::Static,
            2 => Saddr::HwControl,
            3 => Saddr::Config,
            _ => unreachable!(),
        }
    }
    #[doc = "NO_STATIC: No static address"]
    #[inline(always)]
    pub fn is_no_static(&self) -> bool {
        *self == Saddr::NoStatic
    }
    #[doc = "STATIC: Static address is fixed in hardware"]
    #[inline(always)]
    pub fn is_static(&self) -> bool {
        *self == Saddr::Static
    }
    #[doc = "HW_CONTROL: Hardware controls the static address dynamically (for example, from the pin strap)"]
    #[inline(always)]
    pub fn is_hw_control(&self) -> bool {
        *self == Saddr::HwControl
    }
    #[doc = "CONFIG: SCONFIG register supplies the static address"]
    #[inline(always)]
    pub fn is_config(&self) -> bool {
        *self == Saddr::Config
    }
}
#[doc = "Field `CCCHANDLE` reader - Common Command Codes (CCC) handling"]
pub type CcchandleR = crate::FieldReader;
#[doc = "Field `IBI_MR_HJ` reader - In-Band Interrupts, Master Requests, Hot Join events"]
pub type IbiMrHjR = crate::FieldReader;
#[doc = "Time control\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Timectrl {
    #[doc = "0: NO_TIME_CONTROL_TYPE: No time control is enabled"]
    NoTimeControlType = 0,
    #[doc = "1: ATLEAST1_TIME_CONTROL: at least one time-control type is supported"]
    Atleast1TimeControl = 1,
}
impl From<Timectrl> for bool {
    #[inline(always)]
    fn from(variant: Timectrl) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TIMECTRL` reader - Time control"]
pub type TimectrlR = crate::BitReader<Timectrl>;
impl TimectrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Timectrl {
        match self.bits {
            false => Timectrl::NoTimeControlType,
            true => Timectrl::Atleast1TimeControl,
        }
    }
    #[doc = "NO_TIME_CONTROL_TYPE: No time control is enabled"]
    #[inline(always)]
    pub fn is_no_time_control_type(&self) -> bool {
        *self == Timectrl::NoTimeControlType
    }
    #[doc = "ATLEAST1_TIME_CONTROL: at least one time-control type is supported"]
    #[inline(always)]
    pub fn is_atleast1_time_control(&self) -> bool {
        *self == Timectrl::Atleast1TimeControl
    }
}
#[doc = "External FIFO\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Extfifo {
    #[doc = "1: STD_EXT_FIFO: standard available/free external FIFO"]
    StdExtFifo = 1,
}
impl From<Extfifo> for u8 {
    #[inline(always)]
    fn from(variant: Extfifo) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Extfifo {
    type Ux = u8;
}
impl crate::IsEnum for Extfifo {}
#[doc = "Field `EXTFIFO` reader - External FIFO"]
pub type ExtfifoR = crate::FieldReader<Extfifo>;
impl ExtfifoR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Extfifo> {
        match self.bits {
            1 => Some(Extfifo::StdExtFifo),
            _ => None,
        }
    }
    #[doc = "STD_EXT_FIFO: standard available/free external FIFO"]
    #[inline(always)]
    pub fn is_std_ext_fifo(&self) -> bool {
        *self == Extfifo::StdExtFifo
    }
}
#[doc = "FIFO transmit\n\nValue on reset: 2"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Fifotx {
    #[doc = "0: FIFO_2BYTE: 2-byte TX FIFO, the default FIFO transmit value (FIFOTX)"]
    Fifo2byte = 0,
    #[doc = "1: FIFO_4BYTE: 4-byte TX FIFO"]
    Fifo4byte = 1,
    #[doc = "2: FIFO_8BYTE: 8-byte TX FIFO"]
    Fifo8byte = 2,
    #[doc = "3: FIFO_16BYTE: 16-byte TX FIFO"]
    Fifo16byte = 3,
}
impl From<Fifotx> for u8 {
    #[inline(always)]
    fn from(variant: Fifotx) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Fifotx {
    type Ux = u8;
}
impl crate::IsEnum for Fifotx {}
#[doc = "Field `FIFOTX` reader - FIFO transmit"]
pub type FifotxR = crate::FieldReader<Fifotx>;
impl FifotxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fifotx {
        match self.bits {
            0 => Fifotx::Fifo2byte,
            1 => Fifotx::Fifo4byte,
            2 => Fifotx::Fifo8byte,
            3 => Fifotx::Fifo16byte,
            _ => unreachable!(),
        }
    }
    #[doc = "FIFO_2BYTE: 2-byte TX FIFO, the default FIFO transmit value (FIFOTX)"]
    #[inline(always)]
    pub fn is_fifo_2byte(&self) -> bool {
        *self == Fifotx::Fifo2byte
    }
    #[doc = "FIFO_4BYTE: 4-byte TX FIFO"]
    #[inline(always)]
    pub fn is_fifo_4byte(&self) -> bool {
        *self == Fifotx::Fifo4byte
    }
    #[doc = "FIFO_8BYTE: 8-byte TX FIFO"]
    #[inline(always)]
    pub fn is_fifo_8byte(&self) -> bool {
        *self == Fifotx::Fifo8byte
    }
    #[doc = "FIFO_16BYTE: 16-byte TX FIFO"]
    #[inline(always)]
    pub fn is_fifo_16byte(&self) -> bool {
        *self == Fifotx::Fifo16byte
    }
}
#[doc = "FIFO receive\n\nValue on reset: 2"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Fiforx {
    #[doc = "0: FIFO_2BYTE: 2 (or 3)-byte RX FIFO, the default FIFO receive value (FIFORX)"]
    Fifo2byte = 0,
    #[doc = "1: FIFO_4BYTE: 4-byte RX FIFO"]
    Fifo4byte = 1,
    #[doc = "2: FIFO_8BYTE: 8-byte RX FIFO"]
    Fifo8byte = 2,
    #[doc = "3: FIFO_16BYTE: 16-byte RX FIFO"]
    Fifo16byte = 3,
}
impl From<Fiforx> for u8 {
    #[inline(always)]
    fn from(variant: Fiforx) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Fiforx {
    type Ux = u8;
}
impl crate::IsEnum for Fiforx {}
#[doc = "Field `FIFORX` reader - FIFO receive"]
pub type FiforxR = crate::FieldReader<Fiforx>;
impl FiforxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fiforx {
        match self.bits {
            0 => Fiforx::Fifo2byte,
            1 => Fiforx::Fifo4byte,
            2 => Fiforx::Fifo8byte,
            3 => Fiforx::Fifo16byte,
            _ => unreachable!(),
        }
    }
    #[doc = "FIFO_2BYTE: 2 (or 3)-byte RX FIFO, the default FIFO receive value (FIFORX)"]
    #[inline(always)]
    pub fn is_fifo_2byte(&self) -> bool {
        *self == Fiforx::Fifo2byte
    }
    #[doc = "FIFO_4BYTE: 4-byte RX FIFO"]
    #[inline(always)]
    pub fn is_fifo_4byte(&self) -> bool {
        *self == Fiforx::Fifo4byte
    }
    #[doc = "FIFO_8BYTE: 8-byte RX FIFO"]
    #[inline(always)]
    pub fn is_fifo_8byte(&self) -> bool {
        *self == Fiforx::Fifo8byte
    }
    #[doc = "FIFO_16BYTE: 16-byte RX FIFO"]
    #[inline(always)]
    pub fn is_fifo_16byte(&self) -> bool {
        *self == Fiforx::Fifo16byte
    }
}
#[doc = "INT\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Int {
    #[doc = "0: Interrupts are not supported"]
    Interruptsno = 0,
    #[doc = "1: Interrupts are supported"]
    Interruptsyes = 1,
}
impl From<Int> for bool {
    #[inline(always)]
    fn from(variant: Int) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INT` reader - INT"]
pub type IntR = crate::BitReader<Int>;
impl IntR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Int {
        match self.bits {
            false => Int::Interruptsno,
            true => Int::Interruptsyes,
        }
    }
    #[doc = "Interrupts are not supported"]
    #[inline(always)]
    pub fn is_interruptsno(&self) -> bool {
        *self == Int::Interruptsno
    }
    #[doc = "Interrupts are supported"]
    #[inline(always)]
    pub fn is_interruptsyes(&self) -> bool {
        *self == Int::Interruptsyes
    }
}
#[doc = "DMA\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dma {
    #[doc = "0: DMA is not supported"]
    Dmano = 0,
    #[doc = "1: DMA is supported"]
    Dmayes = 1,
}
impl From<Dma> for bool {
    #[inline(always)]
    fn from(variant: Dma) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DMA` reader - DMA"]
pub type DmaR = crate::BitReader<Dma>;
impl DmaR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dma {
        match self.bits {
            false => Dma::Dmano,
            true => Dma::Dmayes,
        }
    }
    #[doc = "DMA is not supported"]
    #[inline(always)]
    pub fn is_dmano(&self) -> bool {
        *self == Dma::Dmano
    }
    #[doc = "DMA is supported"]
    #[inline(always)]
    pub fn is_dmayes(&self) -> bool {
        *self == Dma::Dmayes
    }
}
impl R {
    #[doc = "Bits 0:1 - ID 48b handler"]
    #[inline(always)]
    pub fn idena(&self) -> IdenaR {
        IdenaR::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 2:5 - ID register"]
    #[inline(always)]
    pub fn idreg(&self) -> IdregR {
        IdregR::new(((self.bits >> 2) & 0x0f) as u8)
    }
    #[doc = "Bits 6:8 - HDR support"]
    #[inline(always)]
    pub fn hdrsupp(&self) -> HdrsuppR {
        HdrsuppR::new(((self.bits >> 6) & 7) as u8)
    }
    #[doc = "Bit 9 - Master"]
    #[inline(always)]
    pub fn master(&self) -> MasterR {
        MasterR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bits 10:11 - Static address"]
    #[inline(always)]
    pub fn saddr(&self) -> SaddrR {
        SaddrR::new(((self.bits >> 10) & 3) as u8)
    }
    #[doc = "Bits 12:15 - Common Command Codes (CCC) handling"]
    #[inline(always)]
    pub fn ccchandle(&self) -> CcchandleR {
        CcchandleR::new(((self.bits >> 12) & 0x0f) as u8)
    }
    #[doc = "Bits 16:20 - In-Band Interrupts, Master Requests, Hot Join events"]
    #[inline(always)]
    pub fn ibi_mr_hj(&self) -> IbiMrHjR {
        IbiMrHjR::new(((self.bits >> 16) & 0x1f) as u8)
    }
    #[doc = "Bit 21 - Time control"]
    #[inline(always)]
    pub fn timectrl(&self) -> TimectrlR {
        TimectrlR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 23:25 - External FIFO"]
    #[inline(always)]
    pub fn extfifo(&self) -> ExtfifoR {
        ExtfifoR::new(((self.bits >> 23) & 7) as u8)
    }
    #[doc = "Bits 26:27 - FIFO transmit"]
    #[inline(always)]
    pub fn fifotx(&self) -> FifotxR {
        FifotxR::new(((self.bits >> 26) & 3) as u8)
    }
    #[doc = "Bits 28:29 - FIFO receive"]
    #[inline(always)]
    pub fn fiforx(&self) -> FiforxR {
        FiforxR::new(((self.bits >> 28) & 3) as u8)
    }
    #[doc = "Bit 30 - INT"]
    #[inline(always)]
    pub fn int(&self) -> IntR {
        IntR::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - DMA"]
    #[inline(always)]
    pub fn dma(&self) -> DmaR {
        DmaR::new(((self.bits >> 31) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("SCAPABILITIES")
            .field("idena", &self.idena())
            .field("idreg", &self.idreg())
            .field("hdrsupp", &self.hdrsupp())
            .field("master", &self.master())
            .field("saddr", &self.saddr())
            .field("ccchandle", &self.ccchandle())
            .field("ibi_mr_hj", &self.ibi_mr_hj())
            .field("timectrl", &self.timectrl())
            .field("extfifo", &self.extfifo())
            .field("fifotx", &self.fifotx())
            .field("fiforx", &self.fiforx())
            .field("int", &self.int())
            .field("dma", &self.dma())
            .finish()
    }
}
#[doc = "Slave Capabilities Register\n\nYou can [`read`](crate::Reg::read) this register and get [`scapabilities::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ScapabilitiesSpec;
impl crate::RegisterSpec for ScapabilitiesSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`scapabilities::R`](R) reader structure"]
impl crate::Readable for ScapabilitiesSpec {}
#[doc = "`reset()` method sets SCAPABILITIES to value 0xe83f_fe78"]
impl crate::Resettable for ScapabilitiesSpec {
    const RESET_VALUE: u32 = 0xe83f_fe78;
}