eos_s3/misc/
pad_sel18.rs

1#[doc = "Register `PAD_SEL18` reader"]
2pub struct R(crate::R<PAD_SEL18_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PAD_SEL18_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PAD_SEL18_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PAD_SEL18_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PAD_SEL18` writer"]
17pub struct W(crate::W<PAD_SEL18_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PAD_SEL18_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<PAD_SEL18_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PAD_SEL18_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TOP_BANK_0` reader - bit for top bank 0"]
38pub struct TOP_BANK_0_R(crate::FieldReader<bool, bool>);
39impl TOP_BANK_0_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        TOP_BANK_0_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for TOP_BANK_0_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `TOP_BANK_0` writer - bit for top bank 0"]
53pub struct TOP_BANK_0_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> TOP_BANK_0_W<'a> {
57    #[doc = r"Sets the field bit"]
58    #[inline(always)]
59    pub fn set_bit(self) -> &'a mut W {
60        self.bit(true)
61    }
62    #[doc = r"Clears the field bit"]
63    #[inline(always)]
64    pub fn clear_bit(self) -> &'a mut W {
65        self.bit(false)
66    }
67    #[doc = r"Writes raw bits to the field"]
68    #[inline(always)]
69    pub fn bit(self, value: bool) -> &'a mut W {
70        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
71        self.w
72    }
73}
74#[doc = "Field `TOP_BANK_1` reader - bit for top bank 1"]
75pub struct TOP_BANK_1_R(crate::FieldReader<bool, bool>);
76impl TOP_BANK_1_R {
77    #[inline(always)]
78    pub(crate) fn new(bits: bool) -> Self {
79        TOP_BANK_1_R(crate::FieldReader::new(bits))
80    }
81}
82impl core::ops::Deref for TOP_BANK_1_R {
83    type Target = crate::FieldReader<bool, bool>;
84    #[inline(always)]
85    fn deref(&self) -> &Self::Target {
86        &self.0
87    }
88}
89#[doc = "Field `TOP_BANK_1` writer - bit for top bank 1"]
90pub struct TOP_BANK_1_W<'a> {
91    w: &'a mut W,
92}
93impl<'a> TOP_BANK_1_W<'a> {
94    #[doc = r"Sets the field bit"]
95    #[inline(always)]
96    pub fn set_bit(self) -> &'a mut W {
97        self.bit(true)
98    }
99    #[doc = r"Clears the field bit"]
100    #[inline(always)]
101    pub fn clear_bit(self) -> &'a mut W {
102        self.bit(false)
103    }
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub fn bit(self, value: bool) -> &'a mut W {
107        self.w.bits =
108            (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
109        self.w
110    }
111}
112#[doc = "Field `BOTTOM_BANK_2` reader - bit for bottom bank 0"]
113pub struct BOTTOM_BANK_2_R(crate::FieldReader<bool, bool>);
114impl BOTTOM_BANK_2_R {
115    #[inline(always)]
116    pub(crate) fn new(bits: bool) -> Self {
117        BOTTOM_BANK_2_R(crate::FieldReader::new(bits))
118    }
119}
120impl core::ops::Deref for BOTTOM_BANK_2_R {
121    type Target = crate::FieldReader<bool, bool>;
122    #[inline(always)]
123    fn deref(&self) -> &Self::Target {
124        &self.0
125    }
126}
127#[doc = "Field `BOTTOM_BANK_2` writer - bit for bottom bank 0"]
128pub struct BOTTOM_BANK_2_W<'a> {
129    w: &'a mut W,
130}
131impl<'a> BOTTOM_BANK_2_W<'a> {
132    #[doc = r"Sets the field bit"]
133    #[inline(always)]
134    pub fn set_bit(self) -> &'a mut W {
135        self.bit(true)
136    }
137    #[doc = r"Clears the field bit"]
138    #[inline(always)]
139    pub fn clear_bit(self) -> &'a mut W {
140        self.bit(false)
141    }
142    #[doc = r"Writes raw bits to the field"]
143    #[inline(always)]
144    pub fn bit(self, value: bool) -> &'a mut W {
145        self.w.bits =
146            (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
147        self.w
148    }
149}
150#[doc = "Field `BOTTOM_BANK_3` reader - bit for bottom bank 1"]
151pub struct BOTTOM_BANK_3_R(crate::FieldReader<bool, bool>);
152impl BOTTOM_BANK_3_R {
153    #[inline(always)]
154    pub(crate) fn new(bits: bool) -> Self {
155        BOTTOM_BANK_3_R(crate::FieldReader::new(bits))
156    }
157}
158impl core::ops::Deref for BOTTOM_BANK_3_R {
159    type Target = crate::FieldReader<bool, bool>;
160    #[inline(always)]
161    fn deref(&self) -> &Self::Target {
162        &self.0
163    }
164}
165#[doc = "Field `BOTTOM_BANK_3` writer - bit for bottom bank 1"]
166pub struct BOTTOM_BANK_3_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> BOTTOM_BANK_3_W<'a> {
170    #[doc = r"Sets the field bit"]
171    #[inline(always)]
172    pub fn set_bit(self) -> &'a mut W {
173        self.bit(true)
174    }
175    #[doc = r"Clears the field bit"]
176    #[inline(always)]
177    pub fn clear_bit(self) -> &'a mut W {
178        self.bit(false)
179    }
180    #[doc = r"Writes raw bits to the field"]
181    #[inline(always)]
182    pub fn bit(self, value: bool) -> &'a mut W {
183        self.w.bits =
184            (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
185        self.w
186    }
187}
188impl R {
189    #[doc = "Bit 0 - bit for top bank 0"]
190    #[inline(always)]
191    pub fn top_bank_0(&self) -> TOP_BANK_0_R {
192        TOP_BANK_0_R::new((self.bits & 0x01) != 0)
193    }
194    #[doc = "Bit 1 - bit for top bank 1"]
195    #[inline(always)]
196    pub fn top_bank_1(&self) -> TOP_BANK_1_R {
197        TOP_BANK_1_R::new(((self.bits >> 1) & 0x01) != 0)
198    }
199    #[doc = "Bit 2 - bit for bottom bank 0"]
200    #[inline(always)]
201    pub fn bottom_bank_2(&self) -> BOTTOM_BANK_2_R {
202        BOTTOM_BANK_2_R::new(((self.bits >> 2) & 0x01) != 0)
203    }
204    #[doc = "Bit 3 - bit for bottom bank 1"]
205    #[inline(always)]
206    pub fn bottom_bank_3(&self) -> BOTTOM_BANK_3_R {
207        BOTTOM_BANK_3_R::new(((self.bits >> 3) & 0x01) != 0)
208    }
209}
210impl W {
211    #[doc = "Bit 0 - bit for top bank 0"]
212    #[inline(always)]
213    pub fn top_bank_0(&mut self) -> TOP_BANK_0_W {
214        TOP_BANK_0_W { w: self }
215    }
216    #[doc = "Bit 1 - bit for top bank 1"]
217    #[inline(always)]
218    pub fn top_bank_1(&mut self) -> TOP_BANK_1_W {
219        TOP_BANK_1_W { w: self }
220    }
221    #[doc = "Bit 2 - bit for bottom bank 0"]
222    #[inline(always)]
223    pub fn bottom_bank_2(&mut self) -> BOTTOM_BANK_2_W {
224        BOTTOM_BANK_2_W { w: self }
225    }
226    #[doc = "Bit 3 - bit for bottom bank 1"]
227    #[inline(always)]
228    pub fn bottom_bank_3(&mut self) -> BOTTOM_BANK_3_W {
229        BOTTOM_BANK_3_W { w: self }
230    }
231    #[doc = "Writes raw bits to the register."]
232    #[inline(always)]
233    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
234        self.0.bits(bits);
235        self
236    }
237}
238#[doc = "Select 1.8V for VCCIO for up to 4 banks. Write a 1 to a bank field to make the IO VCC = 1.8V\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 [pad_sel18](index.html) module"]
239pub struct PAD_SEL18_SPEC;
240impl crate::RegisterSpec for PAD_SEL18_SPEC {
241    type Ux = u32;
242}
243#[doc = "`read()` method returns [pad_sel18::R](R) reader structure"]
244impl crate::Readable for PAD_SEL18_SPEC {
245    type Reader = R;
246}
247#[doc = "`write(|w| ..)` method takes [pad_sel18::W](W) writer structure"]
248impl crate::Writable for PAD_SEL18_SPEC {
249    type Writer = W;
250}
251#[doc = "`reset()` method sets PAD_SEL18 to value 0"]
252impl crate::Resettable for PAD_SEL18_SPEC {
253    #[inline(always)]
254    fn reset_value() -> Self::Ux {
255        0
256    }
257}