stm32f1/stm32f100/tim1/
ccmr2_output.rs1pub type R = crate::R<CCMR2_OUTPUTrs>;
3pub type W = crate::W<CCMR2_OUTPUTrs>;
5pub use super::ccmr1_output::CC1S;
7pub use super::ccmr1_output::CCS_R;
9pub use super::ccmr1_output::CCS_W;
11pub use super::ccmr1_output::OC1CE;
13pub use super::ccmr1_output::OC1FE;
15pub use super::ccmr1_output::OC1M;
17pub use super::ccmr1_output::OC1PE;
19pub use super::ccmr1_output::OCCE_R;
21pub use super::ccmr1_output::OCCE_W;
23pub use super::ccmr1_output::OCFE_R;
25pub use super::ccmr1_output::OCFE_W;
27pub use super::ccmr1_output::OCM_R;
29pub use super::ccmr1_output::OCM_W;
31pub use super::ccmr1_output::OCPE_R;
33pub use super::ccmr1_output::OCPE_W;
35impl R {
36 #[inline(always)]
40 pub fn ccs(&self, n: u8) -> CCS_R {
41 #[allow(clippy::no_effect)]
42 [(); 2][n as usize];
43 CCS_R::new(((self.bits >> (n * 8)) & 3) as u8)
44 }
45 #[inline(always)]
48 pub fn ccs_iter(&self) -> impl Iterator<Item = CCS_R> + '_ {
49 (0..2).map(move |n| CCS_R::new(((self.bits >> (n * 8)) & 3) as u8))
50 }
51 #[inline(always)]
53 pub fn cc3s(&self) -> CCS_R {
54 CCS_R::new((self.bits & 3) as u8)
55 }
56 #[inline(always)]
58 pub fn cc4s(&self) -> CCS_R {
59 CCS_R::new(((self.bits >> 8) & 3) as u8)
60 }
61 #[inline(always)]
65 pub fn ocfe(&self, n: u8) -> OCFE_R {
66 #[allow(clippy::no_effect)]
67 [(); 2][n as usize];
68 OCFE_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0)
69 }
70 #[inline(always)]
73 pub fn ocfe_iter(&self) -> impl Iterator<Item = OCFE_R> + '_ {
74 (0..2).map(move |n| OCFE_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0))
75 }
76 #[inline(always)]
78 pub fn oc3fe(&self) -> OCFE_R {
79 OCFE_R::new(((self.bits >> 2) & 1) != 0)
80 }
81 #[inline(always)]
83 pub fn oc4fe(&self) -> OCFE_R {
84 OCFE_R::new(((self.bits >> 10) & 1) != 0)
85 }
86 #[inline(always)]
90 pub fn ocpe(&self, n: u8) -> OCPE_R {
91 #[allow(clippy::no_effect)]
92 [(); 2][n as usize];
93 OCPE_R::new(((self.bits >> (n * 8 + 3)) & 1) != 0)
94 }
95 #[inline(always)]
98 pub fn ocpe_iter(&self) -> impl Iterator<Item = OCPE_R> + '_ {
99 (0..2).map(move |n| OCPE_R::new(((self.bits >> (n * 8 + 3)) & 1) != 0))
100 }
101 #[inline(always)]
103 pub fn oc3pe(&self) -> OCPE_R {
104 OCPE_R::new(((self.bits >> 3) & 1) != 0)
105 }
106 #[inline(always)]
108 pub fn oc4pe(&self) -> OCPE_R {
109 OCPE_R::new(((self.bits >> 11) & 1) != 0)
110 }
111 #[inline(always)]
115 pub fn ocm(&self, n: u8) -> OCM_R {
116 #[allow(clippy::no_effect)]
117 [(); 2][n as usize];
118 OCM_R::new(((self.bits >> (n * 8 + 4)) & 7) as u8)
119 }
120 #[inline(always)]
123 pub fn ocm_iter(&self) -> impl Iterator<Item = OCM_R> + '_ {
124 (0..2).map(move |n| OCM_R::new(((self.bits >> (n * 8 + 4)) & 7) as u8))
125 }
126 #[inline(always)]
128 pub fn oc3m(&self) -> OCM_R {
129 OCM_R::new(((self.bits >> 4) & 7) as u8)
130 }
131 #[inline(always)]
133 pub fn oc4m(&self) -> OCM_R {
134 OCM_R::new(((self.bits >> 12) & 7) as u8)
135 }
136 #[inline(always)]
140 pub fn occe(&self, n: u8) -> OCCE_R {
141 #[allow(clippy::no_effect)]
142 [(); 2][n as usize];
143 OCCE_R::new(((self.bits >> (n * 8 + 7)) & 1) != 0)
144 }
145 #[inline(always)]
148 pub fn occe_iter(&self) -> impl Iterator<Item = OCCE_R> + '_ {
149 (0..2).map(move |n| OCCE_R::new(((self.bits >> (n * 8 + 7)) & 1) != 0))
150 }
151 #[inline(always)]
153 pub fn oc3ce(&self) -> OCCE_R {
154 OCCE_R::new(((self.bits >> 7) & 1) != 0)
155 }
156 #[inline(always)]
158 pub fn oc4ce(&self) -> OCCE_R {
159 OCCE_R::new(((self.bits >> 15) & 1) != 0)
160 }
161}
162impl core::fmt::Debug for R {
163 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
164 f.debug_struct("CCMR2_Output")
165 .field("oc3ce", &self.oc3ce())
166 .field("oc4ce", &self.oc4ce())
167 .field("oc3m", &self.oc3m())
168 .field("oc4m", &self.oc4m())
169 .field("oc3pe", &self.oc3pe())
170 .field("oc4pe", &self.oc4pe())
171 .field("oc3fe", &self.oc3fe())
172 .field("oc4fe", &self.oc4fe())
173 .field("cc3s", &self.cc3s())
174 .field("cc4s", &self.cc4s())
175 .finish()
176 }
177}
178impl W {
179 #[inline(always)]
183 pub fn ccs(&mut self, n: u8) -> CCS_W<CCMR2_OUTPUTrs> {
184 #[allow(clippy::no_effect)]
185 [(); 2][n as usize];
186 CCS_W::new(self, n * 8)
187 }
188 #[inline(always)]
190 pub fn cc3s(&mut self) -> CCS_W<CCMR2_OUTPUTrs> {
191 CCS_W::new(self, 0)
192 }
193 #[inline(always)]
195 pub fn cc4s(&mut self) -> CCS_W<CCMR2_OUTPUTrs> {
196 CCS_W::new(self, 8)
197 }
198 #[inline(always)]
202 pub fn ocfe(&mut self, n: u8) -> OCFE_W<CCMR2_OUTPUTrs> {
203 #[allow(clippy::no_effect)]
204 [(); 2][n as usize];
205 OCFE_W::new(self, n * 8 + 2)
206 }
207 #[inline(always)]
209 pub fn oc3fe(&mut self) -> OCFE_W<CCMR2_OUTPUTrs> {
210 OCFE_W::new(self, 2)
211 }
212 #[inline(always)]
214 pub fn oc4fe(&mut self) -> OCFE_W<CCMR2_OUTPUTrs> {
215 OCFE_W::new(self, 10)
216 }
217 #[inline(always)]
221 pub fn ocpe(&mut self, n: u8) -> OCPE_W<CCMR2_OUTPUTrs> {
222 #[allow(clippy::no_effect)]
223 [(); 2][n as usize];
224 OCPE_W::new(self, n * 8 + 3)
225 }
226 #[inline(always)]
228 pub fn oc3pe(&mut self) -> OCPE_W<CCMR2_OUTPUTrs> {
229 OCPE_W::new(self, 3)
230 }
231 #[inline(always)]
233 pub fn oc4pe(&mut self) -> OCPE_W<CCMR2_OUTPUTrs> {
234 OCPE_W::new(self, 11)
235 }
236 #[inline(always)]
240 pub fn ocm(&mut self, n: u8) -> OCM_W<CCMR2_OUTPUTrs> {
241 #[allow(clippy::no_effect)]
242 [(); 2][n as usize];
243 OCM_W::new(self, n * 8 + 4)
244 }
245 #[inline(always)]
247 pub fn oc3m(&mut self) -> OCM_W<CCMR2_OUTPUTrs> {
248 OCM_W::new(self, 4)
249 }
250 #[inline(always)]
252 pub fn oc4m(&mut self) -> OCM_W<CCMR2_OUTPUTrs> {
253 OCM_W::new(self, 12)
254 }
255 #[inline(always)]
259 pub fn occe(&mut self, n: u8) -> OCCE_W<CCMR2_OUTPUTrs> {
260 #[allow(clippy::no_effect)]
261 [(); 2][n as usize];
262 OCCE_W::new(self, n * 8 + 7)
263 }
264 #[inline(always)]
266 pub fn oc3ce(&mut self) -> OCCE_W<CCMR2_OUTPUTrs> {
267 OCCE_W::new(self, 7)
268 }
269 #[inline(always)]
271 pub fn oc4ce(&mut self) -> OCCE_W<CCMR2_OUTPUTrs> {
272 OCCE_W::new(self, 15)
273 }
274}
275pub struct CCMR2_OUTPUTrs;
281impl crate::RegisterSpec for CCMR2_OUTPUTrs {
282 type Ux = u32;
283}
284impl crate::Readable for CCMR2_OUTPUTrs {}
286impl crate::Writable for CCMR2_OUTPUTrs {
288 type Safety = crate::Unsafe;
289}
290impl crate::Resettable for CCMR2_OUTPUTrs {}