stm32l4/stm32l4x1/tim15/
egr.rs1pub type R = crate::R<EGRrs>;
3pub type W = crate::W<EGRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum UG {
11 Update = 1,
13}
14impl From<UG> for bool {
15 #[inline(always)]
16 fn from(variant: UG) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type UG_W<'a, REG> = crate::BitWriter<'a, REG, UG>;
22impl<'a, REG> UG_W<'a, REG>
23where
24 REG: crate::Writable + crate::RegisterSpec,
25{
26 #[inline(always)]
28 pub fn update(self) -> &'a mut crate::W<REG> {
29 self.variant(UG::Update)
30 }
31}
32#[cfg_attr(feature = "defmt", derive(defmt::Format))]
36#[derive(Clone, Copy, Debug, PartialEq, Eq)]
37pub enum CC1GW {
38 Trigger = 1,
40}
41impl From<CC1GW> for bool {
42 #[inline(always)]
43 fn from(variant: CC1GW) -> Self {
44 variant as u8 != 0
45 }
46}
47pub type CCG_W<'a, REG> = crate::BitWriter<'a, REG, CC1GW>;
49impl<'a, REG> CCG_W<'a, REG>
50where
51 REG: crate::Writable + crate::RegisterSpec,
52{
53 #[inline(always)]
55 pub fn trigger(self) -> &'a mut crate::W<REG> {
56 self.variant(CC1GW::Trigger)
57 }
58}
59#[cfg_attr(feature = "defmt", derive(defmt::Format))]
63#[derive(Clone, Copy, Debug, PartialEq, Eq)]
64pub enum COMGW {
65 Trigger = 1,
67}
68impl From<COMGW> for bool {
69 #[inline(always)]
70 fn from(variant: COMGW) -> Self {
71 variant as u8 != 0
72 }
73}
74pub type COMG_R = crate::BitReader<COMGW>;
76impl COMG_R {
77 #[inline(always)]
79 pub const fn variant(&self) -> Option<COMGW> {
80 match self.bits {
81 true => Some(COMGW::Trigger),
82 _ => None,
83 }
84 }
85 #[inline(always)]
87 pub fn is_trigger(&self) -> bool {
88 *self == COMGW::Trigger
89 }
90}
91pub type COMG_W<'a, REG> = crate::BitWriter<'a, REG, COMGW>;
93impl<'a, REG> COMG_W<'a, REG>
94where
95 REG: crate::Writable + crate::RegisterSpec,
96{
97 #[inline(always)]
99 pub fn trigger(self) -> &'a mut crate::W<REG> {
100 self.variant(COMGW::Trigger)
101 }
102}
103#[cfg_attr(feature = "defmt", derive(defmt::Format))]
107#[derive(Clone, Copy, Debug, PartialEq, Eq)]
108pub enum TGW {
109 Trigger = 1,
111}
112impl From<TGW> for bool {
113 #[inline(always)]
114 fn from(variant: TGW) -> Self {
115 variant as u8 != 0
116 }
117}
118pub type TG_W<'a, REG> = crate::BitWriter<'a, REG, TGW>;
120impl<'a, REG> TG_W<'a, REG>
121where
122 REG: crate::Writable + crate::RegisterSpec,
123{
124 #[inline(always)]
126 pub fn trigger(self) -> &'a mut crate::W<REG> {
127 self.variant(TGW::Trigger)
128 }
129}
130#[cfg_attr(feature = "defmt", derive(defmt::Format))]
134#[derive(Clone, Copy, Debug, PartialEq, Eq)]
135pub enum BGW {
136 Trigger = 1,
138}
139impl From<BGW> for bool {
140 #[inline(always)]
141 fn from(variant: BGW) -> Self {
142 variant as u8 != 0
143 }
144}
145pub type BG_W<'a, REG> = crate::BitWriter<'a, REG, BGW>;
147impl<'a, REG> BG_W<'a, REG>
148where
149 REG: crate::Writable + crate::RegisterSpec,
150{
151 #[inline(always)]
153 pub fn trigger(self) -> &'a mut crate::W<REG> {
154 self.variant(BGW::Trigger)
155 }
156}
157impl R {
158 #[inline(always)]
160 pub fn comg(&self) -> COMG_R {
161 COMG_R::new(((self.bits >> 5) & 1) != 0)
162 }
163}
164impl core::fmt::Debug for R {
165 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
166 f.debug_struct("EGR").field("comg", &self.comg()).finish()
167 }
168}
169impl W {
170 #[inline(always)]
172 pub fn ug(&mut self) -> UG_W<EGRrs> {
173 UG_W::new(self, 0)
174 }
175 #[inline(always)]
179 pub fn ccg(&mut self, n: u8) -> CCG_W<EGRrs> {
180 #[allow(clippy::no_effect)]
181 [(); 2][n as usize];
182 CCG_W::new(self, n + 1)
183 }
184 #[inline(always)]
186 pub fn cc1g(&mut self) -> CCG_W<EGRrs> {
187 CCG_W::new(self, 1)
188 }
189 #[inline(always)]
191 pub fn cc2g(&mut self) -> CCG_W<EGRrs> {
192 CCG_W::new(self, 2)
193 }
194 #[inline(always)]
196 pub fn comg(&mut self) -> COMG_W<EGRrs> {
197 COMG_W::new(self, 5)
198 }
199 #[inline(always)]
201 pub fn tg(&mut self) -> TG_W<EGRrs> {
202 TG_W::new(self, 6)
203 }
204 #[inline(always)]
206 pub fn bg(&mut self) -> BG_W<EGRrs> {
207 BG_W::new(self, 7)
208 }
209}
210pub struct EGRrs;
216impl crate::RegisterSpec for EGRrs {
217 type Ux = u32;
218}
219impl crate::Readable for EGRrs {}
221impl crate::Writable for EGRrs {
223 type Safety = crate::Unsafe;
224}
225impl crate::Resettable for EGRrs {}