ra6m4/port1/
posr.rs

1#[doc = "Register `POSR` writer"]
2pub struct W(crate::W<POSR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<POSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<POSR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<POSR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Pmn Output Set\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24pub enum POSR00_AW {
25    #[doc = "0: No effect on output"]
26    _0 = 0,
27    #[doc = "1: High output"]
28    _1 = 1,
29}
30impl From<POSR00_AW> for bool {
31    #[inline(always)]
32    fn from(variant: POSR00_AW) -> Self {
33        variant as u8 != 0
34    }
35}
36#[doc = "Field `POSR00` writer - Pmn Output Set"]
37pub type POSR00_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR00_AW, O>;
38impl<'a, const O: u8> POSR00_W<'a, O> {
39    #[doc = "No effect on output"]
40    #[inline(always)]
41    pub fn _0(self) -> &'a mut W {
42        self.variant(POSR00_AW::_0)
43    }
44    #[doc = "High output"]
45    #[inline(always)]
46    pub fn _1(self) -> &'a mut W {
47        self.variant(POSR00_AW::_1)
48    }
49}
50#[doc = "Pmn Output Set\n\nValue on reset: 0"]
51#[derive(Clone, Copy, Debug, PartialEq, Eq)]
52pub enum POSR01_AW {
53    #[doc = "0: No effect on output"]
54    _0 = 0,
55    #[doc = "1: High output"]
56    _1 = 1,
57}
58impl From<POSR01_AW> for bool {
59    #[inline(always)]
60    fn from(variant: POSR01_AW) -> Self {
61        variant as u8 != 0
62    }
63}
64#[doc = "Field `POSR01` writer - Pmn Output Set"]
65pub type POSR01_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR01_AW, O>;
66impl<'a, const O: u8> POSR01_W<'a, O> {
67    #[doc = "No effect on output"]
68    #[inline(always)]
69    pub fn _0(self) -> &'a mut W {
70        self.variant(POSR01_AW::_0)
71    }
72    #[doc = "High output"]
73    #[inline(always)]
74    pub fn _1(self) -> &'a mut W {
75        self.variant(POSR01_AW::_1)
76    }
77}
78#[doc = "Pmn Output Set\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum POSR02_AW {
81    #[doc = "0: No effect on output"]
82    _0 = 0,
83    #[doc = "1: High output"]
84    _1 = 1,
85}
86impl From<POSR02_AW> for bool {
87    #[inline(always)]
88    fn from(variant: POSR02_AW) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `POSR02` writer - Pmn Output Set"]
93pub type POSR02_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR02_AW, O>;
94impl<'a, const O: u8> POSR02_W<'a, O> {
95    #[doc = "No effect on output"]
96    #[inline(always)]
97    pub fn _0(self) -> &'a mut W {
98        self.variant(POSR02_AW::_0)
99    }
100    #[doc = "High output"]
101    #[inline(always)]
102    pub fn _1(self) -> &'a mut W {
103        self.variant(POSR02_AW::_1)
104    }
105}
106#[doc = "Pmn Output Set\n\nValue on reset: 0"]
107#[derive(Clone, Copy, Debug, PartialEq, Eq)]
108pub enum POSR03_AW {
109    #[doc = "0: No effect on output"]
110    _0 = 0,
111    #[doc = "1: High output"]
112    _1 = 1,
113}
114impl From<POSR03_AW> for bool {
115    #[inline(always)]
116    fn from(variant: POSR03_AW) -> Self {
117        variant as u8 != 0
118    }
119}
120#[doc = "Field `POSR03` writer - Pmn Output Set"]
121pub type POSR03_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR03_AW, O>;
122impl<'a, const O: u8> POSR03_W<'a, O> {
123    #[doc = "No effect on output"]
124    #[inline(always)]
125    pub fn _0(self) -> &'a mut W {
126        self.variant(POSR03_AW::_0)
127    }
128    #[doc = "High output"]
129    #[inline(always)]
130    pub fn _1(self) -> &'a mut W {
131        self.variant(POSR03_AW::_1)
132    }
133}
134#[doc = "Pmn Output Set\n\nValue on reset: 0"]
135#[derive(Clone, Copy, Debug, PartialEq, Eq)]
136pub enum POSR04_AW {
137    #[doc = "0: No effect on output"]
138    _0 = 0,
139    #[doc = "1: High output"]
140    _1 = 1,
141}
142impl From<POSR04_AW> for bool {
143    #[inline(always)]
144    fn from(variant: POSR04_AW) -> Self {
145        variant as u8 != 0
146    }
147}
148#[doc = "Field `POSR04` writer - Pmn Output Set"]
149pub type POSR04_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR04_AW, O>;
150impl<'a, const O: u8> POSR04_W<'a, O> {
151    #[doc = "No effect on output"]
152    #[inline(always)]
153    pub fn _0(self) -> &'a mut W {
154        self.variant(POSR04_AW::_0)
155    }
156    #[doc = "High output"]
157    #[inline(always)]
158    pub fn _1(self) -> &'a mut W {
159        self.variant(POSR04_AW::_1)
160    }
161}
162#[doc = "Pmn Output Set\n\nValue on reset: 0"]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum POSR05_AW {
165    #[doc = "0: No effect on output"]
166    _0 = 0,
167    #[doc = "1: High output"]
168    _1 = 1,
169}
170impl From<POSR05_AW> for bool {
171    #[inline(always)]
172    fn from(variant: POSR05_AW) -> Self {
173        variant as u8 != 0
174    }
175}
176#[doc = "Field `POSR05` writer - Pmn Output Set"]
177pub type POSR05_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR05_AW, O>;
178impl<'a, const O: u8> POSR05_W<'a, O> {
179    #[doc = "No effect on output"]
180    #[inline(always)]
181    pub fn _0(self) -> &'a mut W {
182        self.variant(POSR05_AW::_0)
183    }
184    #[doc = "High output"]
185    #[inline(always)]
186    pub fn _1(self) -> &'a mut W {
187        self.variant(POSR05_AW::_1)
188    }
189}
190#[doc = "Pmn Output Set\n\nValue on reset: 0"]
191#[derive(Clone, Copy, Debug, PartialEq, Eq)]
192pub enum POSR06_AW {
193    #[doc = "0: No effect on output"]
194    _0 = 0,
195    #[doc = "1: High output"]
196    _1 = 1,
197}
198impl From<POSR06_AW> for bool {
199    #[inline(always)]
200    fn from(variant: POSR06_AW) -> Self {
201        variant as u8 != 0
202    }
203}
204#[doc = "Field `POSR06` writer - Pmn Output Set"]
205pub type POSR06_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR06_AW, O>;
206impl<'a, const O: u8> POSR06_W<'a, O> {
207    #[doc = "No effect on output"]
208    #[inline(always)]
209    pub fn _0(self) -> &'a mut W {
210        self.variant(POSR06_AW::_0)
211    }
212    #[doc = "High output"]
213    #[inline(always)]
214    pub fn _1(self) -> &'a mut W {
215        self.variant(POSR06_AW::_1)
216    }
217}
218#[doc = "Pmn Output Set\n\nValue on reset: 0"]
219#[derive(Clone, Copy, Debug, PartialEq, Eq)]
220pub enum POSR07_AW {
221    #[doc = "0: No effect on output"]
222    _0 = 0,
223    #[doc = "1: High output"]
224    _1 = 1,
225}
226impl From<POSR07_AW> for bool {
227    #[inline(always)]
228    fn from(variant: POSR07_AW) -> Self {
229        variant as u8 != 0
230    }
231}
232#[doc = "Field `POSR07` writer - Pmn Output Set"]
233pub type POSR07_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR07_AW, O>;
234impl<'a, const O: u8> POSR07_W<'a, O> {
235    #[doc = "No effect on output"]
236    #[inline(always)]
237    pub fn _0(self) -> &'a mut W {
238        self.variant(POSR07_AW::_0)
239    }
240    #[doc = "High output"]
241    #[inline(always)]
242    pub fn _1(self) -> &'a mut W {
243        self.variant(POSR07_AW::_1)
244    }
245}
246#[doc = "Pmn Output Set\n\nValue on reset: 0"]
247#[derive(Clone, Copy, Debug, PartialEq, Eq)]
248pub enum POSR08_AW {
249    #[doc = "0: No effect on output"]
250    _0 = 0,
251    #[doc = "1: High output"]
252    _1 = 1,
253}
254impl From<POSR08_AW> for bool {
255    #[inline(always)]
256    fn from(variant: POSR08_AW) -> Self {
257        variant as u8 != 0
258    }
259}
260#[doc = "Field `POSR08` writer - Pmn Output Set"]
261pub type POSR08_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR08_AW, O>;
262impl<'a, const O: u8> POSR08_W<'a, O> {
263    #[doc = "No effect on output"]
264    #[inline(always)]
265    pub fn _0(self) -> &'a mut W {
266        self.variant(POSR08_AW::_0)
267    }
268    #[doc = "High output"]
269    #[inline(always)]
270    pub fn _1(self) -> &'a mut W {
271        self.variant(POSR08_AW::_1)
272    }
273}
274#[doc = "Pmn Output Set\n\nValue on reset: 0"]
275#[derive(Clone, Copy, Debug, PartialEq, Eq)]
276pub enum POSR09_AW {
277    #[doc = "0: No effect on output"]
278    _0 = 0,
279    #[doc = "1: High output"]
280    _1 = 1,
281}
282impl From<POSR09_AW> for bool {
283    #[inline(always)]
284    fn from(variant: POSR09_AW) -> Self {
285        variant as u8 != 0
286    }
287}
288#[doc = "Field `POSR09` writer - Pmn Output Set"]
289pub type POSR09_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR09_AW, O>;
290impl<'a, const O: u8> POSR09_W<'a, O> {
291    #[doc = "No effect on output"]
292    #[inline(always)]
293    pub fn _0(self) -> &'a mut W {
294        self.variant(POSR09_AW::_0)
295    }
296    #[doc = "High output"]
297    #[inline(always)]
298    pub fn _1(self) -> &'a mut W {
299        self.variant(POSR09_AW::_1)
300    }
301}
302#[doc = "Pmn Output Set\n\nValue on reset: 0"]
303#[derive(Clone, Copy, Debug, PartialEq, Eq)]
304pub enum POSR10_AW {
305    #[doc = "0: No effect on output"]
306    _0 = 0,
307    #[doc = "1: High output"]
308    _1 = 1,
309}
310impl From<POSR10_AW> for bool {
311    #[inline(always)]
312    fn from(variant: POSR10_AW) -> Self {
313        variant as u8 != 0
314    }
315}
316#[doc = "Field `POSR10` writer - Pmn Output Set"]
317pub type POSR10_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR10_AW, O>;
318impl<'a, const O: u8> POSR10_W<'a, O> {
319    #[doc = "No effect on output"]
320    #[inline(always)]
321    pub fn _0(self) -> &'a mut W {
322        self.variant(POSR10_AW::_0)
323    }
324    #[doc = "High output"]
325    #[inline(always)]
326    pub fn _1(self) -> &'a mut W {
327        self.variant(POSR10_AW::_1)
328    }
329}
330#[doc = "Pmn Output Set\n\nValue on reset: 0"]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum POSR11_AW {
333    #[doc = "0: No effect on output"]
334    _0 = 0,
335    #[doc = "1: High output"]
336    _1 = 1,
337}
338impl From<POSR11_AW> for bool {
339    #[inline(always)]
340    fn from(variant: POSR11_AW) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `POSR11` writer - Pmn Output Set"]
345pub type POSR11_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR11_AW, O>;
346impl<'a, const O: u8> POSR11_W<'a, O> {
347    #[doc = "No effect on output"]
348    #[inline(always)]
349    pub fn _0(self) -> &'a mut W {
350        self.variant(POSR11_AW::_0)
351    }
352    #[doc = "High output"]
353    #[inline(always)]
354    pub fn _1(self) -> &'a mut W {
355        self.variant(POSR11_AW::_1)
356    }
357}
358#[doc = "Pmn Output Set\n\nValue on reset: 0"]
359#[derive(Clone, Copy, Debug, PartialEq, Eq)]
360pub enum POSR12_AW {
361    #[doc = "0: No effect on output"]
362    _0 = 0,
363    #[doc = "1: High output"]
364    _1 = 1,
365}
366impl From<POSR12_AW> for bool {
367    #[inline(always)]
368    fn from(variant: POSR12_AW) -> Self {
369        variant as u8 != 0
370    }
371}
372#[doc = "Field `POSR12` writer - Pmn Output Set"]
373pub type POSR12_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR12_AW, O>;
374impl<'a, const O: u8> POSR12_W<'a, O> {
375    #[doc = "No effect on output"]
376    #[inline(always)]
377    pub fn _0(self) -> &'a mut W {
378        self.variant(POSR12_AW::_0)
379    }
380    #[doc = "High output"]
381    #[inline(always)]
382    pub fn _1(self) -> &'a mut W {
383        self.variant(POSR12_AW::_1)
384    }
385}
386#[doc = "Pmn Output Set\n\nValue on reset: 0"]
387#[derive(Clone, Copy, Debug, PartialEq, Eq)]
388pub enum POSR13_AW {
389    #[doc = "0: No effect on output"]
390    _0 = 0,
391    #[doc = "1: High output"]
392    _1 = 1,
393}
394impl From<POSR13_AW> for bool {
395    #[inline(always)]
396    fn from(variant: POSR13_AW) -> Self {
397        variant as u8 != 0
398    }
399}
400#[doc = "Field `POSR13` writer - Pmn Output Set"]
401pub type POSR13_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR13_AW, O>;
402impl<'a, const O: u8> POSR13_W<'a, O> {
403    #[doc = "No effect on output"]
404    #[inline(always)]
405    pub fn _0(self) -> &'a mut W {
406        self.variant(POSR13_AW::_0)
407    }
408    #[doc = "High output"]
409    #[inline(always)]
410    pub fn _1(self) -> &'a mut W {
411        self.variant(POSR13_AW::_1)
412    }
413}
414#[doc = "Pmn Output Set\n\nValue on reset: 0"]
415#[derive(Clone, Copy, Debug, PartialEq, Eq)]
416pub enum POSR14_AW {
417    #[doc = "0: No effect on output"]
418    _0 = 0,
419    #[doc = "1: High output"]
420    _1 = 1,
421}
422impl From<POSR14_AW> for bool {
423    #[inline(always)]
424    fn from(variant: POSR14_AW) -> Self {
425        variant as u8 != 0
426    }
427}
428#[doc = "Field `POSR14` writer - Pmn Output Set"]
429pub type POSR14_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR14_AW, O>;
430impl<'a, const O: u8> POSR14_W<'a, O> {
431    #[doc = "No effect on output"]
432    #[inline(always)]
433    pub fn _0(self) -> &'a mut W {
434        self.variant(POSR14_AW::_0)
435    }
436    #[doc = "High output"]
437    #[inline(always)]
438    pub fn _1(self) -> &'a mut W {
439        self.variant(POSR14_AW::_1)
440    }
441}
442#[doc = "Pmn Output Set\n\nValue on reset: 0"]
443#[derive(Clone, Copy, Debug, PartialEq, Eq)]
444pub enum POSR15_AW {
445    #[doc = "0: No effect on output"]
446    _0 = 0,
447    #[doc = "1: High output"]
448    _1 = 1,
449}
450impl From<POSR15_AW> for bool {
451    #[inline(always)]
452    fn from(variant: POSR15_AW) -> Self {
453        variant as u8 != 0
454    }
455}
456#[doc = "Field `POSR15` writer - Pmn Output Set"]
457pub type POSR15_W<'a, const O: u8> = crate::BitWriter<'a, u16, POSR_SPEC, POSR15_AW, O>;
458impl<'a, const O: u8> POSR15_W<'a, O> {
459    #[doc = "No effect on output"]
460    #[inline(always)]
461    pub fn _0(self) -> &'a mut W {
462        self.variant(POSR15_AW::_0)
463    }
464    #[doc = "High output"]
465    #[inline(always)]
466    pub fn _1(self) -> &'a mut W {
467        self.variant(POSR15_AW::_1)
468    }
469}
470impl W {
471    #[doc = "Bit 0 - Pmn Output Set"]
472    #[inline(always)]
473    #[must_use]
474    pub fn posr00(&mut self) -> POSR00_W<0> {
475        POSR00_W::new(self)
476    }
477    #[doc = "Bit 1 - Pmn Output Set"]
478    #[inline(always)]
479    #[must_use]
480    pub fn posr01(&mut self) -> POSR01_W<1> {
481        POSR01_W::new(self)
482    }
483    #[doc = "Bit 2 - Pmn Output Set"]
484    #[inline(always)]
485    #[must_use]
486    pub fn posr02(&mut self) -> POSR02_W<2> {
487        POSR02_W::new(self)
488    }
489    #[doc = "Bit 3 - Pmn Output Set"]
490    #[inline(always)]
491    #[must_use]
492    pub fn posr03(&mut self) -> POSR03_W<3> {
493        POSR03_W::new(self)
494    }
495    #[doc = "Bit 4 - Pmn Output Set"]
496    #[inline(always)]
497    #[must_use]
498    pub fn posr04(&mut self) -> POSR04_W<4> {
499        POSR04_W::new(self)
500    }
501    #[doc = "Bit 5 - Pmn Output Set"]
502    #[inline(always)]
503    #[must_use]
504    pub fn posr05(&mut self) -> POSR05_W<5> {
505        POSR05_W::new(self)
506    }
507    #[doc = "Bit 6 - Pmn Output Set"]
508    #[inline(always)]
509    #[must_use]
510    pub fn posr06(&mut self) -> POSR06_W<6> {
511        POSR06_W::new(self)
512    }
513    #[doc = "Bit 7 - Pmn Output Set"]
514    #[inline(always)]
515    #[must_use]
516    pub fn posr07(&mut self) -> POSR07_W<7> {
517        POSR07_W::new(self)
518    }
519    #[doc = "Bit 8 - Pmn Output Set"]
520    #[inline(always)]
521    #[must_use]
522    pub fn posr08(&mut self) -> POSR08_W<8> {
523        POSR08_W::new(self)
524    }
525    #[doc = "Bit 9 - Pmn Output Set"]
526    #[inline(always)]
527    #[must_use]
528    pub fn posr09(&mut self) -> POSR09_W<9> {
529        POSR09_W::new(self)
530    }
531    #[doc = "Bit 10 - Pmn Output Set"]
532    #[inline(always)]
533    #[must_use]
534    pub fn posr10(&mut self) -> POSR10_W<10> {
535        POSR10_W::new(self)
536    }
537    #[doc = "Bit 11 - Pmn Output Set"]
538    #[inline(always)]
539    #[must_use]
540    pub fn posr11(&mut self) -> POSR11_W<11> {
541        POSR11_W::new(self)
542    }
543    #[doc = "Bit 12 - Pmn Output Set"]
544    #[inline(always)]
545    #[must_use]
546    pub fn posr12(&mut self) -> POSR12_W<12> {
547        POSR12_W::new(self)
548    }
549    #[doc = "Bit 13 - Pmn Output Set"]
550    #[inline(always)]
551    #[must_use]
552    pub fn posr13(&mut self) -> POSR13_W<13> {
553        POSR13_W::new(self)
554    }
555    #[doc = "Bit 14 - Pmn Output Set"]
556    #[inline(always)]
557    #[must_use]
558    pub fn posr14(&mut self) -> POSR14_W<14> {
559        POSR14_W::new(self)
560    }
561    #[doc = "Bit 15 - Pmn Output Set"]
562    #[inline(always)]
563    #[must_use]
564    pub fn posr15(&mut self) -> POSR15_W<15> {
565        POSR15_W::new(self)
566    }
567    #[doc = "Writes raw bits to the register."]
568    #[inline(always)]
569    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
570        self.0.bits(bits);
571        self
572    }
573}
574#[doc = "Port Control Register 3\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [posr](index.html) module"]
575pub struct POSR_SPEC;
576impl crate::RegisterSpec for POSR_SPEC {
577    type Ux = u16;
578}
579#[doc = "`write(|w| ..)` method takes [posr::W](W) writer structure"]
580impl crate::Writable for POSR_SPEC {
581    type Writer = W;
582    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
583    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
584}
585#[doc = "`reset()` method sets POSR to value 0"]
586impl crate::Resettable for POSR_SPEC {
587    const RESET_VALUE: Self::Ux = 0;
588}