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
#[doc = "Register `TSTAT` reader"]
pub type R = crate::R<TstatSpec>;
#[doc = "Register `TSTAT` writer"]
pub type W = crate::W<TstatSpec>;
#[doc = "Trigger Exception Number\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TexcNum {
    #[doc = "0: No triggers have been interrupted by a high priority exception. Or CFG\\[TRES\\] = 1."]
    NoExceptions = 0,
    #[doc = "1: Trigger 0 has been interrupted by a high priority exception."]
    Bit0MeansTrigger0Interrupted = 1,
    #[doc = "2: Trigger 1 has been interrupted by a high priority exception."]
    Bit1MeansTrigger1Interrupted = 2,
    #[doc = "3: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted3 = 3,
    #[doc = "4: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted4 = 4,
    #[doc = "5: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted5 = 5,
    #[doc = "6: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted6 = 6,
    #[doc = "7: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted7 = 7,
    #[doc = "8: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted8 = 8,
    #[doc = "9: Associated trigger sequence has interrupted by a high priority exception."]
    SetBitsIndicateTriggerXInterrupted9 = 9,
    #[doc = "15: Every trigger sequence has been interrupted by a high priority exception."]
    AllBitsSetIndicateAllTriggersInterrupted = 15,
}
impl From<TexcNum> for u8 {
    #[inline(always)]
    fn from(variant: TexcNum) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TexcNum {
    type Ux = u8;
}
impl crate::IsEnum for TexcNum {}
#[doc = "Field `TEXC_NUM` reader - Trigger Exception Number"]
pub type TexcNumR = crate::FieldReader<TexcNum>;
impl TexcNumR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TexcNum> {
        match self.bits {
            0 => Some(TexcNum::NoExceptions),
            1 => Some(TexcNum::Bit0MeansTrigger0Interrupted),
            2 => Some(TexcNum::Bit1MeansTrigger1Interrupted),
            3 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted3),
            4 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted4),
            5 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted5),
            6 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted6),
            7 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted7),
            8 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted8),
            9 => Some(TexcNum::SetBitsIndicateTriggerXInterrupted9),
            15 => Some(TexcNum::AllBitsSetIndicateAllTriggersInterrupted),
            _ => None,
        }
    }
    #[doc = "No triggers have been interrupted by a high priority exception. Or CFG\\[TRES\\] = 1."]
    #[inline(always)]
    pub fn is_no_exceptions(&self) -> bool {
        *self == TexcNum::NoExceptions
    }
    #[doc = "Trigger 0 has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_bit0_means_trigger_0_interrupted(&self) -> bool {
        *self == TexcNum::Bit0MeansTrigger0Interrupted
    }
    #[doc = "Trigger 1 has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_bit1_means_trigger_1_interrupted(&self) -> bool {
        *self == TexcNum::Bit1MeansTrigger1Interrupted
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_3(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted3
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_4(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted4
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_5(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted5
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_6(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted6
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_7(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted7
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_8(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted8
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_interrupted_9(&self) -> bool {
        *self == TexcNum::SetBitsIndicateTriggerXInterrupted9
    }
    #[doc = "Every trigger sequence has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn is_all_bits_set_indicate_all_triggers_interrupted(&self) -> bool {
        *self == TexcNum::AllBitsSetIndicateAllTriggersInterrupted
    }
}
#[doc = "Field `TEXC_NUM` writer - Trigger Exception Number"]
pub type TexcNumW<'a, REG> = crate::FieldWriter<'a, REG, 4, TexcNum>;
impl<'a, REG> TexcNumW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "No triggers have been interrupted by a high priority exception. Or CFG\\[TRES\\] = 1."]
    #[inline(always)]
    pub fn no_exceptions(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::NoExceptions)
    }
    #[doc = "Trigger 0 has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn bit0_means_trigger_0_interrupted(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::Bit0MeansTrigger0Interrupted)
    }
    #[doc = "Trigger 1 has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn bit1_means_trigger_1_interrupted(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::Bit1MeansTrigger1Interrupted)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_3(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted3)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_4(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted4)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_5(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted5)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_6(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted6)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_7(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted7)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_8(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted8)
    }
    #[doc = "Associated trigger sequence has interrupted by a high priority exception."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_interrupted_9(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::SetBitsIndicateTriggerXInterrupted9)
    }
    #[doc = "Every trigger sequence has been interrupted by a high priority exception."]
    #[inline(always)]
    pub fn all_bits_set_indicate_all_triggers_interrupted(self) -> &'a mut crate::W<REG> {
        self.variant(TexcNum::AllBitsSetIndicateAllTriggersInterrupted)
    }
}
#[doc = "Trigger Completion Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TcompFlag {
    #[doc = "0: No triggers have been completed. Trigger completion interrupts are disabled."]
    NoTrigger = 0,
    #[doc = "1: Trigger 0 has been completed and trigger 0 has enabled completion interrupts."]
    Bit0MeansTrigger0Completed = 1,
    #[doc = "2: Trigger 1 has been completed and trigger 1 has enabled completion interrupts."]
    Bit1MeansTrigger1Completed = 2,
    #[doc = "3: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted3 = 3,
    #[doc = "4: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted4 = 4,
    #[doc = "5: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted5 = 5,
    #[doc = "6: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted6 = 6,
    #[doc = "7: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted7 = 7,
    #[doc = "8: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted8 = 8,
    #[doc = "9: Associated trigger sequence has completed and has enabled completion interrupts."]
    SetBitsIndicateTriggerXCompleted9 = 9,
    #[doc = "15: Every trigger sequence has been completed and every trigger has enabled completion interrupts."]
    AllBitsSetIndicateAllTriggersCompleted = 15,
}
impl From<TcompFlag> for u8 {
    #[inline(always)]
    fn from(variant: TcompFlag) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TcompFlag {
    type Ux = u8;
}
impl crate::IsEnum for TcompFlag {}
#[doc = "Field `TCOMP_FLAG` reader - Trigger Completion Flag"]
pub type TcompFlagR = crate::FieldReader<TcompFlag>;
impl TcompFlagR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TcompFlag> {
        match self.bits {
            0 => Some(TcompFlag::NoTrigger),
            1 => Some(TcompFlag::Bit0MeansTrigger0Completed),
            2 => Some(TcompFlag::Bit1MeansTrigger1Completed),
            3 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted3),
            4 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted4),
            5 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted5),
            6 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted6),
            7 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted7),
            8 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted8),
            9 => Some(TcompFlag::SetBitsIndicateTriggerXCompleted9),
            15 => Some(TcompFlag::AllBitsSetIndicateAllTriggersCompleted),
            _ => None,
        }
    }
    #[doc = "No triggers have been completed. Trigger completion interrupts are disabled."]
    #[inline(always)]
    pub fn is_no_trigger(&self) -> bool {
        *self == TcompFlag::NoTrigger
    }
    #[doc = "Trigger 0 has been completed and trigger 0 has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_bit0_means_trigger_0_completed(&self) -> bool {
        *self == TcompFlag::Bit0MeansTrigger0Completed
    }
    #[doc = "Trigger 1 has been completed and trigger 1 has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_bit1_means_trigger_1_completed(&self) -> bool {
        *self == TcompFlag::Bit1MeansTrigger1Completed
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_3(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted3
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_4(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted4
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_5(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted5
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_6(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted6
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_7(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted7
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_8(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted8
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_set_bits_indicate_trigger_x_completed_9(&self) -> bool {
        *self == TcompFlag::SetBitsIndicateTriggerXCompleted9
    }
    #[doc = "Every trigger sequence has been completed and every trigger has enabled completion interrupts."]
    #[inline(always)]
    pub fn is_all_bits_set_indicate_all_triggers_completed(&self) -> bool {
        *self == TcompFlag::AllBitsSetIndicateAllTriggersCompleted
    }
}
#[doc = "Field `TCOMP_FLAG` writer - Trigger Completion Flag"]
pub type TcompFlagW<'a, REG> = crate::FieldWriter<'a, REG, 4, TcompFlag>;
impl<'a, REG> TcompFlagW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "No triggers have been completed. Trigger completion interrupts are disabled."]
    #[inline(always)]
    pub fn no_trigger(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::NoTrigger)
    }
    #[doc = "Trigger 0 has been completed and trigger 0 has enabled completion interrupts."]
    #[inline(always)]
    pub fn bit0_means_trigger_0_completed(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::Bit0MeansTrigger0Completed)
    }
    #[doc = "Trigger 1 has been completed and trigger 1 has enabled completion interrupts."]
    #[inline(always)]
    pub fn bit1_means_trigger_1_completed(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::Bit1MeansTrigger1Completed)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_3(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted3)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_4(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted4)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_5(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted5)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_6(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted6)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_7(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted7)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_8(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted8)
    }
    #[doc = "Associated trigger sequence has completed and has enabled completion interrupts."]
    #[inline(always)]
    pub fn set_bits_indicate_trigger_x_completed_9(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::SetBitsIndicateTriggerXCompleted9)
    }
    #[doc = "Every trigger sequence has been completed and every trigger has enabled completion interrupts."]
    #[inline(always)]
    pub fn all_bits_set_indicate_all_triggers_completed(self) -> &'a mut crate::W<REG> {
        self.variant(TcompFlag::AllBitsSetIndicateAllTriggersCompleted)
    }
}
impl R {
    #[doc = "Bits 0:3 - Trigger Exception Number"]
    #[inline(always)]
    pub fn texc_num(&self) -> TexcNumR {
        TexcNumR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bits 16:19 - Trigger Completion Flag"]
    #[inline(always)]
    pub fn tcomp_flag(&self) -> TcompFlagR {
        TcompFlagR::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("TSTAT")
            .field("texc_num", &self.texc_num())
            .field("tcomp_flag", &self.tcomp_flag())
            .finish()
    }
}
impl W {
    #[doc = "Bits 0:3 - Trigger Exception Number"]
    #[inline(always)]
    pub fn texc_num(&mut self) -> TexcNumW<'_, TstatSpec> {
        TexcNumW::new(self, 0)
    }
    #[doc = "Bits 16:19 - Trigger Completion Flag"]
    #[inline(always)]
    pub fn tcomp_flag(&mut self) -> TcompFlagW<'_, TstatSpec> {
        TcompFlagW::new(self, 16)
    }
}
#[doc = "Trigger Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`tstat::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tstat::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct TstatSpec;
impl crate::RegisterSpec for TstatSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`tstat::R`](R) reader structure"]
impl crate::Readable for TstatSpec {}
#[doc = "`write(|w| ..)` method takes [`tstat::W`](W) writer structure"]
impl crate::Writable for TstatSpec {
    type Safety = crate::Unsafe;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x000f_000f;
}
#[doc = "`reset()` method sets TSTAT to value 0"]
impl crate::Resettable for TstatSpec {}