ra2e2/gpt164/
gtclr.rs

1#[doc = "Register `GTCLR` writer"]
2pub struct W(crate::W<GTCLR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<GTCLR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<GTCLR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<GTCLR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24pub enum CCLR0_AW {
25    #[doc = "0: GTCNT counter is not cleared"]
26    _0 = 0,
27    #[doc = "1: GTCNT counter is cleared"]
28    _1 = 1,
29}
30impl From<CCLR0_AW> for bool {
31    #[inline(always)]
32    fn from(variant: CCLR0_AW) -> Self {
33        variant as u8 != 0
34    }
35}
36#[doc = "Field `CCLR0` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
37pub type CCLR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR0_AW, O>;
38impl<'a, const O: u8> CCLR0_W<'a, O> {
39    #[doc = "GTCNT counter is not cleared"]
40    #[inline(always)]
41    pub fn _0(self) -> &'a mut W {
42        self.variant(CCLR0_AW::_0)
43    }
44    #[doc = "GTCNT counter is cleared"]
45    #[inline(always)]
46    pub fn _1(self) -> &'a mut W {
47        self.variant(CCLR0_AW::_1)
48    }
49}
50#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
51#[derive(Clone, Copy, Debug, PartialEq, Eq)]
52pub enum CCLR1_AW {
53    #[doc = "0: GTCNT counter is not cleared"]
54    _0 = 0,
55    #[doc = "1: GTCNT counter is cleared"]
56    _1 = 1,
57}
58impl From<CCLR1_AW> for bool {
59    #[inline(always)]
60    fn from(variant: CCLR1_AW) -> Self {
61        variant as u8 != 0
62    }
63}
64#[doc = "Field `CCLR1` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
65pub type CCLR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR1_AW, O>;
66impl<'a, const O: u8> CCLR1_W<'a, O> {
67    #[doc = "GTCNT counter is not cleared"]
68    #[inline(always)]
69    pub fn _0(self) -> &'a mut W {
70        self.variant(CCLR1_AW::_0)
71    }
72    #[doc = "GTCNT counter is cleared"]
73    #[inline(always)]
74    pub fn _1(self) -> &'a mut W {
75        self.variant(CCLR1_AW::_1)
76    }
77}
78#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum CCLR2_AW {
81    #[doc = "0: GTCNT counter is not cleared"]
82    _0 = 0,
83    #[doc = "1: GTCNT counter is cleared"]
84    _1 = 1,
85}
86impl From<CCLR2_AW> for bool {
87    #[inline(always)]
88    fn from(variant: CCLR2_AW) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `CCLR2` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
93pub type CCLR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR2_AW, O>;
94impl<'a, const O: u8> CCLR2_W<'a, O> {
95    #[doc = "GTCNT counter is not cleared"]
96    #[inline(always)]
97    pub fn _0(self) -> &'a mut W {
98        self.variant(CCLR2_AW::_0)
99    }
100    #[doc = "GTCNT counter is cleared"]
101    #[inline(always)]
102    pub fn _1(self) -> &'a mut W {
103        self.variant(CCLR2_AW::_1)
104    }
105}
106#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
107#[derive(Clone, Copy, Debug, PartialEq, Eq)]
108pub enum CCLR3_AW {
109    #[doc = "0: GTCNT counter is not cleared"]
110    _0 = 0,
111    #[doc = "1: GTCNT counter is cleared"]
112    _1 = 1,
113}
114impl From<CCLR3_AW> for bool {
115    #[inline(always)]
116    fn from(variant: CCLR3_AW) -> Self {
117        variant as u8 != 0
118    }
119}
120#[doc = "Field `CCLR3` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
121pub type CCLR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR3_AW, O>;
122impl<'a, const O: u8> CCLR3_W<'a, O> {
123    #[doc = "GTCNT counter is not cleared"]
124    #[inline(always)]
125    pub fn _0(self) -> &'a mut W {
126        self.variant(CCLR3_AW::_0)
127    }
128    #[doc = "GTCNT counter is cleared"]
129    #[inline(always)]
130    pub fn _1(self) -> &'a mut W {
131        self.variant(CCLR3_AW::_1)
132    }
133}
134#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
135#[derive(Clone, Copy, Debug, PartialEq, Eq)]
136pub enum CCLR4_AW {
137    #[doc = "0: GTCNT counter is not cleared"]
138    _0 = 0,
139    #[doc = "1: GTCNT counter is cleared"]
140    _1 = 1,
141}
142impl From<CCLR4_AW> for bool {
143    #[inline(always)]
144    fn from(variant: CCLR4_AW) -> Self {
145        variant as u8 != 0
146    }
147}
148#[doc = "Field `CCLR4` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
149pub type CCLR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR4_AW, O>;
150impl<'a, const O: u8> CCLR4_W<'a, O> {
151    #[doc = "GTCNT counter is not cleared"]
152    #[inline(always)]
153    pub fn _0(self) -> &'a mut W {
154        self.variant(CCLR4_AW::_0)
155    }
156    #[doc = "GTCNT counter is cleared"]
157    #[inline(always)]
158    pub fn _1(self) -> &'a mut W {
159        self.variant(CCLR4_AW::_1)
160    }
161}
162#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum CCLR5_AW {
165    #[doc = "0: GTCNT counter is not cleared"]
166    _0 = 0,
167    #[doc = "1: GTCNT counter is cleared"]
168    _1 = 1,
169}
170impl From<CCLR5_AW> for bool {
171    #[inline(always)]
172    fn from(variant: CCLR5_AW) -> Self {
173        variant as u8 != 0
174    }
175}
176#[doc = "Field `CCLR5` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
177pub type CCLR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR5_AW, O>;
178impl<'a, const O: u8> CCLR5_W<'a, O> {
179    #[doc = "GTCNT counter is not cleared"]
180    #[inline(always)]
181    pub fn _0(self) -> &'a mut W {
182        self.variant(CCLR5_AW::_0)
183    }
184    #[doc = "GTCNT counter is cleared"]
185    #[inline(always)]
186    pub fn _1(self) -> &'a mut W {
187        self.variant(CCLR5_AW::_1)
188    }
189}
190#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
191#[derive(Clone, Copy, Debug, PartialEq, Eq)]
192pub enum CCLR6_AW {
193    #[doc = "0: GTCNT counter is not cleared"]
194    _0 = 0,
195    #[doc = "1: GTCNT counter is cleared"]
196    _1 = 1,
197}
198impl From<CCLR6_AW> for bool {
199    #[inline(always)]
200    fn from(variant: CCLR6_AW) -> Self {
201        variant as u8 != 0
202    }
203}
204#[doc = "Field `CCLR6` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
205pub type CCLR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR6_AW, O>;
206impl<'a, const O: u8> CCLR6_W<'a, O> {
207    #[doc = "GTCNT counter is not cleared"]
208    #[inline(always)]
209    pub fn _0(self) -> &'a mut W {
210        self.variant(CCLR6_AW::_0)
211    }
212    #[doc = "GTCNT counter is cleared"]
213    #[inline(always)]
214    pub fn _1(self) -> &'a mut W {
215        self.variant(CCLR6_AW::_1)
216    }
217}
218#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
219#[derive(Clone, Copy, Debug, PartialEq, Eq)]
220pub enum CCLR7_AW {
221    #[doc = "0: GTCNT counter is not cleared"]
222    _0 = 0,
223    #[doc = "1: GTCNT counter is cleared"]
224    _1 = 1,
225}
226impl From<CCLR7_AW> for bool {
227    #[inline(always)]
228    fn from(variant: CCLR7_AW) -> Self {
229        variant as u8 != 0
230    }
231}
232#[doc = "Field `CCLR7` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
233pub type CCLR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR7_AW, O>;
234impl<'a, const O: u8> CCLR7_W<'a, O> {
235    #[doc = "GTCNT counter is not cleared"]
236    #[inline(always)]
237    pub fn _0(self) -> &'a mut W {
238        self.variant(CCLR7_AW::_0)
239    }
240    #[doc = "GTCNT counter is cleared"]
241    #[inline(always)]
242    pub fn _1(self) -> &'a mut W {
243        self.variant(CCLR7_AW::_1)
244    }
245}
246#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
247#[derive(Clone, Copy, Debug, PartialEq, Eq)]
248pub enum CCLR8_AW {
249    #[doc = "0: GTCNT counter is not cleared"]
250    _0 = 0,
251    #[doc = "1: GTCNT counter is cleared"]
252    _1 = 1,
253}
254impl From<CCLR8_AW> for bool {
255    #[inline(always)]
256    fn from(variant: CCLR8_AW) -> Self {
257        variant as u8 != 0
258    }
259}
260#[doc = "Field `CCLR8` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
261pub type CCLR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR8_AW, O>;
262impl<'a, const O: u8> CCLR8_W<'a, O> {
263    #[doc = "GTCNT counter is not cleared"]
264    #[inline(always)]
265    pub fn _0(self) -> &'a mut W {
266        self.variant(CCLR8_AW::_0)
267    }
268    #[doc = "GTCNT counter is cleared"]
269    #[inline(always)]
270    pub fn _1(self) -> &'a mut W {
271        self.variant(CCLR8_AW::_1)
272    }
273}
274#[doc = "Channel n GTCNT Count Clear (n : the same as bit position value)\n\nValue on reset: 0"]
275#[derive(Clone, Copy, Debug, PartialEq, Eq)]
276pub enum CCLR9_AW {
277    #[doc = "0: GTCNT counter is not cleared"]
278    _0 = 0,
279    #[doc = "1: GTCNT counter is cleared"]
280    _1 = 1,
281}
282impl From<CCLR9_AW> for bool {
283    #[inline(always)]
284    fn from(variant: CCLR9_AW) -> Self {
285        variant as u8 != 0
286    }
287}
288#[doc = "Field `CCLR9` writer - Channel n GTCNT Count Clear (n : the same as bit position value)"]
289pub type CCLR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTCLR_SPEC, CCLR9_AW, O>;
290impl<'a, const O: u8> CCLR9_W<'a, O> {
291    #[doc = "GTCNT counter is not cleared"]
292    #[inline(always)]
293    pub fn _0(self) -> &'a mut W {
294        self.variant(CCLR9_AW::_0)
295    }
296    #[doc = "GTCNT counter is cleared"]
297    #[inline(always)]
298    pub fn _1(self) -> &'a mut W {
299        self.variant(CCLR9_AW::_1)
300    }
301}
302impl W {
303    #[doc = "Bit 0 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
304    #[inline(always)]
305    #[must_use]
306    pub fn cclr0(&mut self) -> CCLR0_W<0> {
307        CCLR0_W::new(self)
308    }
309    #[doc = "Bit 1 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
310    #[inline(always)]
311    #[must_use]
312    pub fn cclr1(&mut self) -> CCLR1_W<1> {
313        CCLR1_W::new(self)
314    }
315    #[doc = "Bit 2 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
316    #[inline(always)]
317    #[must_use]
318    pub fn cclr2(&mut self) -> CCLR2_W<2> {
319        CCLR2_W::new(self)
320    }
321    #[doc = "Bit 3 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
322    #[inline(always)]
323    #[must_use]
324    pub fn cclr3(&mut self) -> CCLR3_W<3> {
325        CCLR3_W::new(self)
326    }
327    #[doc = "Bit 4 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
328    #[inline(always)]
329    #[must_use]
330    pub fn cclr4(&mut self) -> CCLR4_W<4> {
331        CCLR4_W::new(self)
332    }
333    #[doc = "Bit 5 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
334    #[inline(always)]
335    #[must_use]
336    pub fn cclr5(&mut self) -> CCLR5_W<5> {
337        CCLR5_W::new(self)
338    }
339    #[doc = "Bit 6 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
340    #[inline(always)]
341    #[must_use]
342    pub fn cclr6(&mut self) -> CCLR6_W<6> {
343        CCLR6_W::new(self)
344    }
345    #[doc = "Bit 7 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
346    #[inline(always)]
347    #[must_use]
348    pub fn cclr7(&mut self) -> CCLR7_W<7> {
349        CCLR7_W::new(self)
350    }
351    #[doc = "Bit 8 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
352    #[inline(always)]
353    #[must_use]
354    pub fn cclr8(&mut self) -> CCLR8_W<8> {
355        CCLR8_W::new(self)
356    }
357    #[doc = "Bit 9 - Channel n GTCNT Count Clear (n : the same as bit position value)"]
358    #[inline(always)]
359    #[must_use]
360    pub fn cclr9(&mut self) -> CCLR9_W<9> {
361        CCLR9_W::new(self)
362    }
363    #[doc = "Writes raw bits to the register."]
364    #[inline(always)]
365    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
366        self.0.bits(bits);
367        self
368    }
369}
370#[doc = "General PWM Timer Software Clear Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gtclr](index.html) module"]
371pub struct GTCLR_SPEC;
372impl crate::RegisterSpec for GTCLR_SPEC {
373    type Ux = u32;
374}
375#[doc = "`write(|w| ..)` method takes [gtclr::W](W) writer structure"]
376impl crate::Writable for GTCLR_SPEC {
377    type Writer = W;
378    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
379    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
380}
381#[doc = "`reset()` method sets GTCLR to value 0"]
382impl crate::Resettable for GTCLR_SPEC {
383    const RESET_VALUE: Self::Ux = 0;
384}