esp32p4/mcpwm0/ch/
gen_stmp_cfg.rs1#[doc = "Register `GEN_STMP_CFG` reader"]
2pub type R = crate::R<GEN_STMP_CFG_SPEC>;
3#[doc = "Register `GEN_STMP_CFG` writer"]
4pub type W = crate::W<GEN_STMP_CFG_SPEC>;
5#[doc = "Field `A_UPMETHOD` reader - Configures the update method for PWM generator %s time stamp A's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
6pub type A_UPMETHOD_R = crate::FieldReader;
7#[doc = "Field `A_UPMETHOD` writer - Configures the update method for PWM generator %s time stamp A's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
8pub type A_UPMETHOD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `B_UPMETHOD` reader - Configures the update method for PWM generator %s time stamp B's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
10pub type B_UPMETHOD_R = crate::FieldReader;
11#[doc = "Field `B_UPMETHOD` writer - Configures the update method for PWM generator %s time stamp B's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
12pub type B_UPMETHOD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `A_SHDW_FULL` reader - Represents whether or not generator%s time stamp A's shadow reg is transferred.\\\\0: A's active reg has been updated with shadow register latest value.\\\\1: A's shadow reg is filled and waiting to be transferred to A's active reg"]
14pub type A_SHDW_FULL_R = crate::BitReader;
15#[doc = "Field `A_SHDW_FULL` writer - Represents whether or not generator%s time stamp A's shadow reg is transferred.\\\\0: A's active reg has been updated with shadow register latest value.\\\\1: A's shadow reg is filled and waiting to be transferred to A's active reg"]
16pub type A_SHDW_FULL_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `B_SHDW_FULL` reader - Represents whether or not generator%s time stamp B's shadow reg is transferred.\\\\0: B's active reg has been updated with shadow register latest value.\\\\1: B's shadow reg is filled and waiting to be transferred to B's active reg"]
18pub type B_SHDW_FULL_R = crate::BitReader;
19#[doc = "Field `B_SHDW_FULL` writer - Represents whether or not generator%s time stamp B's shadow reg is transferred.\\\\0: B's active reg has been updated with shadow register latest value.\\\\1: B's shadow reg is filled and waiting to be transferred to B's active reg"]
20pub type B_SHDW_FULL_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bits 0:3 - Configures the update method for PWM generator %s time stamp A's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
23 #[inline(always)]
24 pub fn a_upmethod(&self) -> A_UPMETHOD_R {
25 A_UPMETHOD_R::new((self.bits & 0x0f) as u8)
26 }
27 #[doc = "Bits 4:7 - Configures the update method for PWM generator %s time stamp B's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
28 #[inline(always)]
29 pub fn b_upmethod(&self) -> B_UPMETHOD_R {
30 B_UPMETHOD_R::new(((self.bits >> 4) & 0x0f) as u8)
31 }
32 #[doc = "Bit 8 - Represents whether or not generator%s time stamp A's shadow reg is transferred.\\\\0: A's active reg has been updated with shadow register latest value.\\\\1: A's shadow reg is filled and waiting to be transferred to A's active reg"]
33 #[inline(always)]
34 pub fn a_shdw_full(&self) -> A_SHDW_FULL_R {
35 A_SHDW_FULL_R::new(((self.bits >> 8) & 1) != 0)
36 }
37 #[doc = "Bit 9 - Represents whether or not generator%s time stamp B's shadow reg is transferred.\\\\0: B's active reg has been updated with shadow register latest value.\\\\1: B's shadow reg is filled and waiting to be transferred to B's active reg"]
38 #[inline(always)]
39 pub fn b_shdw_full(&self) -> B_SHDW_FULL_R {
40 B_SHDW_FULL_R::new(((self.bits >> 9) & 1) != 0)
41 }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("GEN_STMP_CFG")
47 .field("a_upmethod", &format_args!("{}", self.a_upmethod().bits()))
48 .field("b_upmethod", &format_args!("{}", self.b_upmethod().bits()))
49 .field("a_shdw_full", &format_args!("{}", self.a_shdw_full().bit()))
50 .field("b_shdw_full", &format_args!("{}", self.b_shdw_full().bit()))
51 .finish()
52 }
53}
54#[cfg(feature = "impl-register-debug")]
55impl core::fmt::Debug for crate::generic::Reg<GEN_STMP_CFG_SPEC> {
56 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
57 core::fmt::Debug::fmt(&self.read(), f)
58 }
59}
60impl W {
61 #[doc = "Bits 0:3 - Configures the update method for PWM generator %s time stamp A's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
62 #[inline(always)]
63 #[must_use]
64 pub fn a_upmethod(&mut self) -> A_UPMETHOD_W<GEN_STMP_CFG_SPEC> {
65 A_UPMETHOD_W::new(self, 0)
66 }
67 #[doc = "Bits 4:7 - Configures the update method for PWM generator %s time stamp B's active register.\\\\0: Immediately\\\\Bit0 is set to 1: TEZ\\\\Bit1 is set to 1: TEP\\\\Bit2 is set to 1: Sync\\\\Bit3 is set to 1: Disable the update"]
68 #[inline(always)]
69 #[must_use]
70 pub fn b_upmethod(&mut self) -> B_UPMETHOD_W<GEN_STMP_CFG_SPEC> {
71 B_UPMETHOD_W::new(self, 4)
72 }
73 #[doc = "Bit 8 - Represents whether or not generator%s time stamp A's shadow reg is transferred.\\\\0: A's active reg has been updated with shadow register latest value.\\\\1: A's shadow reg is filled and waiting to be transferred to A's active reg"]
74 #[inline(always)]
75 #[must_use]
76 pub fn a_shdw_full(&mut self) -> A_SHDW_FULL_W<GEN_STMP_CFG_SPEC> {
77 A_SHDW_FULL_W::new(self, 8)
78 }
79 #[doc = "Bit 9 - Represents whether or not generator%s time stamp B's shadow reg is transferred.\\\\0: B's active reg has been updated with shadow register latest value.\\\\1: B's shadow reg is filled and waiting to be transferred to B's active reg"]
80 #[inline(always)]
81 #[must_use]
82 pub fn b_shdw_full(&mut self) -> B_SHDW_FULL_W<GEN_STMP_CFG_SPEC> {
83 B_SHDW_FULL_W::new(self, 9)
84 }
85}
86#[doc = "Generator0 time stamp registers A and B transfer status and update method register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gen_stmp_cfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gen_stmp_cfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
87pub struct GEN_STMP_CFG_SPEC;
88impl crate::RegisterSpec for GEN_STMP_CFG_SPEC {
89 type Ux = u32;
90}
91#[doc = "`read()` method returns [`gen_stmp_cfg::R`](R) reader structure"]
92impl crate::Readable for GEN_STMP_CFG_SPEC {}
93#[doc = "`write(|w| ..)` method takes [`gen_stmp_cfg::W`](W) writer structure"]
94impl crate::Writable for GEN_STMP_CFG_SPEC {
95 type Safety = crate::Unsafe;
96 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
97 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
98}
99#[doc = "`reset()` method sets GEN_STMP_CFG to value 0"]
100impl crate::Resettable for GEN_STMP_CFG_SPEC {
101 const RESET_VALUE: u32 = 0;
102}