lpc82x_pac/swm0/
pinassign8.rs

1#[doc = "Register `PINASSIGN8` reader"]
2pub struct R(crate::R<PINASSIGN8_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PINASSIGN8_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PINASSIGN8_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PINASSIGN8_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PINASSIGN8` writer"]
17pub struct W(crate::W<PINASSIGN8_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PINASSIGN8_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PINASSIGN8_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PINASSIGN8_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SCT_OUT1_O` reader - SCT_OUT1 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
38pub struct SCT_OUT1_O_R(crate::FieldReader<u8, u8>);
39impl SCT_OUT1_O_R {
40    pub(crate) fn new(bits: u8) -> Self {
41        SCT_OUT1_O_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for SCT_OUT1_O_R {
45    type Target = crate::FieldReader<u8, u8>;
46    #[inline(always)]
47    fn deref(&self) -> &Self::Target {
48        &self.0
49    }
50}
51#[doc = "Field `SCT_OUT1_O` writer - SCT_OUT1 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
52pub struct SCT_OUT1_O_W<'a> {
53    w: &'a mut W,
54}
55impl<'a> SCT_OUT1_O_W<'a> {
56    #[doc = r"Writes raw bits to the field"]
57    #[inline(always)]
58    pub unsafe fn bits(self, value: u8) -> &'a mut W {
59        self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
60        self.w
61    }
62}
63#[doc = "Field `SCT_OUT2_O` reader - SCT_OUT2 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
64pub struct SCT_OUT2_O_R(crate::FieldReader<u8, u8>);
65impl SCT_OUT2_O_R {
66    pub(crate) fn new(bits: u8) -> Self {
67        SCT_OUT2_O_R(crate::FieldReader::new(bits))
68    }
69}
70impl core::ops::Deref for SCT_OUT2_O_R {
71    type Target = crate::FieldReader<u8, u8>;
72    #[inline(always)]
73    fn deref(&self) -> &Self::Target {
74        &self.0
75    }
76}
77#[doc = "Field `SCT_OUT2_O` writer - SCT_OUT2 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
78pub struct SCT_OUT2_O_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> SCT_OUT2_O_W<'a> {
82    #[doc = r"Writes raw bits to the field"]
83    #[inline(always)]
84    pub unsafe fn bits(self, value: u8) -> &'a mut W {
85        self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
86        self.w
87    }
88}
89#[doc = "Field `SCT_OUT3_O` reader - SCT_OUT3 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
90pub struct SCT_OUT3_O_R(crate::FieldReader<u8, u8>);
91impl SCT_OUT3_O_R {
92    pub(crate) fn new(bits: u8) -> Self {
93        SCT_OUT3_O_R(crate::FieldReader::new(bits))
94    }
95}
96impl core::ops::Deref for SCT_OUT3_O_R {
97    type Target = crate::FieldReader<u8, u8>;
98    #[inline(always)]
99    fn deref(&self) -> &Self::Target {
100        &self.0
101    }
102}
103#[doc = "Field `SCT_OUT3_O` writer - SCT_OUT3 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
104pub struct SCT_OUT3_O_W<'a> {
105    w: &'a mut W,
106}
107impl<'a> SCT_OUT3_O_W<'a> {
108    #[doc = r"Writes raw bits to the field"]
109    #[inline(always)]
110    pub unsafe fn bits(self, value: u8) -> &'a mut W {
111        self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
112        self.w
113    }
114}
115#[doc = "Field `SCT_OUT4_O` reader - SCT_OUT4 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
116pub struct SCT_OUT4_O_R(crate::FieldReader<u8, u8>);
117impl SCT_OUT4_O_R {
118    pub(crate) fn new(bits: u8) -> Self {
119        SCT_OUT4_O_R(crate::FieldReader::new(bits))
120    }
121}
122impl core::ops::Deref for SCT_OUT4_O_R {
123    type Target = crate::FieldReader<u8, u8>;
124    #[inline(always)]
125    fn deref(&self) -> &Self::Target {
126        &self.0
127    }
128}
129#[doc = "Field `SCT_OUT4_O` writer - SCT_OUT4 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
130pub struct SCT_OUT4_O_W<'a> {
131    w: &'a mut W,
132}
133impl<'a> SCT_OUT4_O_W<'a> {
134    #[doc = r"Writes raw bits to the field"]
135    #[inline(always)]
136    pub unsafe fn bits(self, value: u8) -> &'a mut W {
137        self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24);
138        self.w
139    }
140}
141impl R {
142    #[doc = "Bits 0:7 - SCT_OUT1 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
143    #[inline(always)]
144    pub fn sct_out1_o(&self) -> SCT_OUT1_O_R {
145        SCT_OUT1_O_R::new((self.bits & 0xff) as u8)
146    }
147    #[doc = "Bits 8:15 - SCT_OUT2 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
148    #[inline(always)]
149    pub fn sct_out2_o(&self) -> SCT_OUT2_O_R {
150        SCT_OUT2_O_R::new(((self.bits >> 8) & 0xff) as u8)
151    }
152    #[doc = "Bits 16:23 - SCT_OUT3 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
153    #[inline(always)]
154    pub fn sct_out3_o(&self) -> SCT_OUT3_O_R {
155        SCT_OUT3_O_R::new(((self.bits >> 16) & 0xff) as u8)
156    }
157    #[doc = "Bits 24:31 - SCT_OUT4 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
158    #[inline(always)]
159    pub fn sct_out4_o(&self) -> SCT_OUT4_O_R {
160        SCT_OUT4_O_R::new(((self.bits >> 24) & 0xff) as u8)
161    }
162}
163impl W {
164    #[doc = "Bits 0:7 - SCT_OUT1 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
165    #[inline(always)]
166    pub fn sct_out1_o(&mut self) -> SCT_OUT1_O_W {
167        SCT_OUT1_O_W { w: self }
168    }
169    #[doc = "Bits 8:15 - SCT_OUT2 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
170    #[inline(always)]
171    pub fn sct_out2_o(&mut self) -> SCT_OUT2_O_W {
172        SCT_OUT2_O_W { w: self }
173    }
174    #[doc = "Bits 16:23 - SCT_OUT3 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
175    #[inline(always)]
176    pub fn sct_out3_o(&mut self) -> SCT_OUT3_O_W {
177        SCT_OUT3_O_W { w: self }
178    }
179    #[doc = "Bits 24:31 - SCT_OUT4 function assignment. The value is the pin number to be assigned to this function. The following pins are available: PIO0_0 (= 0) to PIO0_28 (= 0x1C)."]
180    #[inline(always)]
181    pub fn sct_out4_o(&mut self) -> SCT_OUT4_O_W {
182        SCT_OUT4_O_W { w: self }
183    }
184    #[doc = "Writes raw bits to the register."]
185    #[inline(always)]
186    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
187        self.0.bits(bits);
188        self
189    }
190}
191#[doc = "Pin assign register 8. Assign movable functions SCT_OUT1, SCT_OUT2, SCT_OUT3, SCT_OUT4.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pinassign8](index.html) module"]
192pub struct PINASSIGN8_SPEC;
193impl crate::RegisterSpec for PINASSIGN8_SPEC {
194    type Ux = u32;
195}
196#[doc = "`read()` method returns [pinassign8::R](R) reader structure"]
197impl crate::Readable for PINASSIGN8_SPEC {
198    type Reader = R;
199}
200#[doc = "`write(|w| ..)` method takes [pinassign8::W](W) writer structure"]
201impl crate::Writable for PINASSIGN8_SPEC {
202    type Writer = W;
203}
204#[doc = "`reset()` method sets PINASSIGN8 to value 0xffff_ffff"]
205impl crate::Resettable for PINASSIGN8_SPEC {
206    #[inline(always)]
207    fn reset_value() -> Self::Ux {
208        0xffff_ffff
209    }
210}