stm32f3_copterust/stm32f303/tsc/
iogcsr.rs

1#[doc = "Reader of register IOGCSR"]
2pub type R = crate::R<u32, super::IOGCSR>;
3#[doc = "Writer for register IOGCSR"]
4pub type W = crate::W<u32, super::IOGCSR>;
5#[doc = "Register IOGCSR `reset()`'s with value 0"]
6impl crate::ResetValue for super::IOGCSR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `G8S`"]
14pub type G8S_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `G8S`"]
16pub struct G8S_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> G8S_W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
34        self.w
35    }
36}
37#[doc = "Reader of field `G7S`"]
38pub type G7S_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `G7S`"]
40pub struct G7S_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> G7S_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
58        self.w
59    }
60}
61#[doc = "Reader of field `G6S`"]
62pub type G6S_R = crate::R<bool, bool>;
63#[doc = "Reader of field `G5S`"]
64pub type G5S_R = crate::R<bool, bool>;
65#[doc = "Reader of field `G4S`"]
66pub type G4S_R = crate::R<bool, bool>;
67#[doc = "Reader of field `G3S`"]
68pub type G3S_R = crate::R<bool, bool>;
69#[doc = "Reader of field `G2S`"]
70pub type G2S_R = crate::R<bool, bool>;
71#[doc = "Reader of field `G1S`"]
72pub type G1S_R = crate::R<bool, bool>;
73#[doc = "Reader of field `G8E`"]
74pub type G8E_R = crate::R<bool, bool>;
75#[doc = "Write proxy for field `G8E`"]
76pub struct G8E_W<'a> {
77    w: &'a mut W,
78}
79impl<'a> G8E_W<'a> {
80    #[doc = r"Sets the field bit"]
81    #[inline(always)]
82    pub fn set_bit(self) -> &'a mut W {
83        self.bit(true)
84    }
85    #[doc = r"Clears the field bit"]
86    #[inline(always)]
87    pub fn clear_bit(self) -> &'a mut W {
88        self.bit(false)
89    }
90    #[doc = r"Writes raw bits to the field"]
91    #[inline(always)]
92    pub fn bit(self, value: bool) -> &'a mut W {
93        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
94        self.w
95    }
96}
97#[doc = "Reader of field `G7E`"]
98pub type G7E_R = crate::R<bool, bool>;
99#[doc = "Write proxy for field `G7E`"]
100pub struct G7E_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> G7E_W<'a> {
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
118        self.w
119    }
120}
121#[doc = "Reader of field `G6E`"]
122pub type G6E_R = crate::R<bool, bool>;
123#[doc = "Write proxy for field `G6E`"]
124pub struct G6E_W<'a> {
125    w: &'a mut W,
126}
127impl<'a> G6E_W<'a> {
128    #[doc = r"Sets the field bit"]
129    #[inline(always)]
130    pub fn set_bit(self) -> &'a mut W {
131        self.bit(true)
132    }
133    #[doc = r"Clears the field bit"]
134    #[inline(always)]
135    pub fn clear_bit(self) -> &'a mut W {
136        self.bit(false)
137    }
138    #[doc = r"Writes raw bits to the field"]
139    #[inline(always)]
140    pub fn bit(self, value: bool) -> &'a mut W {
141        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
142        self.w
143    }
144}
145#[doc = "Reader of field `G5E`"]
146pub type G5E_R = crate::R<bool, bool>;
147#[doc = "Write proxy for field `G5E`"]
148pub struct G5E_W<'a> {
149    w: &'a mut W,
150}
151impl<'a> G5E_W<'a> {
152    #[doc = r"Sets the field bit"]
153    #[inline(always)]
154    pub fn set_bit(self) -> &'a mut W {
155        self.bit(true)
156    }
157    #[doc = r"Clears the field bit"]
158    #[inline(always)]
159    pub fn clear_bit(self) -> &'a mut W {
160        self.bit(false)
161    }
162    #[doc = r"Writes raw bits to the field"]
163    #[inline(always)]
164    pub fn bit(self, value: bool) -> &'a mut W {
165        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
166        self.w
167    }
168}
169#[doc = "Reader of field `G4E`"]
170pub type G4E_R = crate::R<bool, bool>;
171#[doc = "Write proxy for field `G4E`"]
172pub struct G4E_W<'a> {
173    w: &'a mut W,
174}
175impl<'a> G4E_W<'a> {
176    #[doc = r"Sets the field bit"]
177    #[inline(always)]
178    pub fn set_bit(self) -> &'a mut W {
179        self.bit(true)
180    }
181    #[doc = r"Clears the field bit"]
182    #[inline(always)]
183    pub fn clear_bit(self) -> &'a mut W {
184        self.bit(false)
185    }
186    #[doc = r"Writes raw bits to the field"]
187    #[inline(always)]
188    pub fn bit(self, value: bool) -> &'a mut W {
189        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
190        self.w
191    }
192}
193#[doc = "Reader of field `G3E`"]
194pub type G3E_R = crate::R<bool, bool>;
195#[doc = "Write proxy for field `G3E`"]
196pub struct G3E_W<'a> {
197    w: &'a mut W,
198}
199impl<'a> G3E_W<'a> {
200    #[doc = r"Sets the field bit"]
201    #[inline(always)]
202    pub fn set_bit(self) -> &'a mut W {
203        self.bit(true)
204    }
205    #[doc = r"Clears the field bit"]
206    #[inline(always)]
207    pub fn clear_bit(self) -> &'a mut W {
208        self.bit(false)
209    }
210    #[doc = r"Writes raw bits to the field"]
211    #[inline(always)]
212    pub fn bit(self, value: bool) -> &'a mut W {
213        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
214        self.w
215    }
216}
217#[doc = "Reader of field `G2E`"]
218pub type G2E_R = crate::R<bool, bool>;
219#[doc = "Write proxy for field `G2E`"]
220pub struct G2E_W<'a> {
221    w: &'a mut W,
222}
223impl<'a> G2E_W<'a> {
224    #[doc = r"Sets the field bit"]
225    #[inline(always)]
226    pub fn set_bit(self) -> &'a mut W {
227        self.bit(true)
228    }
229    #[doc = r"Clears the field bit"]
230    #[inline(always)]
231    pub fn clear_bit(self) -> &'a mut W {
232        self.bit(false)
233    }
234    #[doc = r"Writes raw bits to the field"]
235    #[inline(always)]
236    pub fn bit(self, value: bool) -> &'a mut W {
237        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
238        self.w
239    }
240}
241#[doc = "Reader of field `G1E`"]
242pub type G1E_R = crate::R<bool, bool>;
243#[doc = "Write proxy for field `G1E`"]
244pub struct G1E_W<'a> {
245    w: &'a mut W,
246}
247impl<'a> G1E_W<'a> {
248    #[doc = r"Sets the field bit"]
249    #[inline(always)]
250    pub fn set_bit(self) -> &'a mut W {
251        self.bit(true)
252    }
253    #[doc = r"Clears the field bit"]
254    #[inline(always)]
255    pub fn clear_bit(self) -> &'a mut W {
256        self.bit(false)
257    }
258    #[doc = r"Writes raw bits to the field"]
259    #[inline(always)]
260    pub fn bit(self, value: bool) -> &'a mut W {
261        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
262        self.w
263    }
264}
265impl R {
266    #[doc = "Bit 23 - Analog I/O group x status"]
267    #[inline(always)]
268    pub fn g8s(&self) -> G8S_R {
269        G8S_R::new(((self.bits >> 23) & 0x01) != 0)
270    }
271    #[doc = "Bit 22 - Analog I/O group x status"]
272    #[inline(always)]
273    pub fn g7s(&self) -> G7S_R {
274        G7S_R::new(((self.bits >> 22) & 0x01) != 0)
275    }
276    #[doc = "Bit 21 - Analog I/O group x status"]
277    #[inline(always)]
278    pub fn g6s(&self) -> G6S_R {
279        G6S_R::new(((self.bits >> 21) & 0x01) != 0)
280    }
281    #[doc = "Bit 20 - Analog I/O group x status"]
282    #[inline(always)]
283    pub fn g5s(&self) -> G5S_R {
284        G5S_R::new(((self.bits >> 20) & 0x01) != 0)
285    }
286    #[doc = "Bit 19 - Analog I/O group x status"]
287    #[inline(always)]
288    pub fn g4s(&self) -> G4S_R {
289        G4S_R::new(((self.bits >> 19) & 0x01) != 0)
290    }
291    #[doc = "Bit 18 - Analog I/O group x status"]
292    #[inline(always)]
293    pub fn g3s(&self) -> G3S_R {
294        G3S_R::new(((self.bits >> 18) & 0x01) != 0)
295    }
296    #[doc = "Bit 17 - Analog I/O group x status"]
297    #[inline(always)]
298    pub fn g2s(&self) -> G2S_R {
299        G2S_R::new(((self.bits >> 17) & 0x01) != 0)
300    }
301    #[doc = "Bit 16 - Analog I/O group x status"]
302    #[inline(always)]
303    pub fn g1s(&self) -> G1S_R {
304        G1S_R::new(((self.bits >> 16) & 0x01) != 0)
305    }
306    #[doc = "Bit 7 - Analog I/O group x enable"]
307    #[inline(always)]
308    pub fn g8e(&self) -> G8E_R {
309        G8E_R::new(((self.bits >> 7) & 0x01) != 0)
310    }
311    #[doc = "Bit 6 - Analog I/O group x enable"]
312    #[inline(always)]
313    pub fn g7e(&self) -> G7E_R {
314        G7E_R::new(((self.bits >> 6) & 0x01) != 0)
315    }
316    #[doc = "Bit 5 - Analog I/O group x enable"]
317    #[inline(always)]
318    pub fn g6e(&self) -> G6E_R {
319        G6E_R::new(((self.bits >> 5) & 0x01) != 0)
320    }
321    #[doc = "Bit 4 - Analog I/O group x enable"]
322    #[inline(always)]
323    pub fn g5e(&self) -> G5E_R {
324        G5E_R::new(((self.bits >> 4) & 0x01) != 0)
325    }
326    #[doc = "Bit 3 - Analog I/O group x enable"]
327    #[inline(always)]
328    pub fn g4e(&self) -> G4E_R {
329        G4E_R::new(((self.bits >> 3) & 0x01) != 0)
330    }
331    #[doc = "Bit 2 - Analog I/O group x enable"]
332    #[inline(always)]
333    pub fn g3e(&self) -> G3E_R {
334        G3E_R::new(((self.bits >> 2) & 0x01) != 0)
335    }
336    #[doc = "Bit 1 - Analog I/O group x enable"]
337    #[inline(always)]
338    pub fn g2e(&self) -> G2E_R {
339        G2E_R::new(((self.bits >> 1) & 0x01) != 0)
340    }
341    #[doc = "Bit 0 - Analog I/O group x enable"]
342    #[inline(always)]
343    pub fn g1e(&self) -> G1E_R {
344        G1E_R::new((self.bits & 0x01) != 0)
345    }
346}
347impl W {
348    #[doc = "Bit 23 - Analog I/O group x status"]
349    #[inline(always)]
350    pub fn g8s(&mut self) -> G8S_W {
351        G8S_W { w: self }
352    }
353    #[doc = "Bit 22 - Analog I/O group x status"]
354    #[inline(always)]
355    pub fn g7s(&mut self) -> G7S_W {
356        G7S_W { w: self }
357    }
358    #[doc = "Bit 7 - Analog I/O group x enable"]
359    #[inline(always)]
360    pub fn g8e(&mut self) -> G8E_W {
361        G8E_W { w: self }
362    }
363    #[doc = "Bit 6 - Analog I/O group x enable"]
364    #[inline(always)]
365    pub fn g7e(&mut self) -> G7E_W {
366        G7E_W { w: self }
367    }
368    #[doc = "Bit 5 - Analog I/O group x enable"]
369    #[inline(always)]
370    pub fn g6e(&mut self) -> G6E_W {
371        G6E_W { w: self }
372    }
373    #[doc = "Bit 4 - Analog I/O group x enable"]
374    #[inline(always)]
375    pub fn g5e(&mut self) -> G5E_W {
376        G5E_W { w: self }
377    }
378    #[doc = "Bit 3 - Analog I/O group x enable"]
379    #[inline(always)]
380    pub fn g4e(&mut self) -> G4E_W {
381        G4E_W { w: self }
382    }
383    #[doc = "Bit 2 - Analog I/O group x enable"]
384    #[inline(always)]
385    pub fn g3e(&mut self) -> G3E_W {
386        G3E_W { w: self }
387    }
388    #[doc = "Bit 1 - Analog I/O group x enable"]
389    #[inline(always)]
390    pub fn g2e(&mut self) -> G2E_W {
391        G2E_W { w: self }
392    }
393    #[doc = "Bit 0 - Analog I/O group x enable"]
394    #[inline(always)]
395    pub fn g1e(&mut self) -> G1E_W {
396        G1E_W { w: self }
397    }
398}