stm32l4/stm32l4x1/pwr/
pdcrc.rs

1///Register `PDCRC` reader
2pub type R = crate::R<PDCRCrs>;
3///Register `PDCRC` writer
4pub type W = crate::W<PDCRCrs>;
5///Field `PD0` reader - Port C pull-down bit y (y=0..15)
6pub type PD0_R = crate::BitReader;
7///Field `PD0` writer - Port C pull-down bit y (y=0..15)
8pub type PD0_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `PD1` reader - Port C pull-down bit y (y=0..15)
10pub type PD1_R = crate::BitReader;
11///Field `PD1` writer - Port C pull-down bit y (y=0..15)
12pub type PD1_W<'a, REG> = crate::BitWriter<'a, REG>;
13///Field `PD2` reader - Port C pull-down bit y (y=0..15)
14pub type PD2_R = crate::BitReader;
15///Field `PD2` writer - Port C pull-down bit y (y=0..15)
16pub type PD2_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `PD3` reader - Port C pull-down bit y (y=0..15)
18pub type PD3_R = crate::BitReader;
19///Field `PD3` writer - Port C pull-down bit y (y=0..15)
20pub type PD3_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `PD4` reader - Port C pull-down bit y (y=0..15)
22pub type PD4_R = crate::BitReader;
23///Field `PD4` writer - Port C pull-down bit y (y=0..15)
24pub type PD4_W<'a, REG> = crate::BitWriter<'a, REG>;
25///Field `PD5` reader - Port C pull-down bit y (y=0..15)
26pub type PD5_R = crate::BitReader;
27///Field `PD5` writer - Port C pull-down bit y (y=0..15)
28pub type PD5_W<'a, REG> = crate::BitWriter<'a, REG>;
29///Field `PD6` reader - Port C pull-down bit y (y=0..15)
30pub type PD6_R = crate::BitReader;
31///Field `PD6` writer - Port C pull-down bit y (y=0..15)
32pub type PD6_W<'a, REG> = crate::BitWriter<'a, REG>;
33///Field `PD7` reader - Port C pull-down bit y (y=0..15)
34pub type PD7_R = crate::BitReader;
35///Field `PD7` writer - Port C pull-down bit y (y=0..15)
36pub type PD7_W<'a, REG> = crate::BitWriter<'a, REG>;
37///Field `PD8` reader - Port C pull-down bit y (y=0..15)
38pub type PD8_R = crate::BitReader;
39///Field `PD8` writer - Port C pull-down bit y (y=0..15)
40pub type PD8_W<'a, REG> = crate::BitWriter<'a, REG>;
41///Field `PD9` reader - Port C pull-down bit y (y=0..15)
42pub type PD9_R = crate::BitReader;
43///Field `PD9` writer - Port C pull-down bit y (y=0..15)
44pub type PD9_W<'a, REG> = crate::BitWriter<'a, REG>;
45///Field `PD10` reader - Port C pull-down bit y (y=0..15)
46pub type PD10_R = crate::BitReader;
47///Field `PD10` writer - Port C pull-down bit y (y=0..15)
48pub type PD10_W<'a, REG> = crate::BitWriter<'a, REG>;
49///Field `PD11` reader - Port C pull-down bit y (y=0..15)
50pub type PD11_R = crate::BitReader;
51///Field `PD11` writer - Port C pull-down bit y (y=0..15)
52pub type PD11_W<'a, REG> = crate::BitWriter<'a, REG>;
53///Field `PD12` reader - Port C pull-down bit y (y=0..15)
54pub type PD12_R = crate::BitReader;
55///Field `PD12` writer - Port C pull-down bit y (y=0..15)
56pub type PD12_W<'a, REG> = crate::BitWriter<'a, REG>;
57///Field `PD13` reader - Port C pull-down bit y (y=0..15)
58pub type PD13_R = crate::BitReader;
59///Field `PD13` writer - Port C pull-down bit y (y=0..15)
60pub type PD13_W<'a, REG> = crate::BitWriter<'a, REG>;
61///Field `PD14` reader - Port C pull-down bit y (y=0..15)
62pub type PD14_R = crate::BitReader;
63///Field `PD14` writer - Port C pull-down bit y (y=0..15)
64pub type PD14_W<'a, REG> = crate::BitWriter<'a, REG>;
65///Field `PD15` reader - Port C pull-down bit y (y=0..15)
66pub type PD15_R = crate::BitReader;
67///Field `PD15` writer - Port C pull-down bit y (y=0..15)
68pub type PD15_W<'a, REG> = crate::BitWriter<'a, REG>;
69impl R {
70    ///Bit 0 - Port C pull-down bit y (y=0..15)
71    #[inline(always)]
72    pub fn pd0(&self) -> PD0_R {
73        PD0_R::new((self.bits & 1) != 0)
74    }
75    ///Bit 1 - Port C pull-down bit y (y=0..15)
76    #[inline(always)]
77    pub fn pd1(&self) -> PD1_R {
78        PD1_R::new(((self.bits >> 1) & 1) != 0)
79    }
80    ///Bit 2 - Port C pull-down bit y (y=0..15)
81    #[inline(always)]
82    pub fn pd2(&self) -> PD2_R {
83        PD2_R::new(((self.bits >> 2) & 1) != 0)
84    }
85    ///Bit 3 - Port C pull-down bit y (y=0..15)
86    #[inline(always)]
87    pub fn pd3(&self) -> PD3_R {
88        PD3_R::new(((self.bits >> 3) & 1) != 0)
89    }
90    ///Bit 4 - Port C pull-down bit y (y=0..15)
91    #[inline(always)]
92    pub fn pd4(&self) -> PD4_R {
93        PD4_R::new(((self.bits >> 4) & 1) != 0)
94    }
95    ///Bit 5 - Port C pull-down bit y (y=0..15)
96    #[inline(always)]
97    pub fn pd5(&self) -> PD5_R {
98        PD5_R::new(((self.bits >> 5) & 1) != 0)
99    }
100    ///Bit 6 - Port C pull-down bit y (y=0..15)
101    #[inline(always)]
102    pub fn pd6(&self) -> PD6_R {
103        PD6_R::new(((self.bits >> 6) & 1) != 0)
104    }
105    ///Bit 7 - Port C pull-down bit y (y=0..15)
106    #[inline(always)]
107    pub fn pd7(&self) -> PD7_R {
108        PD7_R::new(((self.bits >> 7) & 1) != 0)
109    }
110    ///Bit 8 - Port C pull-down bit y (y=0..15)
111    #[inline(always)]
112    pub fn pd8(&self) -> PD8_R {
113        PD8_R::new(((self.bits >> 8) & 1) != 0)
114    }
115    ///Bit 9 - Port C pull-down bit y (y=0..15)
116    #[inline(always)]
117    pub fn pd9(&self) -> PD9_R {
118        PD9_R::new(((self.bits >> 9) & 1) != 0)
119    }
120    ///Bit 10 - Port C pull-down bit y (y=0..15)
121    #[inline(always)]
122    pub fn pd10(&self) -> PD10_R {
123        PD10_R::new(((self.bits >> 10) & 1) != 0)
124    }
125    ///Bit 11 - Port C pull-down bit y (y=0..15)
126    #[inline(always)]
127    pub fn pd11(&self) -> PD11_R {
128        PD11_R::new(((self.bits >> 11) & 1) != 0)
129    }
130    ///Bit 12 - Port C pull-down bit y (y=0..15)
131    #[inline(always)]
132    pub fn pd12(&self) -> PD12_R {
133        PD12_R::new(((self.bits >> 12) & 1) != 0)
134    }
135    ///Bit 13 - Port C pull-down bit y (y=0..15)
136    #[inline(always)]
137    pub fn pd13(&self) -> PD13_R {
138        PD13_R::new(((self.bits >> 13) & 1) != 0)
139    }
140    ///Bit 14 - Port C pull-down bit y (y=0..15)
141    #[inline(always)]
142    pub fn pd14(&self) -> PD14_R {
143        PD14_R::new(((self.bits >> 14) & 1) != 0)
144    }
145    ///Bit 15 - Port C pull-down bit y (y=0..15)
146    #[inline(always)]
147    pub fn pd15(&self) -> PD15_R {
148        PD15_R::new(((self.bits >> 15) & 1) != 0)
149    }
150}
151impl core::fmt::Debug for R {
152    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
153        f.debug_struct("PDCRC")
154            .field("pd15", &self.pd15())
155            .field("pd14", &self.pd14())
156            .field("pd13", &self.pd13())
157            .field("pd12", &self.pd12())
158            .field("pd11", &self.pd11())
159            .field("pd10", &self.pd10())
160            .field("pd9", &self.pd9())
161            .field("pd8", &self.pd8())
162            .field("pd7", &self.pd7())
163            .field("pd6", &self.pd6())
164            .field("pd5", &self.pd5())
165            .field("pd4", &self.pd4())
166            .field("pd3", &self.pd3())
167            .field("pd2", &self.pd2())
168            .field("pd1", &self.pd1())
169            .field("pd0", &self.pd0())
170            .finish()
171    }
172}
173impl W {
174    ///Bit 0 - Port C pull-down bit y (y=0..15)
175    #[inline(always)]
176    pub fn pd0(&mut self) -> PD0_W<PDCRCrs> {
177        PD0_W::new(self, 0)
178    }
179    ///Bit 1 - Port C pull-down bit y (y=0..15)
180    #[inline(always)]
181    pub fn pd1(&mut self) -> PD1_W<PDCRCrs> {
182        PD1_W::new(self, 1)
183    }
184    ///Bit 2 - Port C pull-down bit y (y=0..15)
185    #[inline(always)]
186    pub fn pd2(&mut self) -> PD2_W<PDCRCrs> {
187        PD2_W::new(self, 2)
188    }
189    ///Bit 3 - Port C pull-down bit y (y=0..15)
190    #[inline(always)]
191    pub fn pd3(&mut self) -> PD3_W<PDCRCrs> {
192        PD3_W::new(self, 3)
193    }
194    ///Bit 4 - Port C pull-down bit y (y=0..15)
195    #[inline(always)]
196    pub fn pd4(&mut self) -> PD4_W<PDCRCrs> {
197        PD4_W::new(self, 4)
198    }
199    ///Bit 5 - Port C pull-down bit y (y=0..15)
200    #[inline(always)]
201    pub fn pd5(&mut self) -> PD5_W<PDCRCrs> {
202        PD5_W::new(self, 5)
203    }
204    ///Bit 6 - Port C pull-down bit y (y=0..15)
205    #[inline(always)]
206    pub fn pd6(&mut self) -> PD6_W<PDCRCrs> {
207        PD6_W::new(self, 6)
208    }
209    ///Bit 7 - Port C pull-down bit y (y=0..15)
210    #[inline(always)]
211    pub fn pd7(&mut self) -> PD7_W<PDCRCrs> {
212        PD7_W::new(self, 7)
213    }
214    ///Bit 8 - Port C pull-down bit y (y=0..15)
215    #[inline(always)]
216    pub fn pd8(&mut self) -> PD8_W<PDCRCrs> {
217        PD8_W::new(self, 8)
218    }
219    ///Bit 9 - Port C pull-down bit y (y=0..15)
220    #[inline(always)]
221    pub fn pd9(&mut self) -> PD9_W<PDCRCrs> {
222        PD9_W::new(self, 9)
223    }
224    ///Bit 10 - Port C pull-down bit y (y=0..15)
225    #[inline(always)]
226    pub fn pd10(&mut self) -> PD10_W<PDCRCrs> {
227        PD10_W::new(self, 10)
228    }
229    ///Bit 11 - Port C pull-down bit y (y=0..15)
230    #[inline(always)]
231    pub fn pd11(&mut self) -> PD11_W<PDCRCrs> {
232        PD11_W::new(self, 11)
233    }
234    ///Bit 12 - Port C pull-down bit y (y=0..15)
235    #[inline(always)]
236    pub fn pd12(&mut self) -> PD12_W<PDCRCrs> {
237        PD12_W::new(self, 12)
238    }
239    ///Bit 13 - Port C pull-down bit y (y=0..15)
240    #[inline(always)]
241    pub fn pd13(&mut self) -> PD13_W<PDCRCrs> {
242        PD13_W::new(self, 13)
243    }
244    ///Bit 14 - Port C pull-down bit y (y=0..15)
245    #[inline(always)]
246    pub fn pd14(&mut self) -> PD14_W<PDCRCrs> {
247        PD14_W::new(self, 14)
248    }
249    ///Bit 15 - Port C pull-down bit y (y=0..15)
250    #[inline(always)]
251    pub fn pd15(&mut self) -> PD15_W<PDCRCrs> {
252        PD15_W::new(self, 15)
253    }
254}
255/**Power Port C pull-down control register
256
257You can [`read`](crate::Reg::read) this register and get [`pdcrc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pdcrc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
258
259See register [structure](https://stm32-rs.github.io/stm32-rs/STM32L4x1.html#PWR:PDCRC)*/
260pub struct PDCRCrs;
261impl crate::RegisterSpec for PDCRCrs {
262    type Ux = u32;
263}
264///`read()` method returns [`pdcrc::R`](R) reader structure
265impl crate::Readable for PDCRCrs {}
266///`write(|w| ..)` method takes [`pdcrc::W`](W) writer structure
267impl crate::Writable for PDCRCrs {
268    type Safety = crate::Unsafe;
269}
270///`reset()` method sets PDCRC to value 0
271impl crate::Resettable for PDCRCrs {}