stm32f1_staging/stm32f103/adc1/
smpr2.rs1pub type R = crate::R<SMPR2rs>;
3pub type W = crate::W<SMPR2rs>;
5pub use super::smpr1::SMP10;
7pub use super::smpr1::SMP_R;
9pub use super::smpr1::SMP_W;
11impl R {
12 #[inline(always)]
16 pub fn smp(&self, n: u8) -> SMP_R {
17 #[allow(clippy::no_effect)] [(); 10][n as usize];
18 SMP_R::new(((self.bits >> (n * 3)) & 7) as u8)
19 }
20 #[inline(always)]
23 pub fn smp_iter(&self) -> impl Iterator<Item = SMP_R> + '_ {
24 (0..10).map(move |n| SMP_R::new(((self.bits >> (n * 3)) & 7) as u8))
25 }
26 #[inline(always)]
28 pub fn smp0(&self) -> SMP_R {
29 SMP_R::new((self.bits & 7) as u8)
30 }
31 #[inline(always)]
33 pub fn smp1(&self) -> SMP_R {
34 SMP_R::new(((self.bits >> 3) & 7) as u8)
35 }
36 #[inline(always)]
38 pub fn smp2(&self) -> SMP_R {
39 SMP_R::new(((self.bits >> 6) & 7) as u8)
40 }
41 #[inline(always)]
43 pub fn smp3(&self) -> SMP_R {
44 SMP_R::new(((self.bits >> 9) & 7) as u8)
45 }
46 #[inline(always)]
48 pub fn smp4(&self) -> SMP_R {
49 SMP_R::new(((self.bits >> 12) & 7) as u8)
50 }
51 #[inline(always)]
53 pub fn smp5(&self) -> SMP_R {
54 SMP_R::new(((self.bits >> 15) & 7) as u8)
55 }
56 #[inline(always)]
58 pub fn smp6(&self) -> SMP_R {
59 SMP_R::new(((self.bits >> 18) & 7) as u8)
60 }
61 #[inline(always)]
63 pub fn smp7(&self) -> SMP_R {
64 SMP_R::new(((self.bits >> 21) & 7) as u8)
65 }
66 #[inline(always)]
68 pub fn smp8(&self) -> SMP_R {
69 SMP_R::new(((self.bits >> 24) & 7) as u8)
70 }
71 #[inline(always)]
73 pub fn smp9(&self) -> SMP_R {
74 SMP_R::new(((self.bits >> 27) & 7) as u8)
75 }
76}
77impl core::fmt::Debug for R {
78 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
79 f.debug_struct("SMPR2")
80 .field("smp0", &self.smp0())
81 .field("smp1", &self.smp1())
82 .field("smp2", &self.smp2())
83 .field("smp3", &self.smp3())
84 .field("smp4", &self.smp4())
85 .field("smp5", &self.smp5())
86 .field("smp6", &self.smp6())
87 .field("smp7", &self.smp7())
88 .field("smp8", &self.smp8())
89 .field("smp9", &self.smp9())
90 .finish()
91 }
92}
93impl W {
94 #[inline(always)]
98 pub fn smp(&mut self, n: u8) -> SMP_W<SMPR2rs> {
99 #[allow(clippy::no_effect)] [(); 10][n as usize];
100 SMP_W::new(self, n * 3)
101 }
102 #[inline(always)]
104 pub fn smp0(&mut self) -> SMP_W<SMPR2rs> {
105 SMP_W::new(self, 0)
106 }
107 #[inline(always)]
109 pub fn smp1(&mut self) -> SMP_W<SMPR2rs> {
110 SMP_W::new(self, 3)
111 }
112 #[inline(always)]
114 pub fn smp2(&mut self) -> SMP_W<SMPR2rs> {
115 SMP_W::new(self, 6)
116 }
117 #[inline(always)]
119 pub fn smp3(&mut self) -> SMP_W<SMPR2rs> {
120 SMP_W::new(self, 9)
121 }
122 #[inline(always)]
124 pub fn smp4(&mut self) -> SMP_W<SMPR2rs> {
125 SMP_W::new(self, 12)
126 }
127 #[inline(always)]
129 pub fn smp5(&mut self) -> SMP_W<SMPR2rs> {
130 SMP_W::new(self, 15)
131 }
132 #[inline(always)]
134 pub fn smp6(&mut self) -> SMP_W<SMPR2rs> {
135 SMP_W::new(self, 18)
136 }
137 #[inline(always)]
139 pub fn smp7(&mut self) -> SMP_W<SMPR2rs> {
140 SMP_W::new(self, 21)
141 }
142 #[inline(always)]
144 pub fn smp8(&mut self) -> SMP_W<SMPR2rs> {
145 SMP_W::new(self, 24)
146 }
147 #[inline(always)]
149 pub fn smp9(&mut self) -> SMP_W<SMPR2rs> {
150 SMP_W::new(self, 27)
151 }
152}
153pub struct SMPR2rs;
159impl crate::RegisterSpec for SMPR2rs {
160 type Ux = u32;
161}
162impl crate::Readable for SMPR2rs {}
164impl crate::Writable for SMPR2rs {
166 type Safety = crate::Unsafe;
167}
168impl crate::Resettable for SMPR2rs {}