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
#[doc = "Register `IE` reader"]
pub type R = crate::R<IeSpec>;
#[doc = "Register `IE` writer"]
pub type W = crate::W<IeSpec>;
#[doc = "FIFO 0 Watermark Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fwmie0 {
    #[doc = "0: FIFO 0 watermark interrupts are not enabled."]
    Disabled = 0,
    #[doc = "1: FIFO 0 watermark interrupts are enabled."]
    Enabled = 1,
}
impl From<Fwmie0> for bool {
    #[inline(always)]
    fn from(variant: Fwmie0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FWMIE0` reader - FIFO 0 Watermark Interrupt Enable"]
pub type Fwmie0R = crate::BitReader<Fwmie0>;
impl Fwmie0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fwmie0 {
        match self.bits {
            false => Fwmie0::Disabled,
            true => Fwmie0::Enabled,
        }
    }
    #[doc = "FIFO 0 watermark interrupts are not enabled."]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == Fwmie0::Disabled
    }
    #[doc = "FIFO 0 watermark interrupts are enabled."]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == Fwmie0::Enabled
    }
}
#[doc = "Field `FWMIE0` writer - FIFO 0 Watermark Interrupt Enable"]
pub type Fwmie0W<'a, REG> = crate::BitWriter<'a, REG, Fwmie0>;
impl<'a, REG> Fwmie0W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIFO 0 watermark interrupts are not enabled."]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fwmie0::Disabled)
    }
    #[doc = "FIFO 0 watermark interrupts are enabled."]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fwmie0::Enabled)
    }
}
#[doc = "Result FIFO 0 Overflow Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Fofie0 {
    #[doc = "0: FIFO 0 overflow interrupts are not enabled."]
    Disabled = 0,
    #[doc = "1: FIFO 0 overflow interrupts are enabled."]
    Enabled = 1,
}
impl From<Fofie0> for bool {
    #[inline(always)]
    fn from(variant: Fofie0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FOFIE0` reader - Result FIFO 0 Overflow Interrupt Enable"]
pub type Fofie0R = crate::BitReader<Fofie0>;
impl Fofie0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Fofie0 {
        match self.bits {
            false => Fofie0::Disabled,
            true => Fofie0::Enabled,
        }
    }
    #[doc = "FIFO 0 overflow interrupts are not enabled."]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == Fofie0::Disabled
    }
    #[doc = "FIFO 0 overflow interrupts are enabled."]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == Fofie0::Enabled
    }
}
#[doc = "Field `FOFIE0` writer - Result FIFO 0 Overflow Interrupt Enable"]
pub type Fofie0W<'a, REG> = crate::BitWriter<'a, REG, Fofie0>;
impl<'a, REG> Fofie0W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "FIFO 0 overflow interrupts are not enabled."]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fofie0::Disabled)
    }
    #[doc = "FIFO 0 overflow interrupts are enabled."]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(Fofie0::Enabled)
    }
}
#[doc = "Trigger Exception Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TexcIe {
    #[doc = "0: Trigger exception interrupts are disabled."]
    Disabled = 0,
    #[doc = "1: Trigger exception interrupts are enabled."]
    Enabled = 1,
}
impl From<TexcIe> for bool {
    #[inline(always)]
    fn from(variant: TexcIe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TEXC_IE` reader - Trigger Exception Interrupt Enable"]
pub type TexcIeR = crate::BitReader<TexcIe>;
impl TexcIeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TexcIe {
        match self.bits {
            false => TexcIe::Disabled,
            true => TexcIe::Enabled,
        }
    }
    #[doc = "Trigger exception interrupts are disabled."]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == TexcIe::Disabled
    }
    #[doc = "Trigger exception interrupts are enabled."]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == TexcIe::Enabled
    }
}
#[doc = "Field `TEXC_IE` writer - Trigger Exception Interrupt Enable"]
pub type TexcIeW<'a, REG> = crate::BitWriter<'a, REG, TexcIe>;
impl<'a, REG> TexcIeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Trigger exception interrupts are disabled."]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(TexcIe::Disabled)
    }
    #[doc = "Trigger exception interrupts are enabled."]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(TexcIe::Enabled)
    }
}
#[doc = "Trigger Completion Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TcompIe {
    #[doc = "0: Trigger completion interrupts are disabled."]
    Disabled = 0,
    #[doc = "1: Trigger completion interrupts are enabled for trigger source 0 only."]
    Trigger0CompleteEnabled = 1,
    #[doc = "2: Trigger completion interrupts are enabled for trigger source 1 only."]
    Trigger1CompleteEnabled = 2,
    #[doc = "3: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled3 = 3,
    #[doc = "4: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled4 = 4,
    #[doc = "5: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled5 = 5,
    #[doc = "6: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled6 = 6,
    #[doc = "7: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled7 = 7,
    #[doc = "8: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled8 = 8,
    #[doc = "9: Associated trigger completion interrupts are enabled."]
    TriggerXCompleteEnabled9 = 9,
    #[doc = "15: Trigger completion interrupts are enabled for every trigger source."]
    AllTriggerCompletesEnabled = 15,
}
impl From<TcompIe> for u8 {
    #[inline(always)]
    fn from(variant: TcompIe) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TcompIe {
    type Ux = u8;
}
impl crate::IsEnum for TcompIe {}
#[doc = "Field `TCOMP_IE` reader - Trigger Completion Interrupt Enable"]
pub type TcompIeR = crate::FieldReader<TcompIe>;
impl TcompIeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TcompIe> {
        match self.bits {
            0 => Some(TcompIe::Disabled),
            1 => Some(TcompIe::Trigger0CompleteEnabled),
            2 => Some(TcompIe::Trigger1CompleteEnabled),
            3 => Some(TcompIe::TriggerXCompleteEnabled3),
            4 => Some(TcompIe::TriggerXCompleteEnabled4),
            5 => Some(TcompIe::TriggerXCompleteEnabled5),
            6 => Some(TcompIe::TriggerXCompleteEnabled6),
            7 => Some(TcompIe::TriggerXCompleteEnabled7),
            8 => Some(TcompIe::TriggerXCompleteEnabled8),
            9 => Some(TcompIe::TriggerXCompleteEnabled9),
            15 => Some(TcompIe::AllTriggerCompletesEnabled),
            _ => None,
        }
    }
    #[doc = "Trigger completion interrupts are disabled."]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == TcompIe::Disabled
    }
    #[doc = "Trigger completion interrupts are enabled for trigger source 0 only."]
    #[inline(always)]
    pub fn is_trigger_0_complete_enabled(&self) -> bool {
        *self == TcompIe::Trigger0CompleteEnabled
    }
    #[doc = "Trigger completion interrupts are enabled for trigger source 1 only."]
    #[inline(always)]
    pub fn is_trigger_1_complete_enabled(&self) -> bool {
        *self == TcompIe::Trigger1CompleteEnabled
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_3(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled3
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_4(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled4
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_5(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled5
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_6(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled6
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_7(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled7
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_8(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled8
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn is_trigger_x_complete_enabled_9(&self) -> bool {
        *self == TcompIe::TriggerXCompleteEnabled9
    }
    #[doc = "Trigger completion interrupts are enabled for every trigger source."]
    #[inline(always)]
    pub fn is_all_trigger_completes_enabled(&self) -> bool {
        *self == TcompIe::AllTriggerCompletesEnabled
    }
}
#[doc = "Field `TCOMP_IE` writer - Trigger Completion Interrupt Enable"]
pub type TcompIeW<'a, REG> = crate::FieldWriter<'a, REG, 4, TcompIe>;
impl<'a, REG> TcompIeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Trigger completion interrupts are disabled."]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::Disabled)
    }
    #[doc = "Trigger completion interrupts are enabled for trigger source 0 only."]
    #[inline(always)]
    pub fn trigger_0_complete_enabled(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::Trigger0CompleteEnabled)
    }
    #[doc = "Trigger completion interrupts are enabled for trigger source 1 only."]
    #[inline(always)]
    pub fn trigger_1_complete_enabled(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::Trigger1CompleteEnabled)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_3(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled3)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_4(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled4)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_5(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled5)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_6(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled6)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_7(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled7)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_8(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled8)
    }
    #[doc = "Associated trigger completion interrupts are enabled."]
    #[inline(always)]
    pub fn trigger_x_complete_enabled_9(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::TriggerXCompleteEnabled9)
    }
    #[doc = "Trigger completion interrupts are enabled for every trigger source."]
    #[inline(always)]
    pub fn all_trigger_completes_enabled(self) -> &'a mut crate::W<REG> {
        self.variant(TcompIe::AllTriggerCompletesEnabled)
    }
}
impl R {
    #[doc = "Bit 0 - FIFO 0 Watermark Interrupt Enable"]
    #[inline(always)]
    pub fn fwmie0(&self) -> Fwmie0R {
        Fwmie0R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Result FIFO 0 Overflow Interrupt Enable"]
    #[inline(always)]
    pub fn fofie0(&self) -> Fofie0R {
        Fofie0R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 8 - Trigger Exception Interrupt Enable"]
    #[inline(always)]
    pub fn texc_ie(&self) -> TexcIeR {
        TexcIeR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 16:19 - Trigger Completion Interrupt Enable"]
    #[inline(always)]
    pub fn tcomp_ie(&self) -> TcompIeR {
        TcompIeR::new(((self.bits >> 16) & 0x0f) 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("IE")
            .field("fwmie0", &self.fwmie0())
            .field("fofie0", &self.fofie0())
            .field("texc_ie", &self.texc_ie())
            .field("tcomp_ie", &self.tcomp_ie())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - FIFO 0 Watermark Interrupt Enable"]
    #[inline(always)]
    pub fn fwmie0(&mut self) -> Fwmie0W<'_, IeSpec> {
        Fwmie0W::new(self, 0)
    }
    #[doc = "Bit 1 - Result FIFO 0 Overflow Interrupt Enable"]
    #[inline(always)]
    pub fn fofie0(&mut self) -> Fofie0W<'_, IeSpec> {
        Fofie0W::new(self, 1)
    }
    #[doc = "Bit 8 - Trigger Exception Interrupt Enable"]
    #[inline(always)]
    pub fn texc_ie(&mut self) -> TexcIeW<'_, IeSpec> {
        TexcIeW::new(self, 8)
    }
    #[doc = "Bits 16:19 - Trigger Completion Interrupt Enable"]
    #[inline(always)]
    pub fn tcomp_ie(&mut self) -> TcompIeW<'_, IeSpec> {
        TcompIeW::new(self, 16)
    }
}
#[doc = "Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct IeSpec;
impl crate::RegisterSpec for IeSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ie::R`](R) reader structure"]
impl crate::Readable for IeSpec {}
#[doc = "`write(|w| ..)` method takes [`ie::W`](W) writer structure"]
impl crate::Writable for IeSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets IE to value 0"]
impl crate::Resettable for IeSpec {}