esp32s3/mcpwm0/
operator_timersel.rs1#[doc = "Register `OPERATOR_TIMERSEL` reader"]
2pub type R = crate::R<OPERATOR_TIMERSEL_SPEC>;
3#[doc = "Register `OPERATOR_TIMERSEL` writer"]
4pub type W = crate::W<OPERATOR_TIMERSEL_SPEC>;
5#[doc = "Field `OPERATOR0_TIMERSEL` reader - Select which PWM timer's is the timing reference for PWM operator0, 0: timer0, 1: timer1, 2: timer2"]
6pub type OPERATOR0_TIMERSEL_R = crate::FieldReader;
7#[doc = "Field `OPERATOR0_TIMERSEL` writer - Select which PWM timer's is the timing reference for PWM operator0, 0: timer0, 1: timer1, 2: timer2"]
8pub type OPERATOR0_TIMERSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `OPERATOR1_TIMERSEL` reader - Select which PWM timer's is the timing reference for PWM operator1, 0: timer0, 1: timer1, 2: timer2"]
10pub type OPERATOR1_TIMERSEL_R = crate::FieldReader;
11#[doc = "Field `OPERATOR1_TIMERSEL` writer - Select which PWM timer's is the timing reference for PWM operator1, 0: timer0, 1: timer1, 2: timer2"]
12pub type OPERATOR1_TIMERSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `OPERATOR2_TIMERSEL` reader - Select which PWM timer's is the timing reference for PWM operator2, 0: timer0, 1: timer1, 2: timer2"]
14pub type OPERATOR2_TIMERSEL_R = crate::FieldReader;
15#[doc = "Field `OPERATOR2_TIMERSEL` writer - Select which PWM timer's is the timing reference for PWM operator2, 0: timer0, 1: timer1, 2: timer2"]
16pub type OPERATOR2_TIMERSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17impl R {
18 #[doc = "Bits 0:1 - Select which PWM timer's is the timing reference for PWM operator0, 0: timer0, 1: timer1, 2: timer2"]
19 #[inline(always)]
20 pub fn operator0_timersel(&self) -> OPERATOR0_TIMERSEL_R {
21 OPERATOR0_TIMERSEL_R::new((self.bits & 3) as u8)
22 }
23 #[doc = "Bits 2:3 - Select which PWM timer's is the timing reference for PWM operator1, 0: timer0, 1: timer1, 2: timer2"]
24 #[inline(always)]
25 pub fn operator1_timersel(&self) -> OPERATOR1_TIMERSEL_R {
26 OPERATOR1_TIMERSEL_R::new(((self.bits >> 2) & 3) as u8)
27 }
28 #[doc = "Bits 4:5 - Select which PWM timer's is the timing reference for PWM operator2, 0: timer0, 1: timer1, 2: timer2"]
29 #[inline(always)]
30 pub fn operator2_timersel(&self) -> OPERATOR2_TIMERSEL_R {
31 OPERATOR2_TIMERSEL_R::new(((self.bits >> 4) & 3) as u8)
32 }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("OPERATOR_TIMERSEL")
38 .field("operator0_timersel", &self.operator0_timersel())
39 .field("operator1_timersel", &self.operator1_timersel())
40 .field("operator2_timersel", &self.operator2_timersel())
41 .finish()
42 }
43}
44impl W {
45 #[doc = "Bits 0:1 - Select which PWM timer's is the timing reference for PWM operator0, 0: timer0, 1: timer1, 2: timer2"]
46 #[inline(always)]
47 pub fn operator0_timersel(&mut self) -> OPERATOR0_TIMERSEL_W<OPERATOR_TIMERSEL_SPEC> {
48 OPERATOR0_TIMERSEL_W::new(self, 0)
49 }
50 #[doc = "Bits 2:3 - Select which PWM timer's is the timing reference for PWM operator1, 0: timer0, 1: timer1, 2: timer2"]
51 #[inline(always)]
52 pub fn operator1_timersel(&mut self) -> OPERATOR1_TIMERSEL_W<OPERATOR_TIMERSEL_SPEC> {
53 OPERATOR1_TIMERSEL_W::new(self, 2)
54 }
55 #[doc = "Bits 4:5 - Select which PWM timer's is the timing reference for PWM operator2, 0: timer0, 1: timer1, 2: timer2"]
56 #[inline(always)]
57 pub fn operator2_timersel(&mut self) -> OPERATOR2_TIMERSEL_W<OPERATOR_TIMERSEL_SPEC> {
58 OPERATOR2_TIMERSEL_W::new(self, 4)
59 }
60}
61#[doc = "Select specific timer for PWM operators.\n\nYou can [`read`](crate::Reg::read) this register and get [`operator_timersel::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`operator_timersel::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct OPERATOR_TIMERSEL_SPEC;
63impl crate::RegisterSpec for OPERATOR_TIMERSEL_SPEC {
64 type Ux = u32;
65}
66#[doc = "`read()` method returns [`operator_timersel::R`](R) reader structure"]
67impl crate::Readable for OPERATOR_TIMERSEL_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`operator_timersel::W`](W) writer structure"]
69impl crate::Writable for OPERATOR_TIMERSEL_SPEC {
70 type Safety = crate::Unsafe;
71 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets OPERATOR_TIMERSEL to value 0"]
75impl crate::Resettable for OPERATOR_TIMERSEL_SPEC {
76 const RESET_VALUE: u32 = 0;
77}