mimxrt595s 0.5.0

Peripheral access crate (PAC) for NXP i.MX RT595S microcontrollers
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
#[doc = "Register `SSTATUS` reader"]
pub struct R(crate::R<SSTATUS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SSTATUS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SSTATUS_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SSTATUS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SSTATUS` writer"]
pub struct W(crate::W<SSTATUS_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SSTATUS_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<SSTATUS_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SSTATUS_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `STNOTSTOP` reader - Status not stop"]
pub type STNOTSTOP_R = crate::BitReader<bool>;
#[doc = "Field `STMSG` reader - Status message"]
pub type STMSG_R = crate::BitReader<bool>;
#[doc = "Field `STCCCH` reader - Status Common Command Code Handler"]
pub type STCCCH_R = crate::BitReader<bool>;
#[doc = "Field `STREQRD` reader - Status required"]
pub type STREQRD_R = crate::BitReader<bool>;
#[doc = "Field `STREQWR` reader - Status request write"]
pub type STREQWR_R = crate::BitReader<bool>;
#[doc = "Field `STDAA` reader - Status Dynamic Address Assignment"]
pub type STDAA_R = crate::BitReader<bool>;
#[doc = "Field `STHDR` reader - Status High Data Rate"]
pub type STHDR_R = crate::BitReader<bool>;
#[doc = "Field `START` reader - Start"]
pub type START_R = crate::BitReader<bool>;
#[doc = "Field `START` writer - Start"]
pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `MATCHED` reader - Matched"]
pub type MATCHED_R = crate::BitReader<bool>;
#[doc = "Field `MATCHED` writer - Matched"]
pub type MATCHED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `STOP` reader - Stop"]
pub type STOP_R = crate::BitReader<bool>;
#[doc = "Field `STOP` writer - Stop"]
pub type STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `RX_PEND` reader - Received message pending"]
pub type RX_PEND_R = crate::BitReader<bool>;
#[doc = "Field `TXNOTFULL` reader - Transmit buffer is not full"]
pub type TXNOTFULL_R = crate::BitReader<bool>;
#[doc = "Field `DACHG` reader - DACHG"]
pub type DACHG_R = crate::BitReader<bool>;
#[doc = "Field `DACHG` writer - DACHG"]
pub type DACHG_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `CCC` reader - Common Command Code"]
pub type CCC_R = crate::BitReader<bool>;
#[doc = "Field `CCC` writer - Common Command Code"]
pub type CCC_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `ERRWARN` reader - Error warning"]
pub type ERRWARN_R = crate::BitReader<bool>;
#[doc = "Field `HDRMATCH` reader - High Data Rate command match"]
pub type HDRMATCH_R = crate::BitReader<bool>;
#[doc = "Field `HDRMATCH` writer - High Data Rate command match"]
pub type HDRMATCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `CHANDLED` reader - Common-Command-Code handled"]
pub type CHANDLED_R = crate::BitReader<bool>;
#[doc = "Field `CHANDLED` writer - Common-Command-Code handled"]
pub type CHANDLED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `EVENT` reader - Event"]
pub type EVENT_R = crate::BitReader<bool>;
#[doc = "Field `EVENT` writer - Event"]
pub type EVENT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSTATUS_SPEC, bool, O>;
#[doc = "Field `EVDET` reader - Event details"]
pub type EVDET_R = crate::FieldReader<u8, EVDET_A>;
#[doc = "Event details\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EVDET_A {
    #[doc = "0: NONE"]
    NONE = 0,
    #[doc = "1: NO_REQUEST"]
    NO_REQUEST = 1,
    #[doc = "2: NACKED"]
    NACKED = 2,
    #[doc = "3: ACKED"]
    ACKED = 3,
}
impl From<EVDET_A> for u8 {
    #[inline(always)]
    fn from(variant: EVDET_A) -> Self {
        variant as _
    }
}
impl EVDET_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EVDET_A {
        match self.bits {
            0 => EVDET_A::NONE,
            1 => EVDET_A::NO_REQUEST,
            2 => EVDET_A::NACKED,
            3 => EVDET_A::ACKED,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `NONE`"]
    #[inline(always)]
    pub fn is_none(&self) -> bool {
        *self == EVDET_A::NONE
    }
    #[doc = "Checks if the value of the field is `NO_REQUEST`"]
    #[inline(always)]
    pub fn is_no_request(&self) -> bool {
        *self == EVDET_A::NO_REQUEST
    }
    #[doc = "Checks if the value of the field is `NACKED`"]
    #[inline(always)]
    pub fn is_nacked(&self) -> bool {
        *self == EVDET_A::NACKED
    }
    #[doc = "Checks if the value of the field is `ACKED`"]
    #[inline(always)]
    pub fn is_acked(&self) -> bool {
        *self == EVDET_A::ACKED
    }
}
#[doc = "Field `IBIDIS` reader - In-Band Interrupts are disabled"]
pub type IBIDIS_R = crate::BitReader<bool>;
#[doc = "Field `MRDIS` reader - Master requests are disabled"]
pub type MRDIS_R = crate::BitReader<bool>;
#[doc = "Field `HJDIS` reader - Hot-Join is disabled"]
pub type HJDIS_R = crate::BitReader<bool>;
#[doc = "Field `ACTSTATE` reader - Activity state from Common Command Codes (CCC)"]
pub type ACTSTATE_R = crate::FieldReader<u8, ACTSTATE_A>;
#[doc = "Activity state from Common Command Codes (CCC)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ACTSTATE_A {
    #[doc = "0: NO_LATENCY"]
    NO_LATENCY = 0,
    #[doc = "1: LATENCY_1MS"]
    LATENCY_1MS = 1,
    #[doc = "2: LATENCY_100MS"]
    LATENCY_100MS = 2,
    #[doc = "3: LATENCY_10S"]
    LATENCY_10S = 3,
}
impl From<ACTSTATE_A> for u8 {
    #[inline(always)]
    fn from(variant: ACTSTATE_A) -> Self {
        variant as _
    }
}
impl ACTSTATE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ACTSTATE_A {
        match self.bits {
            0 => ACTSTATE_A::NO_LATENCY,
            1 => ACTSTATE_A::LATENCY_1MS,
            2 => ACTSTATE_A::LATENCY_100MS,
            3 => ACTSTATE_A::LATENCY_10S,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `NO_LATENCY`"]
    #[inline(always)]
    pub fn is_no_latency(&self) -> bool {
        *self == ACTSTATE_A::NO_LATENCY
    }
    #[doc = "Checks if the value of the field is `LATENCY_1MS`"]
    #[inline(always)]
    pub fn is_latency_1ms(&self) -> bool {
        *self == ACTSTATE_A::LATENCY_1MS
    }
    #[doc = "Checks if the value of the field is `LATENCY_100MS`"]
    #[inline(always)]
    pub fn is_latency_100ms(&self) -> bool {
        *self == ACTSTATE_A::LATENCY_100MS
    }
    #[doc = "Checks if the value of the field is `LATENCY_10S`"]
    #[inline(always)]
    pub fn is_latency_10s(&self) -> bool {
        *self == ACTSTATE_A::LATENCY_10S
    }
}
#[doc = "Field `TIMECTRL` reader - Time control"]
pub type TIMECTRL_R = crate::FieldReader<u8, TIMECTRL_A>;
#[doc = "Time control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TIMECTRL_A {
    #[doc = "0: NO_TIME_CONTROL"]
    NO_TIME_CONTROL = 0,
    #[doc = "2: ASYNC_MODE"]
    ASYNC_MODE = 2,
}
impl From<TIMECTRL_A> for u8 {
    #[inline(always)]
    fn from(variant: TIMECTRL_A) -> Self {
        variant as _
    }
}
impl TIMECTRL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<TIMECTRL_A> {
        match self.bits {
            0 => Some(TIMECTRL_A::NO_TIME_CONTROL),
            2 => Some(TIMECTRL_A::ASYNC_MODE),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `NO_TIME_CONTROL`"]
    #[inline(always)]
    pub fn is_no_time_control(&self) -> bool {
        *self == TIMECTRL_A::NO_TIME_CONTROL
    }
    #[doc = "Checks if the value of the field is `ASYNC_MODE`"]
    #[inline(always)]
    pub fn is_async_mode(&self) -> bool {
        *self == TIMECTRL_A::ASYNC_MODE
    }
}
impl R {
    #[doc = "Bit 0 - Status not stop"]
    #[inline(always)]
    pub fn stnotstop(&self) -> STNOTSTOP_R {
        STNOTSTOP_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Status message"]
    #[inline(always)]
    pub fn stmsg(&self) -> STMSG_R {
        STMSG_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Status Common Command Code Handler"]
    #[inline(always)]
    pub fn stccch(&self) -> STCCCH_R {
        STCCCH_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Status required"]
    #[inline(always)]
    pub fn streqrd(&self) -> STREQRD_R {
        STREQRD_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Status request write"]
    #[inline(always)]
    pub fn streqwr(&self) -> STREQWR_R {
        STREQWR_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Status Dynamic Address Assignment"]
    #[inline(always)]
    pub fn stdaa(&self) -> STDAA_R {
        STDAA_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Status High Data Rate"]
    #[inline(always)]
    pub fn sthdr(&self) -> STHDR_R {
        STHDR_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 8 - Start"]
    #[inline(always)]
    pub fn start(&self) -> START_R {
        START_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Matched"]
    #[inline(always)]
    pub fn matched(&self) -> MATCHED_R {
        MATCHED_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Stop"]
    #[inline(always)]
    pub fn stop(&self) -> STOP_R {
        STOP_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Received message pending"]
    #[inline(always)]
    pub fn rx_pend(&self) -> RX_PEND_R {
        RX_PEND_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Transmit buffer is not full"]
    #[inline(always)]
    pub fn txnotfull(&self) -> TXNOTFULL_R {
        TXNOTFULL_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - DACHG"]
    #[inline(always)]
    pub fn dachg(&self) -> DACHG_R {
        DACHG_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Common Command Code"]
    #[inline(always)]
    pub fn ccc(&self) -> CCC_R {
        CCC_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Error warning"]
    #[inline(always)]
    pub fn errwarn(&self) -> ERRWARN_R {
        ERRWARN_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 16 - High Data Rate command match"]
    #[inline(always)]
    pub fn hdrmatch(&self) -> HDRMATCH_R {
        HDRMATCH_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Common-Command-Code handled"]
    #[inline(always)]
    pub fn chandled(&self) -> CHANDLED_R {
        CHANDLED_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Event"]
    #[inline(always)]
    pub fn event(&self) -> EVENT_R {
        EVENT_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bits 20:21 - Event details"]
    #[inline(always)]
    pub fn evdet(&self) -> EVDET_R {
        EVDET_R::new(((self.bits >> 20) & 3) as u8)
    }
    #[doc = "Bit 24 - In-Band Interrupts are disabled"]
    #[inline(always)]
    pub fn ibidis(&self) -> IBIDIS_R {
        IBIDIS_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - Master requests are disabled"]
    #[inline(always)]
    pub fn mrdis(&self) -> MRDIS_R {
        MRDIS_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 27 - Hot-Join is disabled"]
    #[inline(always)]
    pub fn hjdis(&self) -> HJDIS_R {
        HJDIS_R::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bits 28:29 - Activity state from Common Command Codes (CCC)"]
    #[inline(always)]
    pub fn actstate(&self) -> ACTSTATE_R {
        ACTSTATE_R::new(((self.bits >> 28) & 3) as u8)
    }
    #[doc = "Bits 30:31 - Time control"]
    #[inline(always)]
    pub fn timectrl(&self) -> TIMECTRL_R {
        TIMECTRL_R::new(((self.bits >> 30) & 3) as u8)
    }
}
impl W {
    #[doc = "Bit 8 - Start"]
    #[inline(always)]
    #[must_use]
    pub fn start(&mut self) -> START_W<8> {
        START_W::new(self)
    }
    #[doc = "Bit 9 - Matched"]
    #[inline(always)]
    #[must_use]
    pub fn matched(&mut self) -> MATCHED_W<9> {
        MATCHED_W::new(self)
    }
    #[doc = "Bit 10 - Stop"]
    #[inline(always)]
    #[must_use]
    pub fn stop(&mut self) -> STOP_W<10> {
        STOP_W::new(self)
    }
    #[doc = "Bit 13 - DACHG"]
    #[inline(always)]
    #[must_use]
    pub fn dachg(&mut self) -> DACHG_W<13> {
        DACHG_W::new(self)
    }
    #[doc = "Bit 14 - Common Command Code"]
    #[inline(always)]
    #[must_use]
    pub fn ccc(&mut self) -> CCC_W<14> {
        CCC_W::new(self)
    }
    #[doc = "Bit 16 - High Data Rate command match"]
    #[inline(always)]
    #[must_use]
    pub fn hdrmatch(&mut self) -> HDRMATCH_W<16> {
        HDRMATCH_W::new(self)
    }
    #[doc = "Bit 17 - Common-Command-Code handled"]
    #[inline(always)]
    #[must_use]
    pub fn chandled(&mut self) -> CHANDLED_W<17> {
        CHANDLED_W::new(self)
    }
    #[doc = "Bit 18 - Event"]
    #[inline(always)]
    #[must_use]
    pub fn event(&mut self) -> EVENT_W<18> {
        EVENT_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 Status 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 [sstatus](index.html) module"]
pub struct SSTATUS_SPEC;
impl crate::RegisterSpec for SSTATUS_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [sstatus::R](R) reader structure"]
impl crate::Readable for SSTATUS_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sstatus::W](W) writer structure"]
impl crate::Writable for SSTATUS_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 SSTATUS to value 0x1000"]
impl crate::Resettable for SSTATUS_SPEC {
    const RESET_VALUE: Self::Ux = 0x1000;
}