1#![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"TIMER4 registers"]
28unsafe impl ::core::marker::Send for super::Timer4 {}
29unsafe impl ::core::marker::Sync for super::Timer4 {}
30impl super::Timer4 {
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 timer4_capture_gpio1_reg(
40 &self,
41 ) -> &'static crate::common::Reg<self::Timer4CaptureGpio1Reg_SPEC, crate::common::RW> {
42 unsafe {
43 crate::common::Reg::<self::Timer4CaptureGpio1Reg_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 timer4_capture_gpio2_reg(
52 &self,
53 ) -> &'static crate::common::Reg<self::Timer4CaptureGpio2Reg_SPEC, crate::common::RW> {
54 unsafe {
55 crate::common::Reg::<self::Timer4CaptureGpio2Reg_SPEC, crate::common::RW>::from_ptr(
56 self._svd2pac_as_ptr().add(36usize),
57 )
58 }
59 }
60
61 #[doc = "Timer clear interrupt"]
62 #[inline(always)]
63 pub const fn timer4_clear_irq_reg(
64 &self,
65 ) -> &'static crate::common::Reg<self::Timer4ClearIrqReg_SPEC, crate::common::RW> {
66 unsafe {
67 crate::common::Reg::<self::Timer4ClearIrqReg_SPEC, crate::common::RW>::from_ptr(
68 self._svd2pac_as_ptr().add(52usize),
69 )
70 }
71 }
72
73 #[doc = "Timer control register"]
74 #[inline(always)]
75 pub const fn timer4_ctrl_reg(
76 &self,
77 ) -> &'static crate::common::Reg<self::Timer4CtrlReg_SPEC, crate::common::RW> {
78 unsafe {
79 crate::common::Reg::<self::Timer4CtrlReg_SPEC, crate::common::RW>::from_ptr(
80 self._svd2pac_as_ptr().add(0usize),
81 )
82 }
83 }
84
85 #[doc = "Timer gpio1 selection"]
86 #[inline(always)]
87 pub const fn timer4_gpio1_conf_reg(
88 &self,
89 ) -> &'static crate::common::Reg<self::Timer4Gpio1ConfReg_SPEC, crate::common::RW> {
90 unsafe {
91 crate::common::Reg::<self::Timer4Gpio1ConfReg_SPEC, crate::common::RW>::from_ptr(
92 self._svd2pac_as_ptr().add(12usize),
93 )
94 }
95 }
96
97 #[doc = "Timer gpio2 selection"]
98 #[inline(always)]
99 pub const fn timer4_gpio2_conf_reg(
100 &self,
101 ) -> &'static crate::common::Reg<self::Timer4Gpio2ConfReg_SPEC, crate::common::RW> {
102 unsafe {
103 crate::common::Reg::<self::Timer4Gpio2ConfReg_SPEC, crate::common::RW>::from_ptr(
104 self._svd2pac_as_ptr().add(16usize),
105 )
106 }
107 }
108
109 #[doc = "Timer prescaler value"]
110 #[inline(always)]
111 pub const fn timer4_prescaler_reg(
112 &self,
113 ) -> &'static crate::common::Reg<self::Timer4PrescalerReg_SPEC, crate::common::RW> {
114 unsafe {
115 crate::common::Reg::<self::Timer4PrescalerReg_SPEC, crate::common::RW>::from_ptr(
116 self._svd2pac_as_ptr().add(28usize),
117 )
118 }
119 }
120
121 #[doc = "Timer prescaler counter valuew"]
122 #[inline(always)]
123 pub const fn timer4_prescaler_val_reg(
124 &self,
125 ) -> &'static crate::common::Reg<self::Timer4PrescalerValReg_SPEC, crate::common::RW> {
126 unsafe {
127 crate::common::Reg::<self::Timer4PrescalerValReg_SPEC, crate::common::RW>::from_ptr(
128 self._svd2pac_as_ptr().add(40usize),
129 )
130 }
131 }
132
133 #[doc = "Timer pwm dc register"]
134 #[inline(always)]
135 pub const fn timer4_pwm_dc_reg(
136 &self,
137 ) -> &'static crate::common::Reg<self::Timer4PwmDcReg_SPEC, crate::common::RW> {
138 unsafe {
139 crate::common::Reg::<self::Timer4PwmDcReg_SPEC, crate::common::RW>::from_ptr(
140 self._svd2pac_as_ptr().add(48usize),
141 )
142 }
143 }
144
145 #[doc = "Timer pwm frequency register"]
146 #[inline(always)]
147 pub const fn timer4_pwm_freq_reg(
148 &self,
149 ) -> &'static crate::common::Reg<self::Timer4PwmFreqReg_SPEC, crate::common::RW> {
150 unsafe {
151 crate::common::Reg::<self::Timer4PwmFreqReg_SPEC, crate::common::RW>::from_ptr(
152 self._svd2pac_as_ptr().add(44usize),
153 )
154 }
155 }
156
157 #[doc = "Timer reload value and Delay in shot mode"]
158 #[inline(always)]
159 pub const fn timer4_reload_reg(
160 &self,
161 ) -> &'static crate::common::Reg<self::Timer4ReloadReg_SPEC, crate::common::RW> {
162 unsafe {
163 crate::common::Reg::<self::Timer4ReloadReg_SPEC, crate::common::RW>::from_ptr(
164 self._svd2pac_as_ptr().add(20usize),
165 )
166 }
167 }
168
169 #[doc = "Timer status register"]
170 #[inline(always)]
171 pub const fn timer4_status_reg(
172 &self,
173 ) -> &'static crate::common::Reg<self::Timer4StatusReg_SPEC, crate::common::RW> {
174 unsafe {
175 crate::common::Reg::<self::Timer4StatusReg_SPEC, crate::common::RW>::from_ptr(
176 self._svd2pac_as_ptr().add(8usize),
177 )
178 }
179 }
180
181 #[doc = "Timer counter value"]
182 #[inline(always)]
183 pub const fn timer4_timer_val_reg(
184 &self,
185 ) -> &'static crate::common::Reg<self::Timer4TimerValReg_SPEC, crate::common::RW> {
186 unsafe {
187 crate::common::Reg::<self::Timer4TimerValReg_SPEC, crate::common::RW>::from_ptr(
188 self._svd2pac_as_ptr().add(4usize),
189 )
190 }
191 }
192}
193#[doc(hidden)]
194#[derive(Copy, Clone, Eq, PartialEq)]
195pub struct Timer4CaptureGpio1Reg_SPEC;
196impl crate::sealed::RegSpec for Timer4CaptureGpio1Reg_SPEC {
197 type DataType = u32;
198}
199
200#[doc = "Timer value for event on GPIO1"]
201pub type Timer4CaptureGpio1Reg = crate::RegValueT<Timer4CaptureGpio1Reg_SPEC>;
202
203impl Timer4CaptureGpio1Reg {
204 #[doc = "Gives the Capture time for event on GPIO1"]
205 #[inline(always)]
206 pub fn tim_capture_gpio1(
207 self,
208 ) -> crate::common::RegisterField<
209 0,
210 0xffffff,
211 1,
212 0,
213 u32,
214 u32,
215 Timer4CaptureGpio1Reg_SPEC,
216 crate::common::R,
217 > {
218 crate::common::RegisterField::<
219 0,
220 0xffffff,
221 1,
222 0,
223 u32,
224 u32,
225 Timer4CaptureGpio1Reg_SPEC,
226 crate::common::R,
227 >::from_register(self, 0)
228 }
229}
230impl ::core::default::Default for Timer4CaptureGpio1Reg {
231 #[inline(always)]
232 fn default() -> Timer4CaptureGpio1Reg {
233 <crate::RegValueT<Timer4CaptureGpio1Reg_SPEC> as RegisterValue<_>>::new(0)
234 }
235}
236
237#[doc(hidden)]
238#[derive(Copy, Clone, Eq, PartialEq)]
239pub struct Timer4CaptureGpio2Reg_SPEC;
240impl crate::sealed::RegSpec for Timer4CaptureGpio2Reg_SPEC {
241 type DataType = u32;
242}
243
244#[doc = "Timer value for event on GPIO2"]
245pub type Timer4CaptureGpio2Reg = crate::RegValueT<Timer4CaptureGpio2Reg_SPEC>;
246
247impl Timer4CaptureGpio2Reg {
248 #[doc = "Gives the Capture time for event on GPIO2"]
249 #[inline(always)]
250 pub fn tim_capture_gpio2(
251 self,
252 ) -> crate::common::RegisterField<
253 0,
254 0xffffff,
255 1,
256 0,
257 u32,
258 u32,
259 Timer4CaptureGpio2Reg_SPEC,
260 crate::common::R,
261 > {
262 crate::common::RegisterField::<
263 0,
264 0xffffff,
265 1,
266 0,
267 u32,
268 u32,
269 Timer4CaptureGpio2Reg_SPEC,
270 crate::common::R,
271 >::from_register(self, 0)
272 }
273}
274impl ::core::default::Default for Timer4CaptureGpio2Reg {
275 #[inline(always)]
276 fn default() -> Timer4CaptureGpio2Reg {
277 <crate::RegValueT<Timer4CaptureGpio2Reg_SPEC> as RegisterValue<_>>::new(0)
278 }
279}
280
281#[doc(hidden)]
282#[derive(Copy, Clone, Eq, PartialEq)]
283pub struct Timer4ClearIrqReg_SPEC;
284impl crate::sealed::RegSpec for Timer4ClearIrqReg_SPEC {
285 type DataType = u32;
286}
287
288#[doc = "Timer clear interrupt"]
289pub type Timer4ClearIrqReg = crate::RegValueT<Timer4ClearIrqReg_SPEC>;
290
291impl Timer4ClearIrqReg {
292 #[doc = "Write any value clear interrupt"]
293 #[inline(always)]
294 pub fn tim_clear_irq(
295 self,
296 ) -> crate::common::RegisterFieldBool<0, 1, 0, Timer4ClearIrqReg_SPEC, crate::common::W> {
297 crate::common::RegisterFieldBool::<0,1,0,Timer4ClearIrqReg_SPEC,crate::common::W>::from_register(self,0)
298 }
299}
300impl ::core::default::Default for Timer4ClearIrqReg {
301 #[inline(always)]
302 fn default() -> Timer4ClearIrqReg {
303 <crate::RegValueT<Timer4ClearIrqReg_SPEC> as RegisterValue<_>>::new(0)
304 }
305}
306
307#[doc(hidden)]
308#[derive(Copy, Clone, Eq, PartialEq)]
309pub struct Timer4CtrlReg_SPEC;
310impl crate::sealed::RegSpec for Timer4CtrlReg_SPEC {
311 type DataType = u32;
312}
313
314#[doc = "Timer control register"]
315pub type Timer4CtrlReg = crate::RegValueT<Timer4CtrlReg_SPEC>;
316
317impl Timer4CtrlReg {
318 #[doc = "Timer clock enable\n1 = clock enabled\n0 = clock disabled"]
319 #[inline(always)]
320 pub fn tim_clk_en(
321 self,
322 ) -> crate::common::RegisterFieldBool<8, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
323 crate::common::RegisterFieldBool::<8,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
324 }
325
326 #[doc = "Select clock\n1 = Timer uses the DIVN clock\n0 = Timer uses the lp clock"]
327 #[inline(always)]
328 pub fn tim_sys_clk_en(
329 self,
330 ) -> crate::common::RegisterFieldBool<7, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
331 crate::common::RegisterFieldBool::<7,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
332 }
333
334 #[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."]
335 #[inline(always)]
336 pub fn tim_free_run_mode_en(
337 self,
338 ) -> crate::common::RegisterFieldBool<6, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
339 crate::common::RegisterFieldBool::<6,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
340 }
341
342 #[doc = "Interrupt mask\n1 = timer IRQ is unmasked\n0 = timer IRQ is masked"]
343 #[inline(always)]
344 pub fn tim_irq_en(
345 self,
346 ) -> crate::common::RegisterFieldBool<5, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
347 crate::common::RegisterFieldBool::<5,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
348 }
349
350 #[doc = "Event input 2 edge type\n1 = falling edge\n0 = rising edge"]
351 #[inline(always)]
352 pub fn tim_in2_event_fall_en(
353 self,
354 ) -> crate::common::RegisterFieldBool<4, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
355 crate::common::RegisterFieldBool::<4,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
356 }
357
358 #[doc = "Event input 1 edge type\n1 = falling edge\n0 = rising edge"]
359 #[inline(always)]
360 pub fn tim_in1_event_fall_en(
361 self,
362 ) -> crate::common::RegisterFieldBool<3, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
363 crate::common::RegisterFieldBool::<3,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
364 }
365
366 #[doc = "Timer count direction\n1 = down\n0 = up"]
367 #[inline(always)]
368 pub fn tim_count_down_en(
369 self,
370 ) -> crate::common::RegisterFieldBool<2, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
371 crate::common::RegisterFieldBool::<2,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
372 }
373
374 #[doc = "Timer enable\n1 = On\n0 = Off"]
375 #[inline(always)]
376 pub fn tim_en(
377 self,
378 ) -> crate::common::RegisterFieldBool<0, 1, 0, Timer4CtrlReg_SPEC, crate::common::RW> {
379 crate::common::RegisterFieldBool::<0,1,0,Timer4CtrlReg_SPEC,crate::common::RW>::from_register(self,0)
380 }
381}
382impl ::core::default::Default for Timer4CtrlReg {
383 #[inline(always)]
384 fn default() -> Timer4CtrlReg {
385 <crate::RegValueT<Timer4CtrlReg_SPEC> as RegisterValue<_>>::new(0)
386 }
387}
388
389#[doc(hidden)]
390#[derive(Copy, Clone, Eq, PartialEq)]
391pub struct Timer4Gpio1ConfReg_SPEC;
392impl crate::sealed::RegSpec for Timer4Gpio1ConfReg_SPEC {
393 type DataType = u32;
394}
395
396#[doc = "Timer gpio1 selection"]
397pub type Timer4Gpio1ConfReg = crate::RegValueT<Timer4Gpio1ConfReg_SPEC>;
398
399impl Timer4Gpio1ConfReg {
400 #[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"]
401 #[inline(always)]
402 pub fn tim_gpio1_conf(
403 self,
404 ) -> crate::common::RegisterField<
405 0,
406 0x3f,
407 1,
408 0,
409 u8,
410 u8,
411 Timer4Gpio1ConfReg_SPEC,
412 crate::common::RW,
413 > {
414 crate::common::RegisterField::<
415 0,
416 0x3f,
417 1,
418 0,
419 u8,
420 u8,
421 Timer4Gpio1ConfReg_SPEC,
422 crate::common::RW,
423 >::from_register(self, 0)
424 }
425}
426impl ::core::default::Default for Timer4Gpio1ConfReg {
427 #[inline(always)]
428 fn default() -> Timer4Gpio1ConfReg {
429 <crate::RegValueT<Timer4Gpio1ConfReg_SPEC> as RegisterValue<_>>::new(0)
430 }
431}
432
433#[doc(hidden)]
434#[derive(Copy, Clone, Eq, PartialEq)]
435pub struct Timer4Gpio2ConfReg_SPEC;
436impl crate::sealed::RegSpec for Timer4Gpio2ConfReg_SPEC {
437 type DataType = u32;
438}
439
440#[doc = "Timer gpio2 selection"]
441pub type Timer4Gpio2ConfReg = crate::RegValueT<Timer4Gpio2ConfReg_SPEC>;
442
443impl Timer4Gpio2ConfReg {
444 #[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"]
445 #[inline(always)]
446 pub fn tim_gpio2_conf(
447 self,
448 ) -> crate::common::RegisterField<
449 0,
450 0x3f,
451 1,
452 0,
453 u8,
454 u8,
455 Timer4Gpio2ConfReg_SPEC,
456 crate::common::RW,
457 > {
458 crate::common::RegisterField::<
459 0,
460 0x3f,
461 1,
462 0,
463 u8,
464 u8,
465 Timer4Gpio2ConfReg_SPEC,
466 crate::common::RW,
467 >::from_register(self, 0)
468 }
469}
470impl ::core::default::Default for Timer4Gpio2ConfReg {
471 #[inline(always)]
472 fn default() -> Timer4Gpio2ConfReg {
473 <crate::RegValueT<Timer4Gpio2ConfReg_SPEC> as RegisterValue<_>>::new(0)
474 }
475}
476
477#[doc(hidden)]
478#[derive(Copy, Clone, Eq, PartialEq)]
479pub struct Timer4PrescalerReg_SPEC;
480impl crate::sealed::RegSpec for Timer4PrescalerReg_SPEC {
481 type DataType = u32;
482}
483
484#[doc = "Timer prescaler value"]
485pub type Timer4PrescalerReg = crate::RegValueT<Timer4PrescalerReg_SPEC>;
486
487impl Timer4PrescalerReg {
488 #[doc = "Defines the timer count frequency. CLOCK frequency / (TIM_PRESCALER+1)"]
489 #[inline(always)]
490 pub fn tim_prescaler(
491 self,
492 ) -> crate::common::RegisterField<
493 0,
494 0x1f,
495 1,
496 0,
497 u8,
498 u8,
499 Timer4PrescalerReg_SPEC,
500 crate::common::RW,
501 > {
502 crate::common::RegisterField::<
503 0,
504 0x1f,
505 1,
506 0,
507 u8,
508 u8,
509 Timer4PrescalerReg_SPEC,
510 crate::common::RW,
511 >::from_register(self, 0)
512 }
513}
514impl ::core::default::Default for Timer4PrescalerReg {
515 #[inline(always)]
516 fn default() -> Timer4PrescalerReg {
517 <crate::RegValueT<Timer4PrescalerReg_SPEC> as RegisterValue<_>>::new(0)
518 }
519}
520
521#[doc(hidden)]
522#[derive(Copy, Clone, Eq, PartialEq)]
523pub struct Timer4PrescalerValReg_SPEC;
524impl crate::sealed::RegSpec for Timer4PrescalerValReg_SPEC {
525 type DataType = u32;
526}
527
528#[doc = "Timer prescaler counter valuew"]
529pub type Timer4PrescalerValReg = crate::RegValueT<Timer4PrescalerValReg_SPEC>;
530
531impl Timer4PrescalerValReg {
532 #[doc = "Gives the current prescaler counter value"]
533 #[inline(always)]
534 pub fn tim_prescaler_val(
535 self,
536 ) -> crate::common::RegisterField<
537 0,
538 0x1f,
539 1,
540 0,
541 u8,
542 u8,
543 Timer4PrescalerValReg_SPEC,
544 crate::common::R,
545 > {
546 crate::common::RegisterField::<
547 0,
548 0x1f,
549 1,
550 0,
551 u8,
552 u8,
553 Timer4PrescalerValReg_SPEC,
554 crate::common::R,
555 >::from_register(self, 0)
556 }
557}
558impl ::core::default::Default for Timer4PrescalerValReg {
559 #[inline(always)]
560 fn default() -> Timer4PrescalerValReg {
561 <crate::RegValueT<Timer4PrescalerValReg_SPEC> as RegisterValue<_>>::new(0)
562 }
563}
564
565#[doc(hidden)]
566#[derive(Copy, Clone, Eq, PartialEq)]
567pub struct Timer4PwmDcReg_SPEC;
568impl crate::sealed::RegSpec for Timer4PwmDcReg_SPEC {
569 type DataType = u32;
570}
571
572#[doc = "Timer pwm dc register"]
573pub type Timer4PwmDcReg = crate::RegValueT<Timer4PwmDcReg_SPEC>;
574
575impl Timer4PwmDcReg {
576 #[doc = "Defines the PWM duty cycle. TIM_PWM_DC / ( TIM_PWM_FREQ+1)"]
577 #[inline(always)]
578 pub fn tim_pwm_dc(
579 self,
580 ) -> crate::common::RegisterField<
581 0,
582 0xffff,
583 1,
584 0,
585 u16,
586 u16,
587 Timer4PwmDcReg_SPEC,
588 crate::common::RW,
589 > {
590 crate::common::RegisterField::<
591 0,
592 0xffff,
593 1,
594 0,
595 u16,
596 u16,
597 Timer4PwmDcReg_SPEC,
598 crate::common::RW,
599 >::from_register(self, 0)
600 }
601}
602impl ::core::default::Default for Timer4PwmDcReg {
603 #[inline(always)]
604 fn default() -> Timer4PwmDcReg {
605 <crate::RegValueT<Timer4PwmDcReg_SPEC> as RegisterValue<_>>::new(0)
606 }
607}
608
609#[doc(hidden)]
610#[derive(Copy, Clone, Eq, PartialEq)]
611pub struct Timer4PwmFreqReg_SPEC;
612impl crate::sealed::RegSpec for Timer4PwmFreqReg_SPEC {
613 type DataType = u32;
614}
615
616#[doc = "Timer pwm frequency register"]
617pub type Timer4PwmFreqReg = crate::RegValueT<Timer4PwmFreqReg_SPEC>;
618
619impl Timer4PwmFreqReg {
620 #[doc = "Defines the PWM frequency. Timer clock frequency / (TIM_PWM_FREQ+1)\nTimer clock is clock after prescaler"]
621 #[inline(always)]
622 pub fn tim_pwm_freq(
623 self,
624 ) -> crate::common::RegisterField<
625 0,
626 0xffff,
627 1,
628 0,
629 u16,
630 u16,
631 Timer4PwmFreqReg_SPEC,
632 crate::common::RW,
633 > {
634 crate::common::RegisterField::<
635 0,
636 0xffff,
637 1,
638 0,
639 u16,
640 u16,
641 Timer4PwmFreqReg_SPEC,
642 crate::common::RW,
643 >::from_register(self, 0)
644 }
645}
646impl ::core::default::Default for Timer4PwmFreqReg {
647 #[inline(always)]
648 fn default() -> Timer4PwmFreqReg {
649 <crate::RegValueT<Timer4PwmFreqReg_SPEC> as RegisterValue<_>>::new(0)
650 }
651}
652
653#[doc(hidden)]
654#[derive(Copy, Clone, Eq, PartialEq)]
655pub struct Timer4ReloadReg_SPEC;
656impl crate::sealed::RegSpec for Timer4ReloadReg_SPEC {
657 type DataType = u32;
658}
659
660#[doc = "Timer reload value and Delay in shot mode"]
661pub type Timer4ReloadReg = crate::RegValueT<Timer4ReloadReg_SPEC>;
662
663impl Timer4ReloadReg {
664 #[doc = "Reload or max value in timer mode. Actual delay is the register value plus synchronization time (3 clock cycles)"]
665 #[inline(always)]
666 pub fn tim_reload(
667 self,
668 ) -> crate::common::RegisterField<
669 0,
670 0xffffff,
671 1,
672 0,
673 u32,
674 u32,
675 Timer4ReloadReg_SPEC,
676 crate::common::RW,
677 > {
678 crate::common::RegisterField::<
679 0,
680 0xffffff,
681 1,
682 0,
683 u32,
684 u32,
685 Timer4ReloadReg_SPEC,
686 crate::common::RW,
687 >::from_register(self, 0)
688 }
689}
690impl ::core::default::Default for Timer4ReloadReg {
691 #[inline(always)]
692 fn default() -> Timer4ReloadReg {
693 <crate::RegValueT<Timer4ReloadReg_SPEC> as RegisterValue<_>>::new(0)
694 }
695}
696
697#[doc(hidden)]
698#[derive(Copy, Clone, Eq, PartialEq)]
699pub struct Timer4StatusReg_SPEC;
700impl crate::sealed::RegSpec for Timer4StatusReg_SPEC {
701 type DataType = u32;
702}
703
704#[doc = "Timer status register"]
705pub type Timer4StatusReg = crate::RegValueT<Timer4StatusReg_SPEC>;
706
707impl Timer4StatusReg {
708 #[doc = "OneShot phase\n0 = Wait for event\n1 = Delay phase\n2 = Start Shot\n3 = Shot phase"]
709 #[inline(always)]
710 pub fn tim_oneshot_phase(
711 self,
712 ) -> crate::common::RegisterField<2, 0x3, 1, 0, u8, u8, Timer4StatusReg_SPEC, crate::common::R>
713 {
714 crate::common::RegisterField::<2,0x3,1,0,u8,u8,Timer4StatusReg_SPEC,crate::common::R>::from_register(self,0)
715 }
716
717 #[doc = "Gives the logic level of the IN1"]
718 #[inline(always)]
719 pub fn tim_in2_state(
720 self,
721 ) -> crate::common::RegisterFieldBool<1, 1, 0, Timer4StatusReg_SPEC, crate::common::R> {
722 crate::common::RegisterFieldBool::<1,1,0,Timer4StatusReg_SPEC,crate::common::R>::from_register(self,0)
723 }
724
725 #[doc = "Gives the logic level of the IN2"]
726 #[inline(always)]
727 pub fn tim_in1_state(
728 self,
729 ) -> crate::common::RegisterFieldBool<0, 1, 0, Timer4StatusReg_SPEC, crate::common::R> {
730 crate::common::RegisterFieldBool::<0,1,0,Timer4StatusReg_SPEC,crate::common::R>::from_register(self,0)
731 }
732}
733impl ::core::default::Default for Timer4StatusReg {
734 #[inline(always)]
735 fn default() -> Timer4StatusReg {
736 <crate::RegValueT<Timer4StatusReg_SPEC> as RegisterValue<_>>::new(0)
737 }
738}
739
740#[doc(hidden)]
741#[derive(Copy, Clone, Eq, PartialEq)]
742pub struct Timer4TimerValReg_SPEC;
743impl crate::sealed::RegSpec for Timer4TimerValReg_SPEC {
744 type DataType = u32;
745}
746
747#[doc = "Timer counter value"]
748pub type Timer4TimerValReg = crate::RegValueT<Timer4TimerValReg_SPEC>;
749
750impl Timer4TimerValReg {
751 #[doc = "Gives the current timer value"]
752 #[inline(always)]
753 pub fn tim_timer_value(
754 self,
755 ) -> crate::common::RegisterField<
756 0,
757 0xffffff,
758 1,
759 0,
760 u32,
761 u32,
762 Timer4TimerValReg_SPEC,
763 crate::common::R,
764 > {
765 crate::common::RegisterField::<
766 0,
767 0xffffff,
768 1,
769 0,
770 u32,
771 u32,
772 Timer4TimerValReg_SPEC,
773 crate::common::R,
774 >::from_register(self, 0)
775 }
776}
777impl ::core::default::Default for Timer4TimerValReg {
778 #[inline(always)]
779 fn default() -> Timer4TimerValReg {
780 <crate::RegValueT<Timer4TimerValReg_SPEC> as RegisterValue<_>>::new(0)
781 }
782}