mcxa-pac 0.3.0

Peripheral Access Crate for MCXA256 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
#[doc = "Register `SCAPABILITIES2` reader"]
pub type R = crate::R<Scapabilities2Spec>;
#[doc = "Field `MAPCNT` reader - Map Count"]
pub type MapcntR = crate::FieldReader;
#[doc = "I2C 10-bit Address\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2c10b {
    #[doc = "0: Not supported"]
    Disable = 0,
    #[doc = "1: Supported"]
    Enable = 1,
}
impl From<I2c10b> for bool {
    #[inline(always)]
    fn from(variant: I2c10b) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `I2C10B` reader - I2C 10-bit Address"]
pub type I2c10bR = crate::BitReader<I2c10b>;
impl I2c10bR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> I2c10b {
        match self.bits {
            false => I2c10b::Disable,
            true => I2c10b::Enable,
        }
    }
    #[doc = "Not supported"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == I2c10b::Disable
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == I2c10b::Enable
    }
}
#[doc = "I2C Device ID\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2cdevid {
    #[doc = "0: Not supported"]
    Disable = 0,
    #[doc = "1: Supported"]
    Enable = 1,
}
impl From<I2cdevid> for bool {
    #[inline(always)]
    fn from(variant: I2cdevid) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `I2CDEVID` reader - I2C Device ID"]
pub type I2cdevidR = crate::BitReader<I2cdevid>;
impl I2cdevidR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> I2cdevid {
        match self.bits {
            false => I2cdevid::Disable,
            true => I2cdevid::Enable,
        }
    }
    #[doc = "Not supported"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == I2cdevid::Disable
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == I2cdevid::Enable
    }
}
#[doc = "In-Band Interrupt EXTDATA\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ibiext {
    #[doc = "0: Not supported"]
    Disable = 0,
    #[doc = "1: Supported"]
    Enable = 1,
}
impl From<Ibiext> for bool {
    #[inline(always)]
    fn from(variant: Ibiext) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IBIEXT` reader - In-Band Interrupt EXTDATA"]
pub type IbiextR = crate::BitReader<Ibiext>;
impl IbiextR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ibiext {
        match self.bits {
            false => Ibiext::Disable,
            true => Ibiext::Enable,
        }
    }
    #[doc = "Not supported"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == Ibiext::Disable
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == Ibiext::Enable
    }
}
#[doc = "In-Band Interrupt Extended Register\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ibixreg {
    #[doc = "0: Not supported"]
    Disable = 0,
    #[doc = "1: Supported"]
    Enable = 1,
}
impl From<Ibixreg> for bool {
    #[inline(always)]
    fn from(variant: Ibixreg) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IBIXREG` reader - In-Band Interrupt Extended Register"]
pub type IbixregR = crate::BitReader<Ibixreg>;
impl IbixregR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ibixreg {
        match self.bits {
            false => Ibixreg::Disable,
            true => Ibixreg::Enable,
        }
    }
    #[doc = "Not supported"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == Ibixreg::Disable
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == Ibixreg::Enable
    }
}
#[doc = "Target Reset\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Slvrst {
    #[doc = "0: Not supported"]
    Disable = 0,
    #[doc = "1: Supported"]
    Enable = 1,
}
impl From<Slvrst> for bool {
    #[inline(always)]
    fn from(variant: Slvrst) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SLVRST` reader - Target Reset"]
pub type SlvrstR = crate::BitReader<Slvrst>;
impl SlvrstR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Slvrst {
        match self.bits {
            false => Slvrst::Disable,
            true => Slvrst::Enable,
        }
    }
    #[doc = "Not supported"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == Slvrst::Disable
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == Slvrst::Enable
    }
}
#[doc = "Group\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Group {
    #[doc = "0: v1.1 group addressing not supported"]
    Notsupported = 0,
    #[doc = "1: One group supported"]
    One = 1,
    #[doc = "2: Two groups supported"]
    Two = 2,
    #[doc = "3: Three groups supported"]
    Three = 3,
}
impl From<Group> for u8 {
    #[inline(always)]
    fn from(variant: Group) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Group {
    type Ux = u8;
}
impl crate::IsEnum for Group {}
#[doc = "Field `GROUP` reader - Group"]
pub type GroupR = crate::FieldReader<Group>;
impl GroupR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Group {
        match self.bits {
            0 => Group::Notsupported,
            1 => Group::One,
            2 => Group::Two,
            3 => Group::Three,
            _ => unreachable!(),
        }
    }
    #[doc = "v1.1 group addressing not supported"]
    #[inline(always)]
    pub fn is_notsupported(&self) -> bool {
        *self == Group::Notsupported
    }
    #[doc = "One group supported"]
    #[inline(always)]
    pub fn is_one(&self) -> bool {
        *self == Group::One
    }
    #[doc = "Two groups supported"]
    #[inline(always)]
    pub fn is_two(&self) -> bool {
        *self == Group::Two
    }
    #[doc = "Three groups supported"]
    #[inline(always)]
    pub fn is_three(&self) -> bool {
        *self == Group::Three
    }
}
#[doc = "SETAASA\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Aasa {
    #[doc = "0: SETAASA not supported"]
    Notsupported = 0,
    #[doc = "1: SETAASA supported"]
    Supported = 1,
}
impl From<Aasa> for bool {
    #[inline(always)]
    fn from(variant: Aasa) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AASA` reader - SETAASA"]
pub type AasaR = crate::BitReader<Aasa>;
impl AasaR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Aasa {
        match self.bits {
            false => Aasa::Notsupported,
            true => Aasa::Supported,
        }
    }
    #[doc = "SETAASA not supported"]
    #[inline(always)]
    pub fn is_notsupported(&self) -> bool {
        *self == Aasa::Notsupported
    }
    #[doc = "SETAASA supported"]
    #[inline(always)]
    pub fn is_supported(&self) -> bool {
        *self == Aasa::Supported
    }
}
#[doc = "Target-Target(s)-Tunnel Subscriber Capable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sstsub {
    #[doc = "0: Not subscriber capable"]
    Notsupported = 0,
    #[doc = "1: Subscriber capable"]
    Supported = 1,
}
impl From<Sstsub> for bool {
    #[inline(always)]
    fn from(variant: Sstsub) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SSTSUB` reader - Target-Target(s)-Tunnel Subscriber Capable"]
pub type SstsubR = crate::BitReader<Sstsub>;
impl SstsubR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sstsub {
        match self.bits {
            false => Sstsub::Notsupported,
            true => Sstsub::Supported,
        }
    }
    #[doc = "Not subscriber capable"]
    #[inline(always)]
    pub fn is_notsupported(&self) -> bool {
        *self == Sstsub::Notsupported
    }
    #[doc = "Subscriber capable"]
    #[inline(always)]
    pub fn is_supported(&self) -> bool {
        *self == Sstsub::Supported
    }
}
#[doc = "Target-Target(s)-Tunnel Write Capable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sstwr {
    #[doc = "0: Not write capable"]
    Notsupported = 0,
    #[doc = "1: Write capable"]
    Supported = 1,
}
impl From<Sstwr> for bool {
    #[inline(always)]
    fn from(variant: Sstwr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SSTWR` reader - Target-Target(s)-Tunnel Write Capable"]
pub type SstwrR = crate::BitReader<Sstwr>;
impl SstwrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sstwr {
        match self.bits {
            false => Sstwr::Notsupported,
            true => Sstwr::Supported,
        }
    }
    #[doc = "Not write capable"]
    #[inline(always)]
    pub fn is_notsupported(&self) -> bool {
        *self == Sstwr::Notsupported
    }
    #[doc = "Write capable"]
    #[inline(always)]
    pub fn is_supported(&self) -> bool {
        *self == Sstwr::Supported
    }
}
impl R {
    #[doc = "Bits 0:3 - Map Count"]
    #[inline(always)]
    pub fn mapcnt(&self) -> MapcntR {
        MapcntR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 4 - I2C 10-bit Address"]
    #[inline(always)]
    pub fn i2c10b(&self) -> I2c10bR {
        I2c10bR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 6 - I2C Device ID"]
    #[inline(always)]
    pub fn i2cdevid(&self) -> I2cdevidR {
        I2cdevidR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 8 - In-Band Interrupt EXTDATA"]
    #[inline(always)]
    pub fn ibiext(&self) -> IbiextR {
        IbiextR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - In-Band Interrupt Extended Register"]
    #[inline(always)]
    pub fn ibixreg(&self) -> IbixregR {
        IbixregR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 17 - Target Reset"]
    #[inline(always)]
    pub fn slvrst(&self) -> SlvrstR {
        SlvrstR::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bits 18:19 - Group"]
    #[inline(always)]
    pub fn group(&self) -> GroupR {
        GroupR::new(((self.bits >> 18) & 3) as u8)
    }
    #[doc = "Bit 21 - SETAASA"]
    #[inline(always)]
    pub fn aasa(&self) -> AasaR {
        AasaR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - Target-Target(s)-Tunnel Subscriber Capable"]
    #[inline(always)]
    pub fn sstsub(&self) -> SstsubR {
        SstsubR::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - Target-Target(s)-Tunnel Write Capable"]
    #[inline(always)]
    pub fn sstwr(&self) -> SstwrR {
        SstwrR::new(((self.bits >> 23) & 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("SCAPABILITIES2")
            .field("mapcnt", &self.mapcnt())
            .field("i2c10b", &self.i2c10b())
            .field("i2cdevid", &self.i2cdevid())
            .field("ibiext", &self.ibiext())
            .field("ibixreg", &self.ibixreg())
            .field("slvrst", &self.slvrst())
            .field("group", &self.group())
            .field("aasa", &self.aasa())
            .field("sstsub", &self.sstsub())
            .field("sstwr", &self.sstwr())
            .finish()
    }
}
#[doc = "Target Capabilities 2\n\nYou can [`read`](crate::Reg::read) this register and get [`scapabilities2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Scapabilities2Spec;
impl crate::RegisterSpec for Scapabilities2Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`scapabilities2::R`](R) reader structure"]
impl crate::Readable for Scapabilities2Spec {}
#[doc = "`reset()` method sets SCAPABILITIES2 to value 0x0300"]
impl crate::Resettable for Scapabilities2Spec {
    const RESET_VALUE: u32 = 0x0300;
}