da14697_pac/
timer.rs

1/*
2DISCLAIMER
3This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
4No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5applicable laws, including copyright laws.
6THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
7OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
8NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
9LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
10INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
11ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
13of this software. By using this software, you agree to the additional terms and conditions found by accessing the
14following link:
15http://www.renesas.com/disclaimer
16
17*/
18// Generated from SVD 1.2, with svd2pac 0.6.0 on Thu, 24 Jul 2025 04:45:38 +0000
19
20#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"TIMER registers"]
28unsafe impl ::core::marker::Send for super::Timer {}
29unsafe impl ::core::marker::Sync for super::Timer {}
30impl super::Timer {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "Timer value for event on GPIO1"]
38    #[inline(always)]
39    pub const fn timer_capture_gpio1_reg(
40        &self,
41    ) -> &'static crate::common::Reg<self::TimerCaptureGpio1Reg_SPEC, crate::common::RW> {
42        unsafe {
43            crate::common::Reg::<self::TimerCaptureGpio1Reg_SPEC, crate::common::RW>::from_ptr(
44                self._svd2pac_as_ptr().add(32usize),
45            )
46        }
47    }
48
49    #[doc = "Timer value for event on GPIO2"]
50    #[inline(always)]
51    pub const fn timer_capture_gpio2_reg(
52        &self,
53    ) -> &'static crate::common::Reg<self::TimerCaptureGpio2Reg_SPEC, crate::common::RW> {
54        unsafe {
55            crate::common::Reg::<self::TimerCaptureGpio2Reg_SPEC, crate::common::RW>::from_ptr(
56                self._svd2pac_as_ptr().add(36usize),
57            )
58        }
59    }
60
61    #[doc = "Timer value for event on GPIO1"]
62    #[inline(always)]
63    pub const fn timer_capture_gpio3_reg(
64        &self,
65    ) -> &'static crate::common::Reg<self::TimerCaptureGpio3Reg_SPEC, crate::common::RW> {
66        unsafe {
67            crate::common::Reg::<self::TimerCaptureGpio3Reg_SPEC, crate::common::RW>::from_ptr(
68                self._svd2pac_as_ptr().add(60usize),
69            )
70        }
71    }
72
73    #[doc = "Timer value for event on GPIO1"]
74    #[inline(always)]
75    pub const fn timer_capture_gpio4_reg(
76        &self,
77    ) -> &'static crate::common::Reg<self::TimerCaptureGpio4Reg_SPEC, crate::common::RW> {
78        unsafe {
79            crate::common::Reg::<self::TimerCaptureGpio4Reg_SPEC, crate::common::RW>::from_ptr(
80                self._svd2pac_as_ptr().add(64usize),
81            )
82        }
83    }
84
85    #[doc = "Timer clear gpio event register"]
86    #[inline(always)]
87    pub const fn timer_clear_gpio_event_reg(
88        &self,
89    ) -> &'static crate::common::Reg<self::TimerClearGpioEventReg_SPEC, crate::common::RW> {
90        unsafe {
91            crate::common::Reg::<self::TimerClearGpioEventReg_SPEC, crate::common::RW>::from_ptr(
92                self._svd2pac_as_ptr().add(68usize),
93            )
94        }
95    }
96
97    #[doc = "Timer clear interrupt"]
98    #[inline(always)]
99    pub const fn timer_clear_irq_reg(
100        &self,
101    ) -> &'static crate::common::Reg<self::TimerClearIrqReg_SPEC, crate::common::RW> {
102        unsafe {
103            crate::common::Reg::<self::TimerClearIrqReg_SPEC, crate::common::RW>::from_ptr(
104                self._svd2pac_as_ptr().add(72usize),
105            )
106        }
107    }
108
109    #[doc = "Timer control register"]
110    #[inline(always)]
111    pub const fn timer_ctrl_reg(
112        &self,
113    ) -> &'static crate::common::Reg<self::TimerCtrlReg_SPEC, crate::common::RW> {
114        unsafe {
115            crate::common::Reg::<self::TimerCtrlReg_SPEC, crate::common::RW>::from_ptr(
116                self._svd2pac_as_ptr().add(0usize),
117            )
118        }
119    }
120
121    #[doc = "Timer gpio1 selection"]
122    #[inline(always)]
123    pub const fn timer_gpio1_conf_reg(
124        &self,
125    ) -> &'static crate::common::Reg<self::TimerGpio1ConfReg_SPEC, crate::common::RW> {
126        unsafe {
127            crate::common::Reg::<self::TimerGpio1ConfReg_SPEC, crate::common::RW>::from_ptr(
128                self._svd2pac_as_ptr().add(12usize),
129            )
130        }
131    }
132
133    #[doc = "Timer gpio2 selection"]
134    #[inline(always)]
135    pub const fn timer_gpio2_conf_reg(
136        &self,
137    ) -> &'static crate::common::Reg<self::TimerGpio2ConfReg_SPEC, crate::common::RW> {
138        unsafe {
139            crate::common::Reg::<self::TimerGpio2ConfReg_SPEC, crate::common::RW>::from_ptr(
140                self._svd2pac_as_ptr().add(16usize),
141            )
142        }
143    }
144
145    #[doc = "Timer gpio3 selection"]
146    #[inline(always)]
147    pub const fn timer_gpio3_conf_reg(
148        &self,
149    ) -> &'static crate::common::Reg<self::TimerGpio3ConfReg_SPEC, crate::common::RW> {
150        unsafe {
151            crate::common::Reg::<self::TimerGpio3ConfReg_SPEC, crate::common::RW>::from_ptr(
152                self._svd2pac_as_ptr().add(52usize),
153            )
154        }
155    }
156
157    #[doc = "Timer gpio4 selection"]
158    #[inline(always)]
159    pub const fn timer_gpio4_conf_reg(
160        &self,
161    ) -> &'static crate::common::Reg<self::TimerGpio4ConfReg_SPEC, crate::common::RW> {
162        unsafe {
163            crate::common::Reg::<self::TimerGpio4ConfReg_SPEC, crate::common::RW>::from_ptr(
164                self._svd2pac_as_ptr().add(56usize),
165            )
166        }
167    }
168
169    #[doc = "Timer prescaler value"]
170    #[inline(always)]
171    pub const fn timer_prescaler_reg(
172        &self,
173    ) -> &'static crate::common::Reg<self::TimerPrescalerReg_SPEC, crate::common::RW> {
174        unsafe {
175            crate::common::Reg::<self::TimerPrescalerReg_SPEC, crate::common::RW>::from_ptr(
176                self._svd2pac_as_ptr().add(28usize),
177            )
178        }
179    }
180
181    #[doc = "Timer prescaler counter valuew"]
182    #[inline(always)]
183    pub const fn timer_prescaler_val_reg(
184        &self,
185    ) -> &'static crate::common::Reg<self::TimerPrescalerValReg_SPEC, crate::common::RW> {
186        unsafe {
187            crate::common::Reg::<self::TimerPrescalerValReg_SPEC, crate::common::RW>::from_ptr(
188                self._svd2pac_as_ptr().add(40usize),
189            )
190        }
191    }
192
193    #[doc = "Timer pwm dc register"]
194    #[inline(always)]
195    pub const fn timer_pwm_dc_reg(
196        &self,
197    ) -> &'static crate::common::Reg<self::TimerPwmDcReg_SPEC, crate::common::RW> {
198        unsafe {
199            crate::common::Reg::<self::TimerPwmDcReg_SPEC, crate::common::RW>::from_ptr(
200                self._svd2pac_as_ptr().add(48usize),
201            )
202        }
203    }
204
205    #[doc = "Timer pwm frequency register"]
206    #[inline(always)]
207    pub const fn timer_pwm_freq_reg(
208        &self,
209    ) -> &'static crate::common::Reg<self::TimerPwmFreqReg_SPEC, crate::common::RW> {
210        unsafe {
211            crate::common::Reg::<self::TimerPwmFreqReg_SPEC, crate::common::RW>::from_ptr(
212                self._svd2pac_as_ptr().add(44usize),
213            )
214        }
215    }
216
217    #[doc = "Timer reload value and Delay in shot mode"]
218    #[inline(always)]
219    pub const fn timer_reload_reg(
220        &self,
221    ) -> &'static crate::common::Reg<self::TimerReloadReg_SPEC, crate::common::RW> {
222        unsafe {
223            crate::common::Reg::<self::TimerReloadReg_SPEC, crate::common::RW>::from_ptr(
224                self._svd2pac_as_ptr().add(20usize),
225            )
226        }
227    }
228
229    #[doc = "Timer Shot duration in shot mode"]
230    #[inline(always)]
231    pub const fn timer_shotwidth_reg(
232        &self,
233    ) -> &'static crate::common::Reg<self::TimerShotwidthReg_SPEC, crate::common::RW> {
234        unsafe {
235            crate::common::Reg::<self::TimerShotwidthReg_SPEC, crate::common::RW>::from_ptr(
236                self._svd2pac_as_ptr().add(24usize),
237            )
238        }
239    }
240
241    #[doc = "Timer status register"]
242    #[inline(always)]
243    pub const fn timer_status_reg(
244        &self,
245    ) -> &'static crate::common::Reg<self::TimerStatusReg_SPEC, crate::common::RW> {
246        unsafe {
247            crate::common::Reg::<self::TimerStatusReg_SPEC, crate::common::RW>::from_ptr(
248                self._svd2pac_as_ptr().add(8usize),
249            )
250        }
251    }
252
253    #[doc = "Timer counter value"]
254    #[inline(always)]
255    pub const fn timer_timer_val_reg(
256        &self,
257    ) -> &'static crate::common::Reg<self::TimerTimerValReg_SPEC, crate::common::RW> {
258        unsafe {
259            crate::common::Reg::<self::TimerTimerValReg_SPEC, crate::common::RW>::from_ptr(
260                self._svd2pac_as_ptr().add(4usize),
261            )
262        }
263    }
264}
265#[doc(hidden)]
266#[derive(Copy, Clone, Eq, PartialEq)]
267pub struct TimerCaptureGpio1Reg_SPEC;
268impl crate::sealed::RegSpec for TimerCaptureGpio1Reg_SPEC {
269    type DataType = u32;
270}
271
272#[doc = "Timer value for event on GPIO1"]
273pub type TimerCaptureGpio1Reg = crate::RegValueT<TimerCaptureGpio1Reg_SPEC>;
274
275impl TimerCaptureGpio1Reg {
276    #[doc = "Gives the Capture time for event on GPIO1"]
277    #[inline(always)]
278    pub fn tim_capture_gpio1(
279        self,
280    ) -> crate::common::RegisterField<
281        0,
282        0xffffff,
283        1,
284        0,
285        u32,
286        u32,
287        TimerCaptureGpio1Reg_SPEC,
288        crate::common::R,
289    > {
290        crate::common::RegisterField::<
291            0,
292            0xffffff,
293            1,
294            0,
295            u32,
296            u32,
297            TimerCaptureGpio1Reg_SPEC,
298            crate::common::R,
299        >::from_register(self, 0)
300    }
301}
302impl ::core::default::Default for TimerCaptureGpio1Reg {
303    #[inline(always)]
304    fn default() -> TimerCaptureGpio1Reg {
305        <crate::RegValueT<TimerCaptureGpio1Reg_SPEC> as RegisterValue<_>>::new(0)
306    }
307}
308
309#[doc(hidden)]
310#[derive(Copy, Clone, Eq, PartialEq)]
311pub struct TimerCaptureGpio2Reg_SPEC;
312impl crate::sealed::RegSpec for TimerCaptureGpio2Reg_SPEC {
313    type DataType = u32;
314}
315
316#[doc = "Timer value for event on GPIO2"]
317pub type TimerCaptureGpio2Reg = crate::RegValueT<TimerCaptureGpio2Reg_SPEC>;
318
319impl TimerCaptureGpio2Reg {
320    #[doc = "Gives the Capture time for event on GPIO2"]
321    #[inline(always)]
322    pub fn tim_capture_gpio2(
323        self,
324    ) -> crate::common::RegisterField<
325        0,
326        0xffffff,
327        1,
328        0,
329        u32,
330        u32,
331        TimerCaptureGpio2Reg_SPEC,
332        crate::common::R,
333    > {
334        crate::common::RegisterField::<
335            0,
336            0xffffff,
337            1,
338            0,
339            u32,
340            u32,
341            TimerCaptureGpio2Reg_SPEC,
342            crate::common::R,
343        >::from_register(self, 0)
344    }
345}
346impl ::core::default::Default for TimerCaptureGpio2Reg {
347    #[inline(always)]
348    fn default() -> TimerCaptureGpio2Reg {
349        <crate::RegValueT<TimerCaptureGpio2Reg_SPEC> as RegisterValue<_>>::new(0)
350    }
351}
352
353#[doc(hidden)]
354#[derive(Copy, Clone, Eq, PartialEq)]
355pub struct TimerCaptureGpio3Reg_SPEC;
356impl crate::sealed::RegSpec for TimerCaptureGpio3Reg_SPEC {
357    type DataType = u32;
358}
359
360#[doc = "Timer value for event on GPIO1"]
361pub type TimerCaptureGpio3Reg = crate::RegValueT<TimerCaptureGpio3Reg_SPEC>;
362
363impl TimerCaptureGpio3Reg {
364    #[doc = "Gives the Capture time for event on GPIO3"]
365    #[inline(always)]
366    pub fn tim_capture_gpio3(
367        self,
368    ) -> crate::common::RegisterField<
369        0,
370        0xffffff,
371        1,
372        0,
373        u32,
374        u32,
375        TimerCaptureGpio3Reg_SPEC,
376        crate::common::R,
377    > {
378        crate::common::RegisterField::<
379            0,
380            0xffffff,
381            1,
382            0,
383            u32,
384            u32,
385            TimerCaptureGpio3Reg_SPEC,
386            crate::common::R,
387        >::from_register(self, 0)
388    }
389}
390impl ::core::default::Default for TimerCaptureGpio3Reg {
391    #[inline(always)]
392    fn default() -> TimerCaptureGpio3Reg {
393        <crate::RegValueT<TimerCaptureGpio3Reg_SPEC> as RegisterValue<_>>::new(0)
394    }
395}
396
397#[doc(hidden)]
398#[derive(Copy, Clone, Eq, PartialEq)]
399pub struct TimerCaptureGpio4Reg_SPEC;
400impl crate::sealed::RegSpec for TimerCaptureGpio4Reg_SPEC {
401    type DataType = u32;
402}
403
404#[doc = "Timer value for event on GPIO1"]
405pub type TimerCaptureGpio4Reg = crate::RegValueT<TimerCaptureGpio4Reg_SPEC>;
406
407impl TimerCaptureGpio4Reg {
408    #[doc = "Gives the Capture time for event on GPIO4"]
409    #[inline(always)]
410    pub fn tim_capture_gpio4(
411        self,
412    ) -> crate::common::RegisterField<
413        0,
414        0xffffff,
415        1,
416        0,
417        u32,
418        u32,
419        TimerCaptureGpio4Reg_SPEC,
420        crate::common::R,
421    > {
422        crate::common::RegisterField::<
423            0,
424            0xffffff,
425            1,
426            0,
427            u32,
428            u32,
429            TimerCaptureGpio4Reg_SPEC,
430            crate::common::R,
431        >::from_register(self, 0)
432    }
433}
434impl ::core::default::Default for TimerCaptureGpio4Reg {
435    #[inline(always)]
436    fn default() -> TimerCaptureGpio4Reg {
437        <crate::RegValueT<TimerCaptureGpio4Reg_SPEC> as RegisterValue<_>>::new(0)
438    }
439}
440
441#[doc(hidden)]
442#[derive(Copy, Clone, Eq, PartialEq)]
443pub struct TimerClearGpioEventReg_SPEC;
444impl crate::sealed::RegSpec for TimerClearGpioEventReg_SPEC {
445    type DataType = u32;
446}
447
448#[doc = "Timer clear gpio event register"]
449pub type TimerClearGpioEventReg = crate::RegValueT<TimerClearGpioEventReg_SPEC>;
450
451impl TimerClearGpioEventReg {
452    #[doc = "1 = Clear GPIO4 event. Return always 0"]
453    #[inline(always)]
454    pub fn tim_clear_gpio4_event(
455        self,
456    ) -> crate::common::RegisterFieldBool<3, 1, 0, TimerClearGpioEventReg_SPEC, crate::common::W>
457    {
458        crate::common::RegisterFieldBool::<3,1,0,TimerClearGpioEventReg_SPEC,crate::common::W>::from_register(self,0)
459    }
460
461    #[doc = "1 = Clear GPIO3 event. Return always 0"]
462    #[inline(always)]
463    pub fn tim_clear_gpio3_event(
464        self,
465    ) -> crate::common::RegisterFieldBool<2, 1, 0, TimerClearGpioEventReg_SPEC, crate::common::W>
466    {
467        crate::common::RegisterFieldBool::<2,1,0,TimerClearGpioEventReg_SPEC,crate::common::W>::from_register(self,0)
468    }
469
470    #[doc = "1 = Clear GPIO2 event. Return always 0"]
471    #[inline(always)]
472    pub fn tim_clear_gpio2_event(
473        self,
474    ) -> crate::common::RegisterFieldBool<1, 1, 0, TimerClearGpioEventReg_SPEC, crate::common::W>
475    {
476        crate::common::RegisterFieldBool::<1,1,0,TimerClearGpioEventReg_SPEC,crate::common::W>::from_register(self,0)
477    }
478
479    #[doc = "1 = Clear GPIO1 event. Return always 0"]
480    #[inline(always)]
481    pub fn tim_clear_gpio1_event(
482        self,
483    ) -> crate::common::RegisterFieldBool<0, 1, 0, TimerClearGpioEventReg_SPEC, crate::common::W>
484    {
485        crate::common::RegisterFieldBool::<0,1,0,TimerClearGpioEventReg_SPEC,crate::common::W>::from_register(self,0)
486    }
487}
488impl ::core::default::Default for TimerClearGpioEventReg {
489    #[inline(always)]
490    fn default() -> TimerClearGpioEventReg {
491        <crate::RegValueT<TimerClearGpioEventReg_SPEC> as RegisterValue<_>>::new(0)
492    }
493}
494
495#[doc(hidden)]
496#[derive(Copy, Clone, Eq, PartialEq)]
497pub struct TimerClearIrqReg_SPEC;
498impl crate::sealed::RegSpec for TimerClearIrqReg_SPEC {
499    type DataType = u32;
500}
501
502#[doc = "Timer clear interrupt"]
503pub type TimerClearIrqReg = crate::RegValueT<TimerClearIrqReg_SPEC>;
504
505impl TimerClearIrqReg {
506    #[doc = "Write any value clear interrupt"]
507    #[inline(always)]
508    pub fn tim_clear_irq(
509        self,
510    ) -> crate::common::RegisterFieldBool<0, 1, 0, TimerClearIrqReg_SPEC, crate::common::W> {
511        crate::common::RegisterFieldBool::<0,1,0,TimerClearIrqReg_SPEC,crate::common::W>::from_register(self,0)
512    }
513}
514impl ::core::default::Default for TimerClearIrqReg {
515    #[inline(always)]
516    fn default() -> TimerClearIrqReg {
517        <crate::RegValueT<TimerClearIrqReg_SPEC> as RegisterValue<_>>::new(0)
518    }
519}
520
521#[doc(hidden)]
522#[derive(Copy, Clone, Eq, PartialEq)]
523pub struct TimerCtrlReg_SPEC;
524impl crate::sealed::RegSpec for TimerCtrlReg_SPEC {
525    type DataType = u32;
526}
527
528#[doc = "Timer control register"]
529pub type TimerCtrlReg = crate::RegValueT<TimerCtrlReg_SPEC>;
530
531impl TimerCtrlReg {
532    #[doc = "0 = Event on GPIO4 does not create a CAPTIM interrrupt\n1 = Event on GPIO4 creates a CAPTIM interrrupt"]
533    #[inline(always)]
534    pub fn tim_cap_gpio4_irq_en(
535        self,
536    ) -> crate::common::RegisterFieldBool<14, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
537        crate::common::RegisterFieldBool::<14,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
538    }
539
540    #[doc = "0 = Event on GPIO3 does not create a CAPTIM interrrupt\n1 = Event on GPIO3 creates a CAPTIM interrrupt"]
541    #[inline(always)]
542    pub fn tim_cap_gpio3_irq_en(
543        self,
544    ) -> crate::common::RegisterFieldBool<13, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
545        crate::common::RegisterFieldBool::<13,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
546    }
547
548    #[doc = "0 = Event on GPIO2 does not create a CAPTIM interrrupt\n1 = Event on GPIO2 creates a CAPTIM interrrupt"]
549    #[inline(always)]
550    pub fn tim_cap_gpio2_irq_en(
551        self,
552    ) -> crate::common::RegisterFieldBool<12, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
553        crate::common::RegisterFieldBool::<12,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
554    }
555
556    #[doc = "0 = Event on GPIO1 does not create a CAPTIM interrrupt\n1 = Event on GPIO1 creates a CAPTIM interrrupt"]
557    #[inline(always)]
558    pub fn tim_cap_gpio1_irq_en(
559        self,
560    ) -> crate::common::RegisterFieldBool<11, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
561        crate::common::RegisterFieldBool::<11,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
562    }
563
564    #[doc = "Event input 4 edge type\n1 = falling edge\n0 = rising edge"]
565    #[inline(always)]
566    pub fn tim_in4_event_fall_en(
567        self,
568    ) -> crate::common::RegisterFieldBool<10, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
569        crate::common::RegisterFieldBool::<10,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
570    }
571
572    #[doc = "Event input 3 edge type\n1 = falling edge\n0 = rising edge"]
573    #[inline(always)]
574    pub fn tim_in3_event_fall_en(
575        self,
576    ) -> crate::common::RegisterFieldBool<9, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
577        crate::common::RegisterFieldBool::<9,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
578    }
579
580    #[doc = "Timer clock enable\n1 = clock enabled\n0 = clock disabled"]
581    #[inline(always)]
582    pub fn tim_clk_en(
583        self,
584    ) -> crate::common::RegisterFieldBool<8, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
585        crate::common::RegisterFieldBool::<8,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
586    }
587
588    #[doc = "Select clock\n1 = Timer uses the DIVN clock\n0 = Timer uses the lp clock"]
589    #[inline(always)]
590    pub fn tim_sys_clk_en(
591        self,
592    ) -> crate::common::RegisterFieldBool<7, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
593        crate::common::RegisterFieldBool::<7,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
594    }
595
596    #[doc = "Valid when timer counts up, if it is \'1\' timer does not zero when reaches to reload value. it becomes zero only when it reaches the max value."]
597    #[inline(always)]
598    pub fn tim_free_run_mode_en(
599        self,
600    ) -> crate::common::RegisterFieldBool<6, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
601        crate::common::RegisterFieldBool::<6,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
602    }
603
604    #[doc = "Interrupt mask\n1 = timer IRQ is unmasked\n0 = timer IRQ is masked"]
605    #[inline(always)]
606    pub fn tim_irq_en(
607        self,
608    ) -> crate::common::RegisterFieldBool<5, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
609        crate::common::RegisterFieldBool::<5,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
610    }
611
612    #[doc = "Event input 2 edge type\n1 = falling edge\n0 = rising edge"]
613    #[inline(always)]
614    pub fn tim_in2_event_fall_en(
615        self,
616    ) -> crate::common::RegisterFieldBool<4, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
617        crate::common::RegisterFieldBool::<4,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
618    }
619
620    #[doc = "Event input 1 edge type\n1 = falling edge\n0 = rising edge"]
621    #[inline(always)]
622    pub fn tim_in1_event_fall_en(
623        self,
624    ) -> crate::common::RegisterFieldBool<3, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
625        crate::common::RegisterFieldBool::<3,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
626    }
627
628    #[doc = "Timer count direction\n1 = down\n0 = up"]
629    #[inline(always)]
630    pub fn tim_count_down_en(
631        self,
632    ) -> crate::common::RegisterFieldBool<2, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
633        crate::common::RegisterFieldBool::<2,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
634    }
635
636    #[doc = "Timer mode\n1 = One shot enabled\n0 = Counter enabled"]
637    #[inline(always)]
638    pub fn tim_oneshot_mode_en(
639        self,
640    ) -> crate::common::RegisterFieldBool<1, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
641        crate::common::RegisterFieldBool::<1,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
642    }
643
644    #[doc = "Timer enable\n1 = On\n0 = Off"]
645    #[inline(always)]
646    pub fn tim_en(
647        self,
648    ) -> crate::common::RegisterFieldBool<0, 1, 0, TimerCtrlReg_SPEC, crate::common::RW> {
649        crate::common::RegisterFieldBool::<0,1,0,TimerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
650    }
651}
652impl ::core::default::Default for TimerCtrlReg {
653    #[inline(always)]
654    fn default() -> TimerCtrlReg {
655        <crate::RegValueT<TimerCtrlReg_SPEC> as RegisterValue<_>>::new(0)
656    }
657}
658
659#[doc(hidden)]
660#[derive(Copy, Clone, Eq, PartialEq)]
661pub struct TimerGpio1ConfReg_SPEC;
662impl crate::sealed::RegSpec for TimerGpio1ConfReg_SPEC {
663    type DataType = u32;
664}
665
666#[doc = "Timer gpio1 selection"]
667pub type TimerGpio1ConfReg = crate::RegValueT<TimerGpio1ConfReg_SPEC>;
668
669impl TimerGpio1ConfReg {
670    #[doc = "Select one of the 32 GPIOs as IN1, Valid value 0-32. 1 for the first gpio, 32 for the last gpio. 0 Disable input"]
671    #[inline(always)]
672    pub fn tim_gpio1_conf(
673        self,
674    ) -> crate::common::RegisterField<
675        0,
676        0x3f,
677        1,
678        0,
679        u8,
680        u8,
681        TimerGpio1ConfReg_SPEC,
682        crate::common::RW,
683    > {
684        crate::common::RegisterField::<
685            0,
686            0x3f,
687            1,
688            0,
689            u8,
690            u8,
691            TimerGpio1ConfReg_SPEC,
692            crate::common::RW,
693        >::from_register(self, 0)
694    }
695}
696impl ::core::default::Default for TimerGpio1ConfReg {
697    #[inline(always)]
698    fn default() -> TimerGpio1ConfReg {
699        <crate::RegValueT<TimerGpio1ConfReg_SPEC> as RegisterValue<_>>::new(0)
700    }
701}
702
703#[doc(hidden)]
704#[derive(Copy, Clone, Eq, PartialEq)]
705pub struct TimerGpio2ConfReg_SPEC;
706impl crate::sealed::RegSpec for TimerGpio2ConfReg_SPEC {
707    type DataType = u32;
708}
709
710#[doc = "Timer gpio2 selection"]
711pub type TimerGpio2ConfReg = crate::RegValueT<TimerGpio2ConfReg_SPEC>;
712
713impl TimerGpio2ConfReg {
714    #[doc = "Select one of the 32 GPIOs as IN2, Valid value 0-32. 1 for the first gpio, 32 for the last gpio. 0 Disable input"]
715    #[inline(always)]
716    pub fn tim_gpio2_conf(
717        self,
718    ) -> crate::common::RegisterField<
719        0,
720        0x3f,
721        1,
722        0,
723        u8,
724        u8,
725        TimerGpio2ConfReg_SPEC,
726        crate::common::RW,
727    > {
728        crate::common::RegisterField::<
729            0,
730            0x3f,
731            1,
732            0,
733            u8,
734            u8,
735            TimerGpio2ConfReg_SPEC,
736            crate::common::RW,
737        >::from_register(self, 0)
738    }
739}
740impl ::core::default::Default for TimerGpio2ConfReg {
741    #[inline(always)]
742    fn default() -> TimerGpio2ConfReg {
743        <crate::RegValueT<TimerGpio2ConfReg_SPEC> as RegisterValue<_>>::new(0)
744    }
745}
746
747#[doc(hidden)]
748#[derive(Copy, Clone, Eq, PartialEq)]
749pub struct TimerGpio3ConfReg_SPEC;
750impl crate::sealed::RegSpec for TimerGpio3ConfReg_SPEC {
751    type DataType = u32;
752}
753
754#[doc = "Timer gpio3 selection"]
755pub type TimerGpio3ConfReg = crate::RegValueT<TimerGpio3ConfReg_SPEC>;
756
757impl TimerGpio3ConfReg {
758    #[doc = "Select one of the 32 GPIOs as IN3, Valid value 0-32. 1 for the first gpio, 32 for the last gpio. 0 Disable input"]
759    #[inline(always)]
760    pub fn tim_gpio3_conf(
761        self,
762    ) -> crate::common::RegisterField<
763        0,
764        0x3f,
765        1,
766        0,
767        u8,
768        u8,
769        TimerGpio3ConfReg_SPEC,
770        crate::common::RW,
771    > {
772        crate::common::RegisterField::<
773            0,
774            0x3f,
775            1,
776            0,
777            u8,
778            u8,
779            TimerGpio3ConfReg_SPEC,
780            crate::common::RW,
781        >::from_register(self, 0)
782    }
783}
784impl ::core::default::Default for TimerGpio3ConfReg {
785    #[inline(always)]
786    fn default() -> TimerGpio3ConfReg {
787        <crate::RegValueT<TimerGpio3ConfReg_SPEC> as RegisterValue<_>>::new(0)
788    }
789}
790
791#[doc(hidden)]
792#[derive(Copy, Clone, Eq, PartialEq)]
793pub struct TimerGpio4ConfReg_SPEC;
794impl crate::sealed::RegSpec for TimerGpio4ConfReg_SPEC {
795    type DataType = u32;
796}
797
798#[doc = "Timer gpio4 selection"]
799pub type TimerGpio4ConfReg = crate::RegValueT<TimerGpio4ConfReg_SPEC>;
800
801impl TimerGpio4ConfReg {
802    #[doc = "Select one of the 32 GPIOs as IN4, Valid value 0-32. 1 for the first gpio, 32 for the last gpio. 0 Disable input"]
803    #[inline(always)]
804    pub fn tim_gpio4_conf(
805        self,
806    ) -> crate::common::RegisterField<
807        0,
808        0x3f,
809        1,
810        0,
811        u8,
812        u8,
813        TimerGpio4ConfReg_SPEC,
814        crate::common::RW,
815    > {
816        crate::common::RegisterField::<
817            0,
818            0x3f,
819            1,
820            0,
821            u8,
822            u8,
823            TimerGpio4ConfReg_SPEC,
824            crate::common::RW,
825        >::from_register(self, 0)
826    }
827}
828impl ::core::default::Default for TimerGpio4ConfReg {
829    #[inline(always)]
830    fn default() -> TimerGpio4ConfReg {
831        <crate::RegValueT<TimerGpio4ConfReg_SPEC> as RegisterValue<_>>::new(0)
832    }
833}
834
835#[doc(hidden)]
836#[derive(Copy, Clone, Eq, PartialEq)]
837pub struct TimerPrescalerReg_SPEC;
838impl crate::sealed::RegSpec for TimerPrescalerReg_SPEC {
839    type DataType = u32;
840}
841
842#[doc = "Timer prescaler value"]
843pub type TimerPrescalerReg = crate::RegValueT<TimerPrescalerReg_SPEC>;
844
845impl TimerPrescalerReg {
846    #[doc = "Defines the timer count frequency. CLOCK frequency / (TIM_PRESCALER+1)"]
847    #[inline(always)]
848    pub fn tim_prescaler(
849        self,
850    ) -> crate::common::RegisterField<
851        0,
852        0x1f,
853        1,
854        0,
855        u8,
856        u8,
857        TimerPrescalerReg_SPEC,
858        crate::common::RW,
859    > {
860        crate::common::RegisterField::<
861            0,
862            0x1f,
863            1,
864            0,
865            u8,
866            u8,
867            TimerPrescalerReg_SPEC,
868            crate::common::RW,
869        >::from_register(self, 0)
870    }
871}
872impl ::core::default::Default for TimerPrescalerReg {
873    #[inline(always)]
874    fn default() -> TimerPrescalerReg {
875        <crate::RegValueT<TimerPrescalerReg_SPEC> as RegisterValue<_>>::new(0)
876    }
877}
878
879#[doc(hidden)]
880#[derive(Copy, Clone, Eq, PartialEq)]
881pub struct TimerPrescalerValReg_SPEC;
882impl crate::sealed::RegSpec for TimerPrescalerValReg_SPEC {
883    type DataType = u32;
884}
885
886#[doc = "Timer prescaler counter valuew"]
887pub type TimerPrescalerValReg = crate::RegValueT<TimerPrescalerValReg_SPEC>;
888
889impl TimerPrescalerValReg {
890    #[doc = "Gives the current prescaler counter value"]
891    #[inline(always)]
892    pub fn tim_prescaler_val(
893        self,
894    ) -> crate::common::RegisterField<
895        0,
896        0x1f,
897        1,
898        0,
899        u8,
900        u8,
901        TimerPrescalerValReg_SPEC,
902        crate::common::R,
903    > {
904        crate::common::RegisterField::<
905            0,
906            0x1f,
907            1,
908            0,
909            u8,
910            u8,
911            TimerPrescalerValReg_SPEC,
912            crate::common::R,
913        >::from_register(self, 0)
914    }
915}
916impl ::core::default::Default for TimerPrescalerValReg {
917    #[inline(always)]
918    fn default() -> TimerPrescalerValReg {
919        <crate::RegValueT<TimerPrescalerValReg_SPEC> as RegisterValue<_>>::new(0)
920    }
921}
922
923#[doc(hidden)]
924#[derive(Copy, Clone, Eq, PartialEq)]
925pub struct TimerPwmDcReg_SPEC;
926impl crate::sealed::RegSpec for TimerPwmDcReg_SPEC {
927    type DataType = u32;
928}
929
930#[doc = "Timer pwm dc register"]
931pub type TimerPwmDcReg = crate::RegValueT<TimerPwmDcReg_SPEC>;
932
933impl TimerPwmDcReg {
934    #[doc = "Defines the PWM duty cycle. TIM_PWM_DC / ( TIM_PWM_FREQ+1)"]
935    #[inline(always)]
936    pub fn tim_pwm_dc(
937        self,
938    ) -> crate::common::RegisterField<
939        0,
940        0xffff,
941        1,
942        0,
943        u16,
944        u16,
945        TimerPwmDcReg_SPEC,
946        crate::common::RW,
947    > {
948        crate::common::RegisterField::<
949            0,
950            0xffff,
951            1,
952            0,
953            u16,
954            u16,
955            TimerPwmDcReg_SPEC,
956            crate::common::RW,
957        >::from_register(self, 0)
958    }
959}
960impl ::core::default::Default for TimerPwmDcReg {
961    #[inline(always)]
962    fn default() -> TimerPwmDcReg {
963        <crate::RegValueT<TimerPwmDcReg_SPEC> as RegisterValue<_>>::new(0)
964    }
965}
966
967#[doc(hidden)]
968#[derive(Copy, Clone, Eq, PartialEq)]
969pub struct TimerPwmFreqReg_SPEC;
970impl crate::sealed::RegSpec for TimerPwmFreqReg_SPEC {
971    type DataType = u32;
972}
973
974#[doc = "Timer pwm frequency register"]
975pub type TimerPwmFreqReg = crate::RegValueT<TimerPwmFreqReg_SPEC>;
976
977impl TimerPwmFreqReg {
978    #[doc = "Defines the PWM frequency. Timer clock frequency / (TIM_PWM_FREQ+1)\nTimer clock is clock after prescaler"]
979    #[inline(always)]
980    pub fn tim_pwm_freq(
981        self,
982    ) -> crate::common::RegisterField<
983        0,
984        0xffff,
985        1,
986        0,
987        u16,
988        u16,
989        TimerPwmFreqReg_SPEC,
990        crate::common::RW,
991    > {
992        crate::common::RegisterField::<
993            0,
994            0xffff,
995            1,
996            0,
997            u16,
998            u16,
999            TimerPwmFreqReg_SPEC,
1000            crate::common::RW,
1001        >::from_register(self, 0)
1002    }
1003}
1004impl ::core::default::Default for TimerPwmFreqReg {
1005    #[inline(always)]
1006    fn default() -> TimerPwmFreqReg {
1007        <crate::RegValueT<TimerPwmFreqReg_SPEC> as RegisterValue<_>>::new(0)
1008    }
1009}
1010
1011#[doc(hidden)]
1012#[derive(Copy, Clone, Eq, PartialEq)]
1013pub struct TimerReloadReg_SPEC;
1014impl crate::sealed::RegSpec for TimerReloadReg_SPEC {
1015    type DataType = u32;
1016}
1017
1018#[doc = "Timer reload value and Delay in shot mode"]
1019pub type TimerReloadReg = crate::RegValueT<TimerReloadReg_SPEC>;
1020
1021impl TimerReloadReg {
1022    #[doc = "Reload or max value in timer mode, Delay phase duration in oneshot mode. Actual delay is the register value plus synchronization time (3 clock cycles)"]
1023    #[inline(always)]
1024    pub fn tim_reload(
1025        self,
1026    ) -> crate::common::RegisterField<
1027        0,
1028        0xffffff,
1029        1,
1030        0,
1031        u32,
1032        u32,
1033        TimerReloadReg_SPEC,
1034        crate::common::RW,
1035    > {
1036        crate::common::RegisterField::<
1037            0,
1038            0xffffff,
1039            1,
1040            0,
1041            u32,
1042            u32,
1043            TimerReloadReg_SPEC,
1044            crate::common::RW,
1045        >::from_register(self, 0)
1046    }
1047}
1048impl ::core::default::Default for TimerReloadReg {
1049    #[inline(always)]
1050    fn default() -> TimerReloadReg {
1051        <crate::RegValueT<TimerReloadReg_SPEC> as RegisterValue<_>>::new(0)
1052    }
1053}
1054
1055#[doc(hidden)]
1056#[derive(Copy, Clone, Eq, PartialEq)]
1057pub struct TimerShotwidthReg_SPEC;
1058impl crate::sealed::RegSpec for TimerShotwidthReg_SPEC {
1059    type DataType = u32;
1060}
1061
1062#[doc = "Timer Shot duration in shot mode"]
1063pub type TimerShotwidthReg = crate::RegValueT<TimerShotwidthReg_SPEC>;
1064
1065impl TimerShotwidthReg {
1066    #[doc = "Shot phase duration in oneshot mode"]
1067    #[inline(always)]
1068    pub fn tim_shotwidth(
1069        self,
1070    ) -> crate::common::RegisterField<
1071        0,
1072        0xffffff,
1073        1,
1074        0,
1075        u32,
1076        u32,
1077        TimerShotwidthReg_SPEC,
1078        crate::common::RW,
1079    > {
1080        crate::common::RegisterField::<
1081            0,
1082            0xffffff,
1083            1,
1084            0,
1085            u32,
1086            u32,
1087            TimerShotwidthReg_SPEC,
1088            crate::common::RW,
1089        >::from_register(self, 0)
1090    }
1091}
1092impl ::core::default::Default for TimerShotwidthReg {
1093    #[inline(always)]
1094    fn default() -> TimerShotwidthReg {
1095        <crate::RegValueT<TimerShotwidthReg_SPEC> as RegisterValue<_>>::new(0)
1096    }
1097}
1098
1099#[doc(hidden)]
1100#[derive(Copy, Clone, Eq, PartialEq)]
1101pub struct TimerStatusReg_SPEC;
1102impl crate::sealed::RegSpec for TimerStatusReg_SPEC {
1103    type DataType = u32;
1104}
1105
1106#[doc = "Timer status register"]
1107pub type TimerStatusReg = crate::RegValueT<TimerStatusReg_SPEC>;
1108
1109impl TimerStatusReg {
1110    #[doc = "When 1, GPIO4 event is pending."]
1111    #[inline(always)]
1112    pub fn tim_gpio4_event_pending(
1113        self,
1114    ) -> crate::common::RegisterFieldBool<7, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1115        crate::common::RegisterFieldBool::<7,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1116    }
1117
1118    #[doc = "When 1, GPIO3 event is pending."]
1119    #[inline(always)]
1120    pub fn tim_gpio3_event_pending(
1121        self,
1122    ) -> crate::common::RegisterFieldBool<6, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1123        crate::common::RegisterFieldBool::<6,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1124    }
1125
1126    #[doc = "When 1, GPIO2 event is pending."]
1127    #[inline(always)]
1128    pub fn tim_gpio2_event_pending(
1129        self,
1130    ) -> crate::common::RegisterFieldBool<5, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1131        crate::common::RegisterFieldBool::<5,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1132    }
1133
1134    #[doc = "When 1, GPIO1 event is pending."]
1135    #[inline(always)]
1136    pub fn tim_gpio1_event_pending(
1137        self,
1138    ) -> crate::common::RegisterFieldBool<4, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1139        crate::common::RegisterFieldBool::<4,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1140    }
1141
1142    #[doc = "OneShot phase\n0 = Wait for event\n1 = Delay phase\n2 = Start Shot\n3 = Shot phase"]
1143    #[inline(always)]
1144    pub fn tim_oneshot_phase(
1145        self,
1146    ) -> crate::common::RegisterField<2, 0x3, 1, 0, u8, u8, TimerStatusReg_SPEC, crate::common::R>
1147    {
1148        crate::common::RegisterField::<2,0x3,1,0,u8,u8,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1149    }
1150
1151    #[doc = "Gives the logic level of the IN1"]
1152    #[inline(always)]
1153    pub fn tim_in2_state(
1154        self,
1155    ) -> crate::common::RegisterFieldBool<1, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1156        crate::common::RegisterFieldBool::<1,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1157    }
1158
1159    #[doc = "Gives the logic level of the IN2"]
1160    #[inline(always)]
1161    pub fn tim_in1_state(
1162        self,
1163    ) -> crate::common::RegisterFieldBool<0, 1, 0, TimerStatusReg_SPEC, crate::common::R> {
1164        crate::common::RegisterFieldBool::<0,1,0,TimerStatusReg_SPEC,crate::common::R>::from_register(self,0)
1165    }
1166}
1167impl ::core::default::Default for TimerStatusReg {
1168    #[inline(always)]
1169    fn default() -> TimerStatusReg {
1170        <crate::RegValueT<TimerStatusReg_SPEC> as RegisterValue<_>>::new(0)
1171    }
1172}
1173
1174#[doc(hidden)]
1175#[derive(Copy, Clone, Eq, PartialEq)]
1176pub struct TimerTimerValReg_SPEC;
1177impl crate::sealed::RegSpec for TimerTimerValReg_SPEC {
1178    type DataType = u32;
1179}
1180
1181#[doc = "Timer counter value"]
1182pub type TimerTimerValReg = crate::RegValueT<TimerTimerValReg_SPEC>;
1183
1184impl TimerTimerValReg {
1185    #[doc = "Gives the current timer value"]
1186    #[inline(always)]
1187    pub fn tim_timer_value(
1188        self,
1189    ) -> crate::common::RegisterField<
1190        0,
1191        0xffffff,
1192        1,
1193        0,
1194        u32,
1195        u32,
1196        TimerTimerValReg_SPEC,
1197        crate::common::R,
1198    > {
1199        crate::common::RegisterField::<
1200            0,
1201            0xffffff,
1202            1,
1203            0,
1204            u32,
1205            u32,
1206            TimerTimerValReg_SPEC,
1207            crate::common::R,
1208        >::from_register(self, 0)
1209    }
1210}
1211impl ::core::default::Default for TimerTimerValReg {
1212    #[inline(always)]
1213    fn default() -> TimerTimerValReg {
1214        <crate::RegValueT<TimerTimerValReg_SPEC> as RegisterValue<_>>::new(0)
1215    }
1216}