lpc82x_pac/swm0/
pinassign6.rs

1#[doc = "Register `PINASSIGN6` reader"]
2pub struct R(crate::R<PINASSIGN6_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PINASSIGN6_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PINASSIGN6_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PINASSIGN6_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PINASSIGN6` writer"]
17pub struct W(crate::W<PINASSIGN6_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PINASSIGN6_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<PINASSIGN6_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PINASSIGN6_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SPI1_MISO_IO` reader - SPI1_MISO 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 SPI1_MISO_IO_R(crate::FieldReader<u8, u8>);
39impl SPI1_MISO_IO_R {
40    pub(crate) fn new(bits: u8) -> Self {
41        SPI1_MISO_IO_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for SPI1_MISO_IO_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 `SPI1_MISO_IO` writer - SPI1_MISO 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 SPI1_MISO_IO_W<'a> {
53    w: &'a mut W,
54}
55impl<'a> SPI1_MISO_IO_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 `SPI1_SSEL0_IO` reader - SPI1_SSEL0 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 SPI1_SSEL0_IO_R(crate::FieldReader<u8, u8>);
65impl SPI1_SSEL0_IO_R {
66    pub(crate) fn new(bits: u8) -> Self {
67        SPI1_SSEL0_IO_R(crate::FieldReader::new(bits))
68    }
69}
70impl core::ops::Deref for SPI1_SSEL0_IO_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 `SPI1_SSEL0_IO` writer - SPI1_SSEL0 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 SPI1_SSEL0_IO_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> SPI1_SSEL0_IO_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 `SPI1_SSEL1_IO` reader - SPI1_SSEL1 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 SPI1_SSEL1_IO_R(crate::FieldReader<u8, u8>);
91impl SPI1_SSEL1_IO_R {
92    pub(crate) fn new(bits: u8) -> Self {
93        SPI1_SSEL1_IO_R(crate::FieldReader::new(bits))
94    }
95}
96impl core::ops::Deref for SPI1_SSEL1_IO_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 `SPI1_SSEL1_IO` writer - SPI1_SSEL1 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 SPI1_SSEL1_IO_W<'a> {
105    w: &'a mut W,
106}
107impl<'a> SPI1_SSEL1_IO_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_PIN0_I` reader - SCT_PIN0 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_PIN0_I_R(crate::FieldReader<u8, u8>);
117impl SCT_PIN0_I_R {
118    pub(crate) fn new(bits: u8) -> Self {
119        SCT_PIN0_I_R(crate::FieldReader::new(bits))
120    }
121}
122impl core::ops::Deref for SCT_PIN0_I_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_PIN0_I` writer - SCT_PIN0 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_PIN0_I_W<'a> {
131    w: &'a mut W,
132}
133impl<'a> SCT_PIN0_I_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 - SPI1_MISO 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 spi1_miso_io(&self) -> SPI1_MISO_IO_R {
145        SPI1_MISO_IO_R::new((self.bits & 0xff) as u8)
146    }
147    #[doc = "Bits 8:15 - SPI1_SSEL0 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 spi1_ssel0_io(&self) -> SPI1_SSEL0_IO_R {
150        SPI1_SSEL0_IO_R::new(((self.bits >> 8) & 0xff) as u8)
151    }
152    #[doc = "Bits 16:23 - SPI1_SSEL1 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 spi1_ssel1_io(&self) -> SPI1_SSEL1_IO_R {
155        SPI1_SSEL1_IO_R::new(((self.bits >> 16) & 0xff) as u8)
156    }
157    #[doc = "Bits 24:31 - SCT_PIN0 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_pin0_i(&self) -> SCT_PIN0_I_R {
160        SCT_PIN0_I_R::new(((self.bits >> 24) & 0xff) as u8)
161    }
162}
163impl W {
164    #[doc = "Bits 0:7 - SPI1_MISO 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 spi1_miso_io(&mut self) -> SPI1_MISO_IO_W {
167        SPI1_MISO_IO_W { w: self }
168    }
169    #[doc = "Bits 8:15 - SPI1_SSEL0 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 spi1_ssel0_io(&mut self) -> SPI1_SSEL0_IO_W {
172        SPI1_SSEL0_IO_W { w: self }
173    }
174    #[doc = "Bits 16:23 - SPI1_SSEL1 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 spi1_ssel1_io(&mut self) -> SPI1_SSEL1_IO_W {
177        SPI1_SSEL1_IO_W { w: self }
178    }
179    #[doc = "Bits 24:31 - SCT_PIN0 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_pin0_i(&mut self) -> SCT_PIN0_I_W {
182        SCT_PIN0_I_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 6. Assign movable functions SPI1_MISO, SPI1_SSEL0, SPI1_SSEL1, SCT0_IN0.\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 [pinassign6](index.html) module"]
192pub struct PINASSIGN6_SPEC;
193impl crate::RegisterSpec for PINASSIGN6_SPEC {
194    type Ux = u32;
195}
196#[doc = "`read()` method returns [pinassign6::R](R) reader structure"]
197impl crate::Readable for PINASSIGN6_SPEC {
198    type Reader = R;
199}
200#[doc = "`write(|w| ..)` method takes [pinassign6::W](W) writer structure"]
201impl crate::Writable for PINASSIGN6_SPEC {
202    type Writer = W;
203}
204#[doc = "`reset()` method sets PINASSIGN6 to value 0xffff_ffff"]
205impl crate::Resettable for PINASSIGN6_SPEC {
206    #[inline(always)]
207    fn reset_value() -> Self::Ux {
208        0xffff_ffff
209    }
210}