ht32f1yyy/ht32f1655_56/mctm0/
mctm_evgr.rs1#[doc = "Register `MCTM_EVGR` reader"]
2pub struct R(crate::R<MCTM_EVGR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<MCTM_EVGR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<MCTM_EVGR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<MCTM_EVGR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `MCTM_EVGR` writer"]
17pub struct W(crate::W<MCTM_EVGR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<MCTM_EVGR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<MCTM_EVGR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<MCTM_EVGR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CH0CCG` reader - CH0CCG"]
38pub type CH0CCG_R = crate::BitReader;
39#[doc = "Field `CH0CCG` writer - CH0CCG"]
40pub type CH0CCG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
41#[doc = "Field `CH1CCG` reader - CH1CCG"]
42pub type CH1CCG_R = crate::BitReader;
43#[doc = "Field `CH1CCG` writer - CH1CCG"]
44pub type CH1CCG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
45#[doc = "Field `CH2CCG` reader - CH2CCG"]
46pub type CH2CCG_R = crate::BitReader;
47#[doc = "Field `CH2CCG` writer - CH2CCG"]
48pub type CH2CCG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
49#[doc = "Field `CH3CCG` reader - CH3CCG"]
50pub type CH3CCG_R = crate::BitReader;
51#[doc = "Field `CH3CCG` writer - CH3CCG"]
52pub type CH3CCG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
53#[doc = "Field `UEV1G` reader - UEV1G"]
54pub type UEV1G_R = crate::BitReader;
55#[doc = "Field `UEV1G` writer - UEV1G"]
56pub type UEV1G_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
57#[doc = "Field `UEV2G` reader - UEV2G"]
58pub type UEV2G_R = crate::BitReader;
59#[doc = "Field `UEV2G` writer - UEV2G"]
60pub type UEV2G_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
61#[doc = "Field `TEVG` reader - TEVG"]
62pub type TEVG_R = crate::BitReader;
63#[doc = "Field `TEVG` writer - TEVG"]
64pub type TEVG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
65#[doc = "Field `BRKG` reader - BRKG"]
66pub type BRKG_R = crate::BitReader;
67#[doc = "Field `BRKG` writer - BRKG"]
68pub type BRKG_W<'a, const O: u8> = crate::BitWriter<'a, MCTM_EVGR_SPEC, O>;
69impl R {
70 #[doc = "Bit 0 - CH0CCG"]
71 #[inline(always)]
72 pub fn ch0ccg(&self) -> CH0CCG_R {
73 CH0CCG_R::new((self.bits & 1) != 0)
74 }
75 #[doc = "Bit 1 - CH1CCG"]
76 #[inline(always)]
77 pub fn ch1ccg(&self) -> CH1CCG_R {
78 CH1CCG_R::new(((self.bits >> 1) & 1) != 0)
79 }
80 #[doc = "Bit 2 - CH2CCG"]
81 #[inline(always)]
82 pub fn ch2ccg(&self) -> CH2CCG_R {
83 CH2CCG_R::new(((self.bits >> 2) & 1) != 0)
84 }
85 #[doc = "Bit 3 - CH3CCG"]
86 #[inline(always)]
87 pub fn ch3ccg(&self) -> CH3CCG_R {
88 CH3CCG_R::new(((self.bits >> 3) & 1) != 0)
89 }
90 #[doc = "Bit 8 - UEV1G"]
91 #[inline(always)]
92 pub fn uev1g(&self) -> UEV1G_R {
93 UEV1G_R::new(((self.bits >> 8) & 1) != 0)
94 }
95 #[doc = "Bit 9 - UEV2G"]
96 #[inline(always)]
97 pub fn uev2g(&self) -> UEV2G_R {
98 UEV2G_R::new(((self.bits >> 9) & 1) != 0)
99 }
100 #[doc = "Bit 10 - TEVG"]
101 #[inline(always)]
102 pub fn tevg(&self) -> TEVG_R {
103 TEVG_R::new(((self.bits >> 10) & 1) != 0)
104 }
105 #[doc = "Bit 11 - BRKG"]
106 #[inline(always)]
107 pub fn brkg(&self) -> BRKG_R {
108 BRKG_R::new(((self.bits >> 11) & 1) != 0)
109 }
110}
111impl W {
112 #[doc = "Bit 0 - CH0CCG"]
113 #[inline(always)]
114 #[must_use]
115 pub fn ch0ccg(&mut self) -> CH0CCG_W<0> {
116 CH0CCG_W::new(self)
117 }
118 #[doc = "Bit 1 - CH1CCG"]
119 #[inline(always)]
120 #[must_use]
121 pub fn ch1ccg(&mut self) -> CH1CCG_W<1> {
122 CH1CCG_W::new(self)
123 }
124 #[doc = "Bit 2 - CH2CCG"]
125 #[inline(always)]
126 #[must_use]
127 pub fn ch2ccg(&mut self) -> CH2CCG_W<2> {
128 CH2CCG_W::new(self)
129 }
130 #[doc = "Bit 3 - CH3CCG"]
131 #[inline(always)]
132 #[must_use]
133 pub fn ch3ccg(&mut self) -> CH3CCG_W<3> {
134 CH3CCG_W::new(self)
135 }
136 #[doc = "Bit 8 - UEV1G"]
137 #[inline(always)]
138 #[must_use]
139 pub fn uev1g(&mut self) -> UEV1G_W<8> {
140 UEV1G_W::new(self)
141 }
142 #[doc = "Bit 9 - UEV2G"]
143 #[inline(always)]
144 #[must_use]
145 pub fn uev2g(&mut self) -> UEV2G_W<9> {
146 UEV2G_W::new(self)
147 }
148 #[doc = "Bit 10 - TEVG"]
149 #[inline(always)]
150 #[must_use]
151 pub fn tevg(&mut self) -> TEVG_W<10> {
152 TEVG_W::new(self)
153 }
154 #[doc = "Bit 11 - BRKG"]
155 #[inline(always)]
156 #[must_use]
157 pub fn brkg(&mut self) -> BRKG_W<11> {
158 BRKG_W::new(self)
159 }
160 #[doc = "Writes raw bits to the register."]
161 #[inline(always)]
162 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
163 self.0.bits(bits);
164 self
165 }
166}
167#[doc = "MCTM_EVGR\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mctm_evgr](index.html) module"]
168pub struct MCTM_EVGR_SPEC;
169impl crate::RegisterSpec for MCTM_EVGR_SPEC {
170 type Ux = u32;
171}
172#[doc = "`read()` method returns [mctm_evgr::R](R) reader structure"]
173impl crate::Readable for MCTM_EVGR_SPEC {
174 type Reader = R;
175}
176#[doc = "`write(|w| ..)` method takes [mctm_evgr::W](W) writer structure"]
177impl crate::Writable for MCTM_EVGR_SPEC {
178 type Writer = W;
179 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
180 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
181}
182#[doc = "`reset()` method sets MCTM_EVGR to value 0"]
183impl crate::Resettable for MCTM_EVGR_SPEC {
184 const RESET_VALUE: Self::Ux = 0;
185}