1#[doc = "Register `UPDATE_CFG` reader"]
2pub type R = crate::R<UPDATE_CFG_SPEC>;
3#[doc = "Register `UPDATE_CFG` writer"]
4pub type W = crate::W<UPDATE_CFG_SPEC>;
5#[doc = "Field `GLOBAL_UP_EN` reader - The global enable of update of all active registers in MCPWM module"]
6pub type GLOBAL_UP_EN_R = crate::BitReader;
7#[doc = "Field `GLOBAL_UP_EN` writer - The global enable of update of all active registers in MCPWM module"]
8pub type GLOBAL_UP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `GLOBAL_FORCE_UP` reader - a toggle (software invert its value) will trigger a forced update of all active registers in MCPWM module"]
10pub type GLOBAL_FORCE_UP_R = crate::BitReader;
11#[doc = "Field `GLOBAL_FORCE_UP` writer - a toggle (software invert its value) will trigger a forced update of all active registers in MCPWM module"]
12pub type GLOBAL_FORCE_UP_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `OP0_UP_EN` reader - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 0 are enabled"]
14pub type OP0_UP_EN_R = crate::BitReader;
15#[doc = "Field `OP0_UP_EN` writer - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 0 are enabled"]
16pub type OP0_UP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `OP0_FORCE_UP` reader - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 0"]
18pub type OP0_FORCE_UP_R = crate::BitReader;
19#[doc = "Field `OP0_FORCE_UP` writer - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 0"]
20pub type OP0_FORCE_UP_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `OP1_UP_EN` reader - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 1 are enabled"]
22pub type OP1_UP_EN_R = crate::BitReader;
23#[doc = "Field `OP1_UP_EN` writer - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 1 are enabled"]
24pub type OP1_UP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `OP1_FORCE_UP` reader - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 1"]
26pub type OP1_FORCE_UP_R = crate::BitReader;
27#[doc = "Field `OP1_FORCE_UP` writer - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 1"]
28pub type OP1_FORCE_UP_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `OP2_UP_EN` reader - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 2 are enabled"]
30pub type OP2_UP_EN_R = crate::BitReader;
31#[doc = "Field `OP2_UP_EN` writer - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 2 are enabled"]
32pub type OP2_UP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `OP2_FORCE_UP` reader - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 2"]
34pub type OP2_FORCE_UP_R = crate::BitReader;
35#[doc = "Field `OP2_FORCE_UP` writer - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 2"]
36pub type OP2_FORCE_UP_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38#[doc = "Bit 0 - The global enable of update of all active registers in MCPWM module"]
39 #[inline(always)]
40pub fn global_up_en(&self) -> GLOBAL_UP_EN_R {
41 GLOBAL_UP_EN_R::new((self.bits & 1) != 0)
42 }
43#[doc = "Bit 1 - a toggle (software invert its value) will trigger a forced update of all active registers in MCPWM module"]
44 #[inline(always)]
45pub fn global_force_up(&self) -> GLOBAL_FORCE_UP_R {
46 GLOBAL_FORCE_UP_R::new(((self.bits >> 1) & 1) != 0)
47 }
48#[doc = "Bit 2 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 0 are enabled"]
49 #[inline(always)]
50pub fn op0_up_en(&self) -> OP0_UP_EN_R {
51 OP0_UP_EN_R::new(((self.bits >> 2) & 1) != 0)
52 }
53#[doc = "Bit 3 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 0"]
54 #[inline(always)]
55pub fn op0_force_up(&self) -> OP0_FORCE_UP_R {
56 OP0_FORCE_UP_R::new(((self.bits >> 3) & 1) != 0)
57 }
58#[doc = "Bit 4 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 1 are enabled"]
59 #[inline(always)]
60pub fn op1_up_en(&self) -> OP1_UP_EN_R {
61 OP1_UP_EN_R::new(((self.bits >> 4) & 1) != 0)
62 }
63#[doc = "Bit 5 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 1"]
64 #[inline(always)]
65pub fn op1_force_up(&self) -> OP1_FORCE_UP_R {
66 OP1_FORCE_UP_R::new(((self.bits >> 5) & 1) != 0)
67 }
68#[doc = "Bit 6 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 2 are enabled"]
69 #[inline(always)]
70pub fn op2_up_en(&self) -> OP2_UP_EN_R {
71 OP2_UP_EN_R::new(((self.bits >> 6) & 1) != 0)
72 }
73#[doc = "Bit 7 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 2"]
74 #[inline(always)]
75pub fn op2_force_up(&self) -> OP2_FORCE_UP_R {
76 OP2_FORCE_UP_R::new(((self.bits >> 7) & 1) != 0)
77 }
78}
79#[cfg(feature = "impl-register-debug")]
80impl core::fmt::Debug for R {
81fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
82 f.debug_struct("UPDATE_CFG")
83 .field("global_up_en", &self.global_up_en())
84 .field("global_force_up", &self.global_force_up())
85 .field("op0_up_en", &self.op0_up_en())
86 .field("op0_force_up", &self.op0_force_up())
87 .field("op1_up_en", &self.op1_up_en())
88 .field("op1_force_up", &self.op1_force_up())
89 .field("op2_up_en", &self.op2_up_en())
90 .field("op2_force_up", &self.op2_force_up())
91 .finish()
92 }
93}
94impl W {
95#[doc = "Bit 0 - The global enable of update of all active registers in MCPWM module"]
96 #[inline(always)]
97pub fn global_up_en(&mut self) -> GLOBAL_UP_EN_W<UPDATE_CFG_SPEC> {
98 GLOBAL_UP_EN_W::new(self, 0)
99 }
100#[doc = "Bit 1 - a toggle (software invert its value) will trigger a forced update of all active registers in MCPWM module"]
101 #[inline(always)]
102pub fn global_force_up(&mut self) -> GLOBAL_FORCE_UP_W<UPDATE_CFG_SPEC> {
103 GLOBAL_FORCE_UP_W::new(self, 1)
104 }
105#[doc = "Bit 2 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 0 are enabled"]
106 #[inline(always)]
107pub fn op0_up_en(&mut self) -> OP0_UP_EN_W<UPDATE_CFG_SPEC> {
108 OP0_UP_EN_W::new(self, 2)
109 }
110#[doc = "Bit 3 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 0"]
111 #[inline(always)]
112pub fn op0_force_up(&mut self) -> OP0_FORCE_UP_W<UPDATE_CFG_SPEC> {
113 OP0_FORCE_UP_W::new(self, 3)
114 }
115#[doc = "Bit 4 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 1 are enabled"]
116 #[inline(always)]
117pub fn op1_up_en(&mut self) -> OP1_UP_EN_W<UPDATE_CFG_SPEC> {
118 OP1_UP_EN_W::new(self, 4)
119 }
120#[doc = "Bit 5 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 1"]
121 #[inline(always)]
122pub fn op1_force_up(&mut self) -> OP1_FORCE_UP_W<UPDATE_CFG_SPEC> {
123 OP1_FORCE_UP_W::new(self, 5)
124 }
125#[doc = "Bit 6 - When set and PWM_GLOBAL_UP_EN is set, update of active registers in PWM operator 2 are enabled"]
126 #[inline(always)]
127pub fn op2_up_en(&mut self) -> OP2_UP_EN_W<UPDATE_CFG_SPEC> {
128 OP2_UP_EN_W::new(self, 6)
129 }
130#[doc = "Bit 7 - a toggle (software invert its value) will trigger a forced update of active registers in PWM operator 2"]
131 #[inline(always)]
132pub fn op2_force_up(&mut self) -> OP2_FORCE_UP_W<UPDATE_CFG_SPEC> {
133 OP2_FORCE_UP_W::new(self, 7)
134 }
135}
136#[doc = "Enable update.\n\nYou can [`read`](crate::Reg::read) this register and get [`update_cfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`update_cfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
137pub struct UPDATE_CFG_SPEC;
138impl crate::RegisterSpec for UPDATE_CFG_SPEC {
139type Ux = u32;
140}
141#[doc = "`read()` method returns [`update_cfg::R`](R) reader structure"]
142impl crate::Readable for UPDATE_CFG_SPEC {}
143#[doc = "`write(|w| ..)` method takes [`update_cfg::W`](W) writer structure"]
144impl crate::Writable for UPDATE_CFG_SPEC {
145type Safety = crate::Unsafe;
146const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
147const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
148}
149#[doc = "`reset()` method sets UPDATE_CFG to value 0x55"]
150impl crate::Resettable for UPDATE_CFG_SPEC {
151const RESET_VALUE: u32 = 0x55;
152}