stm32wb_pac/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 `G7S`"]
14pub type G7S_R = crate::R<bool, bool>;
15#[doc = "Reader of field `G6S`"]
16pub type G6S_R = crate::R<bool, bool>;
17#[doc = "Reader of field `G5S`"]
18pub type G5S_R = crate::R<bool, bool>;
19#[doc = "Reader of field `G4S`"]
20pub type G4S_R = crate::R<bool, bool>;
21#[doc = "Reader of field `G3S`"]
22pub type G3S_R = crate::R<bool, bool>;
23#[doc = "Reader of field `G2S`"]
24pub type G2S_R = crate::R<bool, bool>;
25#[doc = "Reader of field `G1S`"]
26pub type G1S_R = crate::R<bool, bool>;
27#[doc = "Reader of field `G7E`"]
28pub type G7E_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `G7E`"]
30pub struct G7E_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> G7E_W<'a> {
34    #[doc = r"Sets the field bit"]
35    #[inline(always)]
36    pub fn set_bit(self) -> &'a mut W {
37        self.bit(true)
38    }
39    #[doc = r"Clears the field bit"]
40    #[inline(always)]
41    pub fn clear_bit(self) -> &'a mut W {
42        self.bit(false)
43    }
44    #[doc = r"Writes raw bits to the field"]
45    #[inline(always)]
46    pub fn bit(self, value: bool) -> &'a mut W {
47        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
48        self.w
49    }
50}
51#[doc = "Reader of field `G6E`"]
52pub type G6E_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `G6E`"]
54pub struct G6E_W<'a> {
55    w: &'a mut W,
56}
57impl<'a> G6E_W<'a> {
58    #[doc = r"Sets the field bit"]
59    #[inline(always)]
60    pub fn set_bit(self) -> &'a mut W {
61        self.bit(true)
62    }
63    #[doc = r"Clears the field bit"]
64    #[inline(always)]
65    pub fn clear_bit(self) -> &'a mut W {
66        self.bit(false)
67    }
68    #[doc = r"Writes raw bits to the field"]
69    #[inline(always)]
70    pub fn bit(self, value: bool) -> &'a mut W {
71        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
72        self.w
73    }
74}
75#[doc = "Reader of field `G5E`"]
76pub type G5E_R = crate::R<bool, bool>;
77#[doc = "Write proxy for field `G5E`"]
78pub struct G5E_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> G5E_W<'a> {
82    #[doc = r"Sets the field bit"]
83    #[inline(always)]
84    pub fn set_bit(self) -> &'a mut W {
85        self.bit(true)
86    }
87    #[doc = r"Clears the field bit"]
88    #[inline(always)]
89    pub fn clear_bit(self) -> &'a mut W {
90        self.bit(false)
91    }
92    #[doc = r"Writes raw bits to the field"]
93    #[inline(always)]
94    pub fn bit(self, value: bool) -> &'a mut W {
95        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
96        self.w
97    }
98}
99#[doc = "Reader of field `G4E`"]
100pub type G4E_R = crate::R<bool, bool>;
101#[doc = "Write proxy for field `G4E`"]
102pub struct G4E_W<'a> {
103    w: &'a mut W,
104}
105impl<'a> G4E_W<'a> {
106    #[doc = r"Sets the field bit"]
107    #[inline(always)]
108    pub fn set_bit(self) -> &'a mut W {
109        self.bit(true)
110    }
111    #[doc = r"Clears the field bit"]
112    #[inline(always)]
113    pub fn clear_bit(self) -> &'a mut W {
114        self.bit(false)
115    }
116    #[doc = r"Writes raw bits to the field"]
117    #[inline(always)]
118    pub fn bit(self, value: bool) -> &'a mut W {
119        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
120        self.w
121    }
122}
123#[doc = "Reader of field `G3E`"]
124pub type G3E_R = crate::R<bool, bool>;
125#[doc = "Write proxy for field `G3E`"]
126pub struct G3E_W<'a> {
127    w: &'a mut W,
128}
129impl<'a> G3E_W<'a> {
130    #[doc = r"Sets the field bit"]
131    #[inline(always)]
132    pub fn set_bit(self) -> &'a mut W {
133        self.bit(true)
134    }
135    #[doc = r"Clears the field bit"]
136    #[inline(always)]
137    pub fn clear_bit(self) -> &'a mut W {
138        self.bit(false)
139    }
140    #[doc = r"Writes raw bits to the field"]
141    #[inline(always)]
142    pub fn bit(self, value: bool) -> &'a mut W {
143        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
144        self.w
145    }
146}
147#[doc = "Reader of field `G2E`"]
148pub type G2E_R = crate::R<bool, bool>;
149#[doc = "Write proxy for field `G2E`"]
150pub struct G2E_W<'a> {
151    w: &'a mut W,
152}
153impl<'a> G2E_W<'a> {
154    #[doc = r"Sets the field bit"]
155    #[inline(always)]
156    pub fn set_bit(self) -> &'a mut W {
157        self.bit(true)
158    }
159    #[doc = r"Clears the field bit"]
160    #[inline(always)]
161    pub fn clear_bit(self) -> &'a mut W {
162        self.bit(false)
163    }
164    #[doc = r"Writes raw bits to the field"]
165    #[inline(always)]
166    pub fn bit(self, value: bool) -> &'a mut W {
167        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
168        self.w
169    }
170}
171#[doc = "Reader of field `G1E`"]
172pub type G1E_R = crate::R<bool, bool>;
173#[doc = "Write proxy for field `G1E`"]
174pub struct G1E_W<'a> {
175    w: &'a mut W,
176}
177impl<'a> G1E_W<'a> {
178    #[doc = r"Sets the field bit"]
179    #[inline(always)]
180    pub fn set_bit(self) -> &'a mut W {
181        self.bit(true)
182    }
183    #[doc = r"Clears the field bit"]
184    #[inline(always)]
185    pub fn clear_bit(self) -> &'a mut W {
186        self.bit(false)
187    }
188    #[doc = r"Writes raw bits to the field"]
189    #[inline(always)]
190    pub fn bit(self, value: bool) -> &'a mut W {
191        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
192        self.w
193    }
194}
195impl R {
196    #[doc = "Bit 22 - Analog I/O group x status"]
197    #[inline(always)]
198    pub fn g7s(&self) -> G7S_R {
199        G7S_R::new(((self.bits >> 22) & 0x01) != 0)
200    }
201    #[doc = "Bit 21 - Analog I/O group x status"]
202    #[inline(always)]
203    pub fn g6s(&self) -> G6S_R {
204        G6S_R::new(((self.bits >> 21) & 0x01) != 0)
205    }
206    #[doc = "Bit 20 - Analog I/O group x status"]
207    #[inline(always)]
208    pub fn g5s(&self) -> G5S_R {
209        G5S_R::new(((self.bits >> 20) & 0x01) != 0)
210    }
211    #[doc = "Bit 19 - Analog I/O group x status"]
212    #[inline(always)]
213    pub fn g4s(&self) -> G4S_R {
214        G4S_R::new(((self.bits >> 19) & 0x01) != 0)
215    }
216    #[doc = "Bit 18 - Analog I/O group x status"]
217    #[inline(always)]
218    pub fn g3s(&self) -> G3S_R {
219        G3S_R::new(((self.bits >> 18) & 0x01) != 0)
220    }
221    #[doc = "Bit 17 - Analog I/O group x status"]
222    #[inline(always)]
223    pub fn g2s(&self) -> G2S_R {
224        G2S_R::new(((self.bits >> 17) & 0x01) != 0)
225    }
226    #[doc = "Bit 16 - Analog I/O group x status"]
227    #[inline(always)]
228    pub fn g1s(&self) -> G1S_R {
229        G1S_R::new(((self.bits >> 16) & 0x01) != 0)
230    }
231    #[doc = "Bit 6 - Analog I/O group x enable"]
232    #[inline(always)]
233    pub fn g7e(&self) -> G7E_R {
234        G7E_R::new(((self.bits >> 6) & 0x01) != 0)
235    }
236    #[doc = "Bit 5 - Analog I/O group x enable"]
237    #[inline(always)]
238    pub fn g6e(&self) -> G6E_R {
239        G6E_R::new(((self.bits >> 5) & 0x01) != 0)
240    }
241    #[doc = "Bit 4 - Analog I/O group x enable"]
242    #[inline(always)]
243    pub fn g5e(&self) -> G5E_R {
244        G5E_R::new(((self.bits >> 4) & 0x01) != 0)
245    }
246    #[doc = "Bit 3 - Analog I/O group x enable"]
247    #[inline(always)]
248    pub fn g4e(&self) -> G4E_R {
249        G4E_R::new(((self.bits >> 3) & 0x01) != 0)
250    }
251    #[doc = "Bit 2 - Analog I/O group x enable"]
252    #[inline(always)]
253    pub fn g3e(&self) -> G3E_R {
254        G3E_R::new(((self.bits >> 2) & 0x01) != 0)
255    }
256    #[doc = "Bit 1 - Analog I/O group x enable"]
257    #[inline(always)]
258    pub fn g2e(&self) -> G2E_R {
259        G2E_R::new(((self.bits >> 1) & 0x01) != 0)
260    }
261    #[doc = "Bit 0 - Analog I/O group x enable"]
262    #[inline(always)]
263    pub fn g1e(&self) -> G1E_R {
264        G1E_R::new((self.bits & 0x01) != 0)
265    }
266}
267impl W {
268    #[doc = "Bit 6 - Analog I/O group x enable"]
269    #[inline(always)]
270    pub fn g7e(&mut self) -> G7E_W {
271        G7E_W { w: self }
272    }
273    #[doc = "Bit 5 - Analog I/O group x enable"]
274    #[inline(always)]
275    pub fn g6e(&mut self) -> G6E_W {
276        G6E_W { w: self }
277    }
278    #[doc = "Bit 4 - Analog I/O group x enable"]
279    #[inline(always)]
280    pub fn g5e(&mut self) -> G5E_W {
281        G5E_W { w: self }
282    }
283    #[doc = "Bit 3 - Analog I/O group x enable"]
284    #[inline(always)]
285    pub fn g4e(&mut self) -> G4E_W {
286        G4E_W { w: self }
287    }
288    #[doc = "Bit 2 - Analog I/O group x enable"]
289    #[inline(always)]
290    pub fn g3e(&mut self) -> G3E_W {
291        G3E_W { w: self }
292    }
293    #[doc = "Bit 1 - Analog I/O group x enable"]
294    #[inline(always)]
295    pub fn g2e(&mut self) -> G2E_W {
296        G2E_W { w: self }
297    }
298    #[doc = "Bit 0 - Analog I/O group x enable"]
299    #[inline(always)]
300    pub fn g1e(&mut self) -> G1E_W {
301        G1E_W { w: self }
302    }
303}