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
440
441
442
443
444
445
446
447
448
#[doc = "Register `ERFSR` reader"]
pub type R = crate::R<ErfsrSpec>;
#[doc = "Register `ERFSR` writer"]
pub type W = crate::W<ErfsrSpec>;
#[doc = "Field `ERFEL` reader - Enhanced RX FIFO Elements"]
pub type ErfelR = crate::FieldReader;
#[doc = "Enhanced RX FIFO Full Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erff {
    #[doc = "0: Not full"]
    NotFull = 0,
    #[doc = "1: Full"]
    Full = 1,
}
impl From<Erff> for bool {
    #[inline(always)]
    fn from(variant: Erff) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFF` reader - Enhanced RX FIFO Full Flag"]
pub type ErffR = crate::BitReader<Erff>;
impl ErffR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erff {
        match self.bits {
            false => Erff::NotFull,
            true => Erff::Full,
        }
    }
    #[doc = "Not full"]
    #[inline(always)]
    pub fn is_not_full(&self) -> bool {
        *self == Erff::NotFull
    }
    #[doc = "Full"]
    #[inline(always)]
    pub fn is_full(&self) -> bool {
        *self == Erff::Full
    }
}
#[doc = "Enhanced RX FIFO Empty Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfe {
    #[doc = "0: Not empty"]
    NotEmpty = 0,
    #[doc = "1: Empty"]
    Empty = 1,
}
impl From<Erfe> for bool {
    #[inline(always)]
    fn from(variant: Erfe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFE` reader - Enhanced RX FIFO Empty Flag"]
pub type ErfeR = crate::BitReader<Erfe>;
impl ErfeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfe {
        match self.bits {
            false => Erfe::NotEmpty,
            true => Erfe::Empty,
        }
    }
    #[doc = "Not empty"]
    #[inline(always)]
    pub fn is_not_empty(&self) -> bool {
        *self == Erfe::NotEmpty
    }
    #[doc = "Empty"]
    #[inline(always)]
    pub fn is_empty(&self) -> bool {
        *self == Erfe::Empty
    }
}
#[doc = "Enhanced RX FIFO Clear\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfclr {
    #[doc = "0: No effect"]
    NoEffect = 0,
    #[doc = "1: Clear enhanced RX FIFO content"]
    Clear = 1,
}
impl From<Erfclr> for bool {
    #[inline(always)]
    fn from(variant: Erfclr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFCLR` reader - Enhanced RX FIFO Clear"]
pub type ErfclrR = crate::BitReader<Erfclr>;
impl ErfclrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfclr {
        match self.bits {
            false => Erfclr::NoEffect,
            true => Erfclr::Clear,
        }
    }
    #[doc = "No effect"]
    #[inline(always)]
    pub fn is_no_effect(&self) -> bool {
        *self == Erfclr::NoEffect
    }
    #[doc = "Clear enhanced RX FIFO content"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == Erfclr::Clear
    }
}
#[doc = "Field `ERFCLR` writer - Enhanced RX FIFO Clear"]
pub type ErfclrW<'a, REG> = crate::BitWriter<'a, REG, Erfclr>;
impl<'a, REG> ErfclrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect"]
    #[inline(always)]
    pub fn no_effect(self) -> &'a mut crate::W<REG> {
        self.variant(Erfclr::NoEffect)
    }
    #[doc = "Clear enhanced RX FIFO content"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut crate::W<REG> {
        self.variant(Erfclr::Clear)
    }
}
#[doc = "Enhanced RX FIFO Data Available Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfda {
    #[doc = "0: No such occurrence"]
    NoMessageStored = 0,
    #[doc = "1: At least one message stored in Enhanced RX FIFO"]
    MessageStored = 1,
}
impl From<Erfda> for bool {
    #[inline(always)]
    fn from(variant: Erfda) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFDA` reader - Enhanced RX FIFO Data Available Flag"]
pub type ErfdaR = crate::BitReader<Erfda>;
impl ErfdaR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfda {
        match self.bits {
            false => Erfda::NoMessageStored,
            true => Erfda::MessageStored,
        }
    }
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn is_no_message_stored(&self) -> bool {
        *self == Erfda::NoMessageStored
    }
    #[doc = "At least one message stored in Enhanced RX FIFO"]
    #[inline(always)]
    pub fn is_message_stored(&self) -> bool {
        *self == Erfda::MessageStored
    }
}
#[doc = "Field `ERFDA` writer - Enhanced RX FIFO Data Available Flag"]
pub type ErfdaW<'a, REG> = crate::BitWriter1C<'a, REG, Erfda>;
impl<'a, REG> ErfdaW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn no_message_stored(self) -> &'a mut crate::W<REG> {
        self.variant(Erfda::NoMessageStored)
    }
    #[doc = "At least one message stored in Enhanced RX FIFO"]
    #[inline(always)]
    pub fn message_stored(self) -> &'a mut crate::W<REG> {
        self.variant(Erfda::MessageStored)
    }
}
#[doc = "Enhanced RX FIFO Watermark Indication Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfwmi {
    #[doc = "0: No such occurrence"]
    WatermarkNo = 0,
    #[doc = "1: Number of messages in FIFO is greater than the watermark"]
    WatermarkYes = 1,
}
impl From<Erfwmi> for bool {
    #[inline(always)]
    fn from(variant: Erfwmi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFWMI` reader - Enhanced RX FIFO Watermark Indication Flag"]
pub type ErfwmiR = crate::BitReader<Erfwmi>;
impl ErfwmiR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfwmi {
        match self.bits {
            false => Erfwmi::WatermarkNo,
            true => Erfwmi::WatermarkYes,
        }
    }
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn is_watermark_no(&self) -> bool {
        *self == Erfwmi::WatermarkNo
    }
    #[doc = "Number of messages in FIFO is greater than the watermark"]
    #[inline(always)]
    pub fn is_watermark_yes(&self) -> bool {
        *self == Erfwmi::WatermarkYes
    }
}
#[doc = "Field `ERFWMI` writer - Enhanced RX FIFO Watermark Indication Flag"]
pub type ErfwmiW<'a, REG> = crate::BitWriter1C<'a, REG, Erfwmi>;
impl<'a, REG> ErfwmiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn watermark_no(self) -> &'a mut crate::W<REG> {
        self.variant(Erfwmi::WatermarkNo)
    }
    #[doc = "Number of messages in FIFO is greater than the watermark"]
    #[inline(always)]
    pub fn watermark_yes(self) -> &'a mut crate::W<REG> {
        self.variant(Erfwmi::WatermarkYes)
    }
}
#[doc = "Enhanced RX FIFO Overflow Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfovf {
    #[doc = "0: No such occurrence"]
    NoOverflow = 0,
    #[doc = "1: Overflow"]
    Overflow = 1,
}
impl From<Erfovf> for bool {
    #[inline(always)]
    fn from(variant: Erfovf) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFOVF` reader - Enhanced RX FIFO Overflow Flag"]
pub type ErfovfR = crate::BitReader<Erfovf>;
impl ErfovfR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfovf {
        match self.bits {
            false => Erfovf::NoOverflow,
            true => Erfovf::Overflow,
        }
    }
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn is_no_overflow(&self) -> bool {
        *self == Erfovf::NoOverflow
    }
    #[doc = "Overflow"]
    #[inline(always)]
    pub fn is_overflow(&self) -> bool {
        *self == Erfovf::Overflow
    }
}
#[doc = "Field `ERFOVF` writer - Enhanced RX FIFO Overflow Flag"]
pub type ErfovfW<'a, REG> = crate::BitWriter1C<'a, REG, Erfovf>;
impl<'a, REG> ErfovfW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn no_overflow(self) -> &'a mut crate::W<REG> {
        self.variant(Erfovf::NoOverflow)
    }
    #[doc = "Overflow"]
    #[inline(always)]
    pub fn overflow(self) -> &'a mut crate::W<REG> {
        self.variant(Erfovf::Overflow)
    }
}
#[doc = "Enhanced RX FIFO Underflow Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erfufw {
    #[doc = "0: No such occurrence"]
    NoUnderflow = 0,
    #[doc = "1: Underflow"]
    Underflow = 1,
}
impl From<Erfufw> for bool {
    #[inline(always)]
    fn from(variant: Erfufw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERFUFW` reader - Enhanced RX FIFO Underflow Flag"]
pub type ErfufwR = crate::BitReader<Erfufw>;
impl ErfufwR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erfufw {
        match self.bits {
            false => Erfufw::NoUnderflow,
            true => Erfufw::Underflow,
        }
    }
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn is_no_underflow(&self) -> bool {
        *self == Erfufw::NoUnderflow
    }
    #[doc = "Underflow"]
    #[inline(always)]
    pub fn is_underflow(&self) -> bool {
        *self == Erfufw::Underflow
    }
}
#[doc = "Field `ERFUFW` writer - Enhanced RX FIFO Underflow Flag"]
pub type ErfufwW<'a, REG> = crate::BitWriter1C<'a, REG, Erfufw>;
impl<'a, REG> ErfufwW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No such occurrence"]
    #[inline(always)]
    pub fn no_underflow(self) -> &'a mut crate::W<REG> {
        self.variant(Erfufw::NoUnderflow)
    }
    #[doc = "Underflow"]
    #[inline(always)]
    pub fn underflow(self) -> &'a mut crate::W<REG> {
        self.variant(Erfufw::Underflow)
    }
}
impl R {
    #[doc = "Bits 0:5 - Enhanced RX FIFO Elements"]
    #[inline(always)]
    pub fn erfel(&self) -> ErfelR {
        ErfelR::new((self.bits & 0x3f) as u8)
    }
    #[doc = "Bit 16 - Enhanced RX FIFO Full Flag"]
    #[inline(always)]
    pub fn erff(&self) -> ErffR {
        ErffR::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Enhanced RX FIFO Empty Flag"]
    #[inline(always)]
    pub fn erfe(&self) -> ErfeR {
        ErfeR::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 27 - Enhanced RX FIFO Clear"]
    #[inline(always)]
    pub fn erfclr(&self) -> ErfclrR {
        ErfclrR::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 28 - Enhanced RX FIFO Data Available Flag"]
    #[inline(always)]
    pub fn erfda(&self) -> ErfdaR {
        ErfdaR::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Enhanced RX FIFO Watermark Indication Flag"]
    #[inline(always)]
    pub fn erfwmi(&self) -> ErfwmiR {
        ErfwmiR::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 30 - Enhanced RX FIFO Overflow Flag"]
    #[inline(always)]
    pub fn erfovf(&self) -> ErfovfR {
        ErfovfR::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - Enhanced RX FIFO Underflow Flag"]
    #[inline(always)]
    pub fn erfufw(&self) -> ErfufwR {
        ErfufwR::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("ERFSR")
            .field("erfel", &self.erfel())
            .field("erff", &self.erff())
            .field("erfe", &self.erfe())
            .field("erfclr", &self.erfclr())
            .field("erfda", &self.erfda())
            .field("erfwmi", &self.erfwmi())
            .field("erfovf", &self.erfovf())
            .field("erfufw", &self.erfufw())
            .finish()
    }
}
impl W {
    #[doc = "Bit 27 - Enhanced RX FIFO Clear"]
    #[inline(always)]
    pub fn erfclr(&mut self) -> ErfclrW<'_, ErfsrSpec> {
        ErfclrW::new(self, 27)
    }
    #[doc = "Bit 28 - Enhanced RX FIFO Data Available Flag"]
    #[inline(always)]
    pub fn erfda(&mut self) -> ErfdaW<'_, ErfsrSpec> {
        ErfdaW::new(self, 28)
    }
    #[doc = "Bit 29 - Enhanced RX FIFO Watermark Indication Flag"]
    #[inline(always)]
    pub fn erfwmi(&mut self) -> ErfwmiW<'_, ErfsrSpec> {
        ErfwmiW::new(self, 29)
    }
    #[doc = "Bit 30 - Enhanced RX FIFO Overflow Flag"]
    #[inline(always)]
    pub fn erfovf(&mut self) -> ErfovfW<'_, ErfsrSpec> {
        ErfovfW::new(self, 30)
    }
    #[doc = "Bit 31 - Enhanced RX FIFO Underflow Flag"]
    #[inline(always)]
    pub fn erfufw(&mut self) -> ErfufwW<'_, ErfsrSpec> {
        ErfufwW::new(self, 31)
    }
}
#[doc = "Enhanced RX FIFO Status\n\nYou can [`read`](crate::Reg::read) this register and get [`erfsr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`erfsr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ErfsrSpec;
impl crate::RegisterSpec for ErfsrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`erfsr::R`](R) reader structure"]
impl crate::Readable for ErfsrSpec {}
#[doc = "`write(|w| ..)` method takes [`erfsr::W`](W) writer structure"]
impl crate::Writable for ErfsrSpec {
    type Safety = crate::Unsafe;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0xf000_0000;
}
#[doc = "`reset()` method sets ERFSR to value 0"]
impl crate::Resettable for ErfsrSpec {}