mcxa_pac/inputmux0/
lpspi1_trig.rs

1#[doc = "Register `LPSPI1_TRIG` reader"]
2pub type R = crate::R<Lpspi1TrigSpec>;
3#[doc = "Register `LPSPI1_TRIG` writer"]
4pub type W = crate::W<Lpspi1TrigSpec>;
5#[doc = "LPSPI1 trigger input connections\n\nValue on reset: 63"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Inp {
10    #[doc = "2: AOI0_OUT0 input is selected"]
11    Val2 = 2,
12    #[doc = "3: AOI0_OUT1 input is selected"]
13    Val3 = 3,
14    #[doc = "4: AOI0_OUT2 input is selected"]
15    Val4 = 4,
16    #[doc = "5: AOI0_OUT3 input is selected"]
17    Val5 = 5,
18    #[doc = "6: CMP0_OUT input is selected"]
19    Val6 = 6,
20    #[doc = "7: CMP1_OUT input is selected"]
21    Val7 = 7,
22    #[doc = "8: CMP2_OUT input is selected"]
23    Val8 = 8,
24    #[doc = "9: CTimer0_MAT1 input is selected"]
25    Val9 = 9,
26    #[doc = "10: CTimer0_MAT2 input is selected"]
27    Val10 = 10,
28    #[doc = "11: CTimer1_MAT1 input is selected"]
29    Val11 = 11,
30    #[doc = "12: CTimer1_MAT2 input is selected"]
31    Val12 = 12,
32    #[doc = "13: CTimer2_MAT1 input is selected"]
33    Val13 = 13,
34    #[doc = "14: CTimer2_MAT2 input is selected"]
35    Val14 = 14,
36    #[doc = "15: LPTMR0 input is selected"]
37    Val15 = 15,
38    #[doc = "17: TRIG_IN0 input is selected"]
39    Val17 = 17,
40    #[doc = "18: TRIG_IN1 input is selected"]
41    Val18 = 18,
42    #[doc = "19: TRIG_IN2 input is selected"]
43    Val19 = 19,
44    #[doc = "20: TRIG_IN3 input is selected"]
45    Val20 = 20,
46    #[doc = "21: TRIG_IN4 input is selected"]
47    Val21 = 21,
48    #[doc = "22: TRIG_IN5 input is selected"]
49    Val22 = 22,
50    #[doc = "23: TRIG_IN6 input is selected"]
51    Val23 = 23,
52    #[doc = "24: TRIG_IN7 input is selected"]
53    Val24 = 24,
54    #[doc = "25: GPIO0 Pin Event Trig 0 input is selected"]
55    Val25 = 25,
56    #[doc = "26: GPIO1 Pin Event Trig 0 input is selected"]
57    Val26 = 26,
58    #[doc = "27: GPIO2 Pin Event Trig 0 input is selected"]
59    Val27 = 27,
60    #[doc = "28: GPIO3 Pin Event Trig 0 input is selected"]
61    Val28 = 28,
62    #[doc = "29: GPIO4 Pin Event Trig 0 input is selected"]
63    Val29 = 29,
64    #[doc = "30: WUU input is selected"]
65    Val30 = 30,
66    #[doc = "31: AOI1_OUT0 input is selected"]
67    Val31 = 31,
68    #[doc = "32: AOI1_OUT1 input is selected"]
69    Val32 = 32,
70    #[doc = "33: AOI1_OUT2 input is selected"]
71    Val33 = 33,
72    #[doc = "34: AOI1_OUT3 input is selected"]
73    Val34 = 34,
74    #[doc = "35: CTimer3_MAT2 input is selected"]
75    Val35 = 35,
76    #[doc = "36: CTimer3_MAT3 input is selected"]
77    Val36 = 36,
78    #[doc = "37: CTimer4_MAT2 input is selected"]
79    Val37 = 37,
80    #[doc = "38: CTimer4_MAT3 input is selected"]
81    Val38 = 38,
82    #[doc = "39: FlexIO CH0 input is selected"]
83    Val39 = 39,
84    #[doc = "40: FlexIO CH1 input is selected"]
85    Val40 = 40,
86    #[doc = "41: FlexIO CH2 input is selected"]
87    Val41 = 41,
88    #[doc = "42: FlexIO CH3 input is selected"]
89    Val42 = 42,
90}
91impl From<Inp> for u8 {
92    #[inline(always)]
93    fn from(variant: Inp) -> Self {
94        variant as _
95    }
96}
97impl crate::FieldSpec for Inp {
98    type Ux = u8;
99}
100impl crate::IsEnum for Inp {}
101#[doc = "Field `INP` reader - LPSPI1 trigger input connections"]
102pub type InpR = crate::FieldReader<Inp>;
103impl InpR {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub const fn variant(&self) -> Option<Inp> {
107        match self.bits {
108            2 => Some(Inp::Val2),
109            3 => Some(Inp::Val3),
110            4 => Some(Inp::Val4),
111            5 => Some(Inp::Val5),
112            6 => Some(Inp::Val6),
113            7 => Some(Inp::Val7),
114            8 => Some(Inp::Val8),
115            9 => Some(Inp::Val9),
116            10 => Some(Inp::Val10),
117            11 => Some(Inp::Val11),
118            12 => Some(Inp::Val12),
119            13 => Some(Inp::Val13),
120            14 => Some(Inp::Val14),
121            15 => Some(Inp::Val15),
122            17 => Some(Inp::Val17),
123            18 => Some(Inp::Val18),
124            19 => Some(Inp::Val19),
125            20 => Some(Inp::Val20),
126            21 => Some(Inp::Val21),
127            22 => Some(Inp::Val22),
128            23 => Some(Inp::Val23),
129            24 => Some(Inp::Val24),
130            25 => Some(Inp::Val25),
131            26 => Some(Inp::Val26),
132            27 => Some(Inp::Val27),
133            28 => Some(Inp::Val28),
134            29 => Some(Inp::Val29),
135            30 => Some(Inp::Val30),
136            31 => Some(Inp::Val31),
137            32 => Some(Inp::Val32),
138            33 => Some(Inp::Val33),
139            34 => Some(Inp::Val34),
140            35 => Some(Inp::Val35),
141            36 => Some(Inp::Val36),
142            37 => Some(Inp::Val37),
143            38 => Some(Inp::Val38),
144            39 => Some(Inp::Val39),
145            40 => Some(Inp::Val40),
146            41 => Some(Inp::Val41),
147            42 => Some(Inp::Val42),
148            _ => None,
149        }
150    }
151    #[doc = "AOI0_OUT0 input is selected"]
152    #[inline(always)]
153    pub fn is_val2(&self) -> bool {
154        *self == Inp::Val2
155    }
156    #[doc = "AOI0_OUT1 input is selected"]
157    #[inline(always)]
158    pub fn is_val3(&self) -> bool {
159        *self == Inp::Val3
160    }
161    #[doc = "AOI0_OUT2 input is selected"]
162    #[inline(always)]
163    pub fn is_val4(&self) -> bool {
164        *self == Inp::Val4
165    }
166    #[doc = "AOI0_OUT3 input is selected"]
167    #[inline(always)]
168    pub fn is_val5(&self) -> bool {
169        *self == Inp::Val5
170    }
171    #[doc = "CMP0_OUT input is selected"]
172    #[inline(always)]
173    pub fn is_val6(&self) -> bool {
174        *self == Inp::Val6
175    }
176    #[doc = "CMP1_OUT input is selected"]
177    #[inline(always)]
178    pub fn is_val7(&self) -> bool {
179        *self == Inp::Val7
180    }
181    #[doc = "CMP2_OUT input is selected"]
182    #[inline(always)]
183    pub fn is_val8(&self) -> bool {
184        *self == Inp::Val8
185    }
186    #[doc = "CTimer0_MAT1 input is selected"]
187    #[inline(always)]
188    pub fn is_val9(&self) -> bool {
189        *self == Inp::Val9
190    }
191    #[doc = "CTimer0_MAT2 input is selected"]
192    #[inline(always)]
193    pub fn is_val10(&self) -> bool {
194        *self == Inp::Val10
195    }
196    #[doc = "CTimer1_MAT1 input is selected"]
197    #[inline(always)]
198    pub fn is_val11(&self) -> bool {
199        *self == Inp::Val11
200    }
201    #[doc = "CTimer1_MAT2 input is selected"]
202    #[inline(always)]
203    pub fn is_val12(&self) -> bool {
204        *self == Inp::Val12
205    }
206    #[doc = "CTimer2_MAT1 input is selected"]
207    #[inline(always)]
208    pub fn is_val13(&self) -> bool {
209        *self == Inp::Val13
210    }
211    #[doc = "CTimer2_MAT2 input is selected"]
212    #[inline(always)]
213    pub fn is_val14(&self) -> bool {
214        *self == Inp::Val14
215    }
216    #[doc = "LPTMR0 input is selected"]
217    #[inline(always)]
218    pub fn is_val15(&self) -> bool {
219        *self == Inp::Val15
220    }
221    #[doc = "TRIG_IN0 input is selected"]
222    #[inline(always)]
223    pub fn is_val17(&self) -> bool {
224        *self == Inp::Val17
225    }
226    #[doc = "TRIG_IN1 input is selected"]
227    #[inline(always)]
228    pub fn is_val18(&self) -> bool {
229        *self == Inp::Val18
230    }
231    #[doc = "TRIG_IN2 input is selected"]
232    #[inline(always)]
233    pub fn is_val19(&self) -> bool {
234        *self == Inp::Val19
235    }
236    #[doc = "TRIG_IN3 input is selected"]
237    #[inline(always)]
238    pub fn is_val20(&self) -> bool {
239        *self == Inp::Val20
240    }
241    #[doc = "TRIG_IN4 input is selected"]
242    #[inline(always)]
243    pub fn is_val21(&self) -> bool {
244        *self == Inp::Val21
245    }
246    #[doc = "TRIG_IN5 input is selected"]
247    #[inline(always)]
248    pub fn is_val22(&self) -> bool {
249        *self == Inp::Val22
250    }
251    #[doc = "TRIG_IN6 input is selected"]
252    #[inline(always)]
253    pub fn is_val23(&self) -> bool {
254        *self == Inp::Val23
255    }
256    #[doc = "TRIG_IN7 input is selected"]
257    #[inline(always)]
258    pub fn is_val24(&self) -> bool {
259        *self == Inp::Val24
260    }
261    #[doc = "GPIO0 Pin Event Trig 0 input is selected"]
262    #[inline(always)]
263    pub fn is_val25(&self) -> bool {
264        *self == Inp::Val25
265    }
266    #[doc = "GPIO1 Pin Event Trig 0 input is selected"]
267    #[inline(always)]
268    pub fn is_val26(&self) -> bool {
269        *self == Inp::Val26
270    }
271    #[doc = "GPIO2 Pin Event Trig 0 input is selected"]
272    #[inline(always)]
273    pub fn is_val27(&self) -> bool {
274        *self == Inp::Val27
275    }
276    #[doc = "GPIO3 Pin Event Trig 0 input is selected"]
277    #[inline(always)]
278    pub fn is_val28(&self) -> bool {
279        *self == Inp::Val28
280    }
281    #[doc = "GPIO4 Pin Event Trig 0 input is selected"]
282    #[inline(always)]
283    pub fn is_val29(&self) -> bool {
284        *self == Inp::Val29
285    }
286    #[doc = "WUU input is selected"]
287    #[inline(always)]
288    pub fn is_val30(&self) -> bool {
289        *self == Inp::Val30
290    }
291    #[doc = "AOI1_OUT0 input is selected"]
292    #[inline(always)]
293    pub fn is_val31(&self) -> bool {
294        *self == Inp::Val31
295    }
296    #[doc = "AOI1_OUT1 input is selected"]
297    #[inline(always)]
298    pub fn is_val32(&self) -> bool {
299        *self == Inp::Val32
300    }
301    #[doc = "AOI1_OUT2 input is selected"]
302    #[inline(always)]
303    pub fn is_val33(&self) -> bool {
304        *self == Inp::Val33
305    }
306    #[doc = "AOI1_OUT3 input is selected"]
307    #[inline(always)]
308    pub fn is_val34(&self) -> bool {
309        *self == Inp::Val34
310    }
311    #[doc = "CTimer3_MAT2 input is selected"]
312    #[inline(always)]
313    pub fn is_val35(&self) -> bool {
314        *self == Inp::Val35
315    }
316    #[doc = "CTimer3_MAT3 input is selected"]
317    #[inline(always)]
318    pub fn is_val36(&self) -> bool {
319        *self == Inp::Val36
320    }
321    #[doc = "CTimer4_MAT2 input is selected"]
322    #[inline(always)]
323    pub fn is_val37(&self) -> bool {
324        *self == Inp::Val37
325    }
326    #[doc = "CTimer4_MAT3 input is selected"]
327    #[inline(always)]
328    pub fn is_val38(&self) -> bool {
329        *self == Inp::Val38
330    }
331    #[doc = "FlexIO CH0 input is selected"]
332    #[inline(always)]
333    pub fn is_val39(&self) -> bool {
334        *self == Inp::Val39
335    }
336    #[doc = "FlexIO CH1 input is selected"]
337    #[inline(always)]
338    pub fn is_val40(&self) -> bool {
339        *self == Inp::Val40
340    }
341    #[doc = "FlexIO CH2 input is selected"]
342    #[inline(always)]
343    pub fn is_val41(&self) -> bool {
344        *self == Inp::Val41
345    }
346    #[doc = "FlexIO CH3 input is selected"]
347    #[inline(always)]
348    pub fn is_val42(&self) -> bool {
349        *self == Inp::Val42
350    }
351}
352#[doc = "Field `INP` writer - LPSPI1 trigger input connections"]
353pub type InpW<'a, REG> = crate::FieldWriter<'a, REG, 6, Inp>;
354impl<'a, REG> InpW<'a, REG>
355where
356    REG: crate::Writable + crate::RegisterSpec,
357    REG::Ux: From<u8>,
358{
359    #[doc = "AOI0_OUT0 input is selected"]
360    #[inline(always)]
361    pub fn val2(self) -> &'a mut crate::W<REG> {
362        self.variant(Inp::Val2)
363    }
364    #[doc = "AOI0_OUT1 input is selected"]
365    #[inline(always)]
366    pub fn val3(self) -> &'a mut crate::W<REG> {
367        self.variant(Inp::Val3)
368    }
369    #[doc = "AOI0_OUT2 input is selected"]
370    #[inline(always)]
371    pub fn val4(self) -> &'a mut crate::W<REG> {
372        self.variant(Inp::Val4)
373    }
374    #[doc = "AOI0_OUT3 input is selected"]
375    #[inline(always)]
376    pub fn val5(self) -> &'a mut crate::W<REG> {
377        self.variant(Inp::Val5)
378    }
379    #[doc = "CMP0_OUT input is selected"]
380    #[inline(always)]
381    pub fn val6(self) -> &'a mut crate::W<REG> {
382        self.variant(Inp::Val6)
383    }
384    #[doc = "CMP1_OUT input is selected"]
385    #[inline(always)]
386    pub fn val7(self) -> &'a mut crate::W<REG> {
387        self.variant(Inp::Val7)
388    }
389    #[doc = "CMP2_OUT input is selected"]
390    #[inline(always)]
391    pub fn val8(self) -> &'a mut crate::W<REG> {
392        self.variant(Inp::Val8)
393    }
394    #[doc = "CTimer0_MAT1 input is selected"]
395    #[inline(always)]
396    pub fn val9(self) -> &'a mut crate::W<REG> {
397        self.variant(Inp::Val9)
398    }
399    #[doc = "CTimer0_MAT2 input is selected"]
400    #[inline(always)]
401    pub fn val10(self) -> &'a mut crate::W<REG> {
402        self.variant(Inp::Val10)
403    }
404    #[doc = "CTimer1_MAT1 input is selected"]
405    #[inline(always)]
406    pub fn val11(self) -> &'a mut crate::W<REG> {
407        self.variant(Inp::Val11)
408    }
409    #[doc = "CTimer1_MAT2 input is selected"]
410    #[inline(always)]
411    pub fn val12(self) -> &'a mut crate::W<REG> {
412        self.variant(Inp::Val12)
413    }
414    #[doc = "CTimer2_MAT1 input is selected"]
415    #[inline(always)]
416    pub fn val13(self) -> &'a mut crate::W<REG> {
417        self.variant(Inp::Val13)
418    }
419    #[doc = "CTimer2_MAT2 input is selected"]
420    #[inline(always)]
421    pub fn val14(self) -> &'a mut crate::W<REG> {
422        self.variant(Inp::Val14)
423    }
424    #[doc = "LPTMR0 input is selected"]
425    #[inline(always)]
426    pub fn val15(self) -> &'a mut crate::W<REG> {
427        self.variant(Inp::Val15)
428    }
429    #[doc = "TRIG_IN0 input is selected"]
430    #[inline(always)]
431    pub fn val17(self) -> &'a mut crate::W<REG> {
432        self.variant(Inp::Val17)
433    }
434    #[doc = "TRIG_IN1 input is selected"]
435    #[inline(always)]
436    pub fn val18(self) -> &'a mut crate::W<REG> {
437        self.variant(Inp::Val18)
438    }
439    #[doc = "TRIG_IN2 input is selected"]
440    #[inline(always)]
441    pub fn val19(self) -> &'a mut crate::W<REG> {
442        self.variant(Inp::Val19)
443    }
444    #[doc = "TRIG_IN3 input is selected"]
445    #[inline(always)]
446    pub fn val20(self) -> &'a mut crate::W<REG> {
447        self.variant(Inp::Val20)
448    }
449    #[doc = "TRIG_IN4 input is selected"]
450    #[inline(always)]
451    pub fn val21(self) -> &'a mut crate::W<REG> {
452        self.variant(Inp::Val21)
453    }
454    #[doc = "TRIG_IN5 input is selected"]
455    #[inline(always)]
456    pub fn val22(self) -> &'a mut crate::W<REG> {
457        self.variant(Inp::Val22)
458    }
459    #[doc = "TRIG_IN6 input is selected"]
460    #[inline(always)]
461    pub fn val23(self) -> &'a mut crate::W<REG> {
462        self.variant(Inp::Val23)
463    }
464    #[doc = "TRIG_IN7 input is selected"]
465    #[inline(always)]
466    pub fn val24(self) -> &'a mut crate::W<REG> {
467        self.variant(Inp::Val24)
468    }
469    #[doc = "GPIO0 Pin Event Trig 0 input is selected"]
470    #[inline(always)]
471    pub fn val25(self) -> &'a mut crate::W<REG> {
472        self.variant(Inp::Val25)
473    }
474    #[doc = "GPIO1 Pin Event Trig 0 input is selected"]
475    #[inline(always)]
476    pub fn val26(self) -> &'a mut crate::W<REG> {
477        self.variant(Inp::Val26)
478    }
479    #[doc = "GPIO2 Pin Event Trig 0 input is selected"]
480    #[inline(always)]
481    pub fn val27(self) -> &'a mut crate::W<REG> {
482        self.variant(Inp::Val27)
483    }
484    #[doc = "GPIO3 Pin Event Trig 0 input is selected"]
485    #[inline(always)]
486    pub fn val28(self) -> &'a mut crate::W<REG> {
487        self.variant(Inp::Val28)
488    }
489    #[doc = "GPIO4 Pin Event Trig 0 input is selected"]
490    #[inline(always)]
491    pub fn val29(self) -> &'a mut crate::W<REG> {
492        self.variant(Inp::Val29)
493    }
494    #[doc = "WUU input is selected"]
495    #[inline(always)]
496    pub fn val30(self) -> &'a mut crate::W<REG> {
497        self.variant(Inp::Val30)
498    }
499    #[doc = "AOI1_OUT0 input is selected"]
500    #[inline(always)]
501    pub fn val31(self) -> &'a mut crate::W<REG> {
502        self.variant(Inp::Val31)
503    }
504    #[doc = "AOI1_OUT1 input is selected"]
505    #[inline(always)]
506    pub fn val32(self) -> &'a mut crate::W<REG> {
507        self.variant(Inp::Val32)
508    }
509    #[doc = "AOI1_OUT2 input is selected"]
510    #[inline(always)]
511    pub fn val33(self) -> &'a mut crate::W<REG> {
512        self.variant(Inp::Val33)
513    }
514    #[doc = "AOI1_OUT3 input is selected"]
515    #[inline(always)]
516    pub fn val34(self) -> &'a mut crate::W<REG> {
517        self.variant(Inp::Val34)
518    }
519    #[doc = "CTimer3_MAT2 input is selected"]
520    #[inline(always)]
521    pub fn val35(self) -> &'a mut crate::W<REG> {
522        self.variant(Inp::Val35)
523    }
524    #[doc = "CTimer3_MAT3 input is selected"]
525    #[inline(always)]
526    pub fn val36(self) -> &'a mut crate::W<REG> {
527        self.variant(Inp::Val36)
528    }
529    #[doc = "CTimer4_MAT2 input is selected"]
530    #[inline(always)]
531    pub fn val37(self) -> &'a mut crate::W<REG> {
532        self.variant(Inp::Val37)
533    }
534    #[doc = "CTimer4_MAT3 input is selected"]
535    #[inline(always)]
536    pub fn val38(self) -> &'a mut crate::W<REG> {
537        self.variant(Inp::Val38)
538    }
539    #[doc = "FlexIO CH0 input is selected"]
540    #[inline(always)]
541    pub fn val39(self) -> &'a mut crate::W<REG> {
542        self.variant(Inp::Val39)
543    }
544    #[doc = "FlexIO CH1 input is selected"]
545    #[inline(always)]
546    pub fn val40(self) -> &'a mut crate::W<REG> {
547        self.variant(Inp::Val40)
548    }
549    #[doc = "FlexIO CH2 input is selected"]
550    #[inline(always)]
551    pub fn val41(self) -> &'a mut crate::W<REG> {
552        self.variant(Inp::Val41)
553    }
554    #[doc = "FlexIO CH3 input is selected"]
555    #[inline(always)]
556    pub fn val42(self) -> &'a mut crate::W<REG> {
557        self.variant(Inp::Val42)
558    }
559}
560impl R {
561    #[doc = "Bits 0:5 - LPSPI1 trigger input connections"]
562    #[inline(always)]
563    pub fn inp(&self) -> InpR {
564        InpR::new((self.bits & 0x3f) as u8)
565    }
566}
567#[cfg(feature = "debug")]
568impl core::fmt::Debug for R {
569    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
570        f.debug_struct("LPSPI1_TRIG").field("inp", &self.inp()).finish()
571    }
572}
573impl W {
574    #[doc = "Bits 0:5 - LPSPI1 trigger input connections"]
575    #[inline(always)]
576    pub fn inp(&mut self) -> InpW<'_, Lpspi1TrigSpec> {
577        InpW::new(self, 0)
578    }
579}
580#[doc = "LPSPI1 trigger input connections\n\nYou can [`read`](crate::Reg::read) this register and get [`lpspi1_trig::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lpspi1_trig::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
581pub struct Lpspi1TrigSpec;
582impl crate::RegisterSpec for Lpspi1TrigSpec {
583    type Ux = u32;
584}
585#[doc = "`read()` method returns [`lpspi1_trig::R`](R) reader structure"]
586impl crate::Readable for Lpspi1TrigSpec {}
587#[doc = "`write(|w| ..)` method takes [`lpspi1_trig::W`](W) writer structure"]
588impl crate::Writable for Lpspi1TrigSpec {
589    type Safety = crate::Unsafe;
590}
591#[doc = "`reset()` method sets LPSPI1_TRIG to value 0x3f"]
592impl crate::Resettable for Lpspi1TrigSpec {
593    const RESET_VALUE: u32 = 0x3f;
594}