lpc82x_pac/swm0/
pinassign10.rs

1#[doc = "Register `PINASSIGN10` reader"]
2pub struct R(crate::R<PINASSIGN10_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PINASSIGN10_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PINASSIGN10_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PINASSIGN10_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PINASSIGN10` writer"]
17pub struct W(crate::W<PINASSIGN10_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PINASSIGN10_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<PINASSIGN10_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PINASSIGN10_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `I2C2_SCL_IO` reader - I2C1_SCL 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 I2C2_SCL_IO_R(crate::FieldReader<u8, u8>);
39impl I2C2_SCL_IO_R {
40    pub(crate) fn new(bits: u8) -> Self {
41        I2C2_SCL_IO_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for I2C2_SCL_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 `I2C2_SCL_IO` writer - I2C1_SCL 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 I2C2_SCL_IO_W<'a> {
53    w: &'a mut W,
54}
55impl<'a> I2C2_SCL_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 `I2C3_SDA_IO` reader - I2C3_SDA 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 I2C3_SDA_IO_R(crate::FieldReader<u8, u8>);
65impl I2C3_SDA_IO_R {
66    pub(crate) fn new(bits: u8) -> Self {
67        I2C3_SDA_IO_R(crate::FieldReader::new(bits))
68    }
69}
70impl core::ops::Deref for I2C3_SDA_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 `I2C3_SDA_IO` writer - I2C3_SDA 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 I2C3_SDA_IO_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> I2C3_SDA_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 `I2C3_SCL_IO` reader - I2C3_SCL 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 I2C3_SCL_IO_R(crate::FieldReader<u8, u8>);
91impl I2C3_SCL_IO_R {
92    pub(crate) fn new(bits: u8) -> Self {
93        I2C3_SCL_IO_R(crate::FieldReader::new(bits))
94    }
95}
96impl core::ops::Deref for I2C3_SCL_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 `I2C3_SCL_IO` writer - I2C3_SCL 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 I2C3_SCL_IO_W<'a> {
105    w: &'a mut W,
106}
107impl<'a> I2C3_SCL_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 `ADC_PINTRIG0_I` reader - ADC_PINTRIG0 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 ADC_PINTRIG0_I_R(crate::FieldReader<u8, u8>);
117impl ADC_PINTRIG0_I_R {
118    pub(crate) fn new(bits: u8) -> Self {
119        ADC_PINTRIG0_I_R(crate::FieldReader::new(bits))
120    }
121}
122impl core::ops::Deref for ADC_PINTRIG0_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 `ADC_PINTRIG0_I` writer - ADC_PINTRIG0 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 ADC_PINTRIG0_I_W<'a> {
131    w: &'a mut W,
132}
133impl<'a> ADC_PINTRIG0_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 - I2C1_SCL 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 i2c2_scl_io(&self) -> I2C2_SCL_IO_R {
145        I2C2_SCL_IO_R::new((self.bits & 0xff) as u8)
146    }
147    #[doc = "Bits 8:15 - I2C3_SDA 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 i2c3_sda_io(&self) -> I2C3_SDA_IO_R {
150        I2C3_SDA_IO_R::new(((self.bits >> 8) & 0xff) as u8)
151    }
152    #[doc = "Bits 16:23 - I2C3_SCL 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 i2c3_scl_io(&self) -> I2C3_SCL_IO_R {
155        I2C3_SCL_IO_R::new(((self.bits >> 16) & 0xff) as u8)
156    }
157    #[doc = "Bits 24:31 - ADC_PINTRIG0 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 adc_pintrig0_i(&self) -> ADC_PINTRIG0_I_R {
160        ADC_PINTRIG0_I_R::new(((self.bits >> 24) & 0xff) as u8)
161    }
162}
163impl W {
164    #[doc = "Bits 0:7 - I2C1_SCL 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 i2c2_scl_io(&mut self) -> I2C2_SCL_IO_W {
167        I2C2_SCL_IO_W { w: self }
168    }
169    #[doc = "Bits 8:15 - I2C3_SDA 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 i2c3_sda_io(&mut self) -> I2C3_SDA_IO_W {
172        I2C3_SDA_IO_W { w: self }
173    }
174    #[doc = "Bits 16:23 - I2C3_SCL 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 i2c3_scl_io(&mut self) -> I2C3_SCL_IO_W {
177        I2C3_SCL_IO_W { w: self }
178    }
179    #[doc = "Bits 24:31 - ADC_PINTRIG0 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 adc_pintrig0_i(&mut self) -> ADC_PINTRIG0_I_W {
182        ADC_PINTRIG0_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 10. Assign movable functions, I2C2_SCL, I2C3_SDA, I2C3_SCL, ADC_PINTRIG0.\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 [pinassign10](index.html) module"]
192pub struct PINASSIGN10_SPEC;
193impl crate::RegisterSpec for PINASSIGN10_SPEC {
194    type Ux = u32;
195}
196#[doc = "`read()` method returns [pinassign10::R](R) reader structure"]
197impl crate::Readable for PINASSIGN10_SPEC {
198    type Reader = R;
199}
200#[doc = "`write(|w| ..)` method takes [pinassign10::W](W) writer structure"]
201impl crate::Writable for PINASSIGN10_SPEC {
202    type Writer = W;
203}
204#[doc = "`reset()` method sets PINASSIGN10 to value 0xffff_ffff"]
205impl crate::Resettable for PINASSIGN10_SPEC {
206    #[inline(always)]
207    fn reset_value() -> Self::Ux {
208        0xffff_ffff
209    }
210}