efm32gg11b520_pac/i2c2/
ien.rs1#[doc = "Register `IEN` reader"]
2pub struct R(crate::R<IEN_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<IEN_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<IEN_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<IEN_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `IEN` writer"]
17pub struct W(crate::W<IEN_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<IEN_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<IEN_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<IEN_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `START` reader - START Interrupt Enable"]
38pub type START_R = crate::BitReader<bool>;
39#[doc = "Field `START` writer - START Interrupt Enable"]
40pub type START_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 0>;
41#[doc = "Field `RSTART` reader - RSTART Interrupt Enable"]
42pub type RSTART_R = crate::BitReader<bool>;
43#[doc = "Field `RSTART` writer - RSTART Interrupt Enable"]
44pub type RSTART_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 1>;
45#[doc = "Field `ADDR` reader - ADDR Interrupt Enable"]
46pub type ADDR_R = crate::BitReader<bool>;
47#[doc = "Field `ADDR` writer - ADDR Interrupt Enable"]
48pub type ADDR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 2>;
49#[doc = "Field `TXC` reader - TXC Interrupt Enable"]
50pub type TXC_R = crate::BitReader<bool>;
51#[doc = "Field `TXC` writer - TXC Interrupt Enable"]
52pub type TXC_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 3>;
53#[doc = "Field `TXBL` reader - TXBL Interrupt Enable"]
54pub type TXBL_R = crate::BitReader<bool>;
55#[doc = "Field `TXBL` writer - TXBL Interrupt Enable"]
56pub type TXBL_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 4>;
57#[doc = "Field `RXDATAV` reader - RXDATAV Interrupt Enable"]
58pub type RXDATAV_R = crate::BitReader<bool>;
59#[doc = "Field `RXDATAV` writer - RXDATAV Interrupt Enable"]
60pub type RXDATAV_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 5>;
61#[doc = "Field `ACK` reader - ACK Interrupt Enable"]
62pub type ACK_R = crate::BitReader<bool>;
63#[doc = "Field `ACK` writer - ACK Interrupt Enable"]
64pub type ACK_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 6>;
65#[doc = "Field `NACK` reader - NACK Interrupt Enable"]
66pub type NACK_R = crate::BitReader<bool>;
67#[doc = "Field `NACK` writer - NACK Interrupt Enable"]
68pub type NACK_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 7>;
69#[doc = "Field `MSTOP` reader - MSTOP Interrupt Enable"]
70pub type MSTOP_R = crate::BitReader<bool>;
71#[doc = "Field `MSTOP` writer - MSTOP Interrupt Enable"]
72pub type MSTOP_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 8>;
73#[doc = "Field `ARBLOST` reader - ARBLOST Interrupt Enable"]
74pub type ARBLOST_R = crate::BitReader<bool>;
75#[doc = "Field `ARBLOST` writer - ARBLOST Interrupt Enable"]
76pub type ARBLOST_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 9>;
77#[doc = "Field `BUSERR` reader - BUSERR Interrupt Enable"]
78pub type BUSERR_R = crate::BitReader<bool>;
79#[doc = "Field `BUSERR` writer - BUSERR Interrupt Enable"]
80pub type BUSERR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 10>;
81#[doc = "Field `BUSHOLD` reader - BUSHOLD Interrupt Enable"]
82pub type BUSHOLD_R = crate::BitReader<bool>;
83#[doc = "Field `BUSHOLD` writer - BUSHOLD Interrupt Enable"]
84pub type BUSHOLD_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 11>;
85#[doc = "Field `TXOF` reader - TXOF Interrupt Enable"]
86pub type TXOF_R = crate::BitReader<bool>;
87#[doc = "Field `TXOF` writer - TXOF Interrupt Enable"]
88pub type TXOF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 12>;
89#[doc = "Field `RXUF` reader - RXUF Interrupt Enable"]
90pub type RXUF_R = crate::BitReader<bool>;
91#[doc = "Field `RXUF` writer - RXUF Interrupt Enable"]
92pub type RXUF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 13>;
93#[doc = "Field `BITO` reader - BITO Interrupt Enable"]
94pub type BITO_R = crate::BitReader<bool>;
95#[doc = "Field `BITO` writer - BITO Interrupt Enable"]
96pub type BITO_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 14>;
97#[doc = "Field `CLTO` reader - CLTO Interrupt Enable"]
98pub type CLTO_R = crate::BitReader<bool>;
99#[doc = "Field `CLTO` writer - CLTO Interrupt Enable"]
100pub type CLTO_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 15>;
101#[doc = "Field `SSTOP` reader - SSTOP Interrupt Enable"]
102pub type SSTOP_R = crate::BitReader<bool>;
103#[doc = "Field `SSTOP` writer - SSTOP Interrupt Enable"]
104pub type SSTOP_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 16>;
105#[doc = "Field `RXFULL` reader - RXFULL Interrupt Enable"]
106pub type RXFULL_R = crate::BitReader<bool>;
107#[doc = "Field `RXFULL` writer - RXFULL Interrupt Enable"]
108pub type RXFULL_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 17>;
109#[doc = "Field `CLERR` reader - CLERR Interrupt Enable"]
110pub type CLERR_R = crate::BitReader<bool>;
111#[doc = "Field `CLERR` writer - CLERR Interrupt Enable"]
112pub type CLERR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 18>;
113impl R {
114 #[doc = "Bit 0 - START Interrupt Enable"]
115 #[inline(always)]
116 pub fn start(&self) -> START_R {
117 START_R::new((self.bits & 1) != 0)
118 }
119 #[doc = "Bit 1 - RSTART Interrupt Enable"]
120 #[inline(always)]
121 pub fn rstart(&self) -> RSTART_R {
122 RSTART_R::new(((self.bits >> 1) & 1) != 0)
123 }
124 #[doc = "Bit 2 - ADDR Interrupt Enable"]
125 #[inline(always)]
126 pub fn addr(&self) -> ADDR_R {
127 ADDR_R::new(((self.bits >> 2) & 1) != 0)
128 }
129 #[doc = "Bit 3 - TXC Interrupt Enable"]
130 #[inline(always)]
131 pub fn txc(&self) -> TXC_R {
132 TXC_R::new(((self.bits >> 3) & 1) != 0)
133 }
134 #[doc = "Bit 4 - TXBL Interrupt Enable"]
135 #[inline(always)]
136 pub fn txbl(&self) -> TXBL_R {
137 TXBL_R::new(((self.bits >> 4) & 1) != 0)
138 }
139 #[doc = "Bit 5 - RXDATAV Interrupt Enable"]
140 #[inline(always)]
141 pub fn rxdatav(&self) -> RXDATAV_R {
142 RXDATAV_R::new(((self.bits >> 5) & 1) != 0)
143 }
144 #[doc = "Bit 6 - ACK Interrupt Enable"]
145 #[inline(always)]
146 pub fn ack(&self) -> ACK_R {
147 ACK_R::new(((self.bits >> 6) & 1) != 0)
148 }
149 #[doc = "Bit 7 - NACK Interrupt Enable"]
150 #[inline(always)]
151 pub fn nack(&self) -> NACK_R {
152 NACK_R::new(((self.bits >> 7) & 1) != 0)
153 }
154 #[doc = "Bit 8 - MSTOP Interrupt Enable"]
155 #[inline(always)]
156 pub fn mstop(&self) -> MSTOP_R {
157 MSTOP_R::new(((self.bits >> 8) & 1) != 0)
158 }
159 #[doc = "Bit 9 - ARBLOST Interrupt Enable"]
160 #[inline(always)]
161 pub fn arblost(&self) -> ARBLOST_R {
162 ARBLOST_R::new(((self.bits >> 9) & 1) != 0)
163 }
164 #[doc = "Bit 10 - BUSERR Interrupt Enable"]
165 #[inline(always)]
166 pub fn buserr(&self) -> BUSERR_R {
167 BUSERR_R::new(((self.bits >> 10) & 1) != 0)
168 }
169 #[doc = "Bit 11 - BUSHOLD Interrupt Enable"]
170 #[inline(always)]
171 pub fn bushold(&self) -> BUSHOLD_R {
172 BUSHOLD_R::new(((self.bits >> 11) & 1) != 0)
173 }
174 #[doc = "Bit 12 - TXOF Interrupt Enable"]
175 #[inline(always)]
176 pub fn txof(&self) -> TXOF_R {
177 TXOF_R::new(((self.bits >> 12) & 1) != 0)
178 }
179 #[doc = "Bit 13 - RXUF Interrupt Enable"]
180 #[inline(always)]
181 pub fn rxuf(&self) -> RXUF_R {
182 RXUF_R::new(((self.bits >> 13) & 1) != 0)
183 }
184 #[doc = "Bit 14 - BITO Interrupt Enable"]
185 #[inline(always)]
186 pub fn bito(&self) -> BITO_R {
187 BITO_R::new(((self.bits >> 14) & 1) != 0)
188 }
189 #[doc = "Bit 15 - CLTO Interrupt Enable"]
190 #[inline(always)]
191 pub fn clto(&self) -> CLTO_R {
192 CLTO_R::new(((self.bits >> 15) & 1) != 0)
193 }
194 #[doc = "Bit 16 - SSTOP Interrupt Enable"]
195 #[inline(always)]
196 pub fn sstop(&self) -> SSTOP_R {
197 SSTOP_R::new(((self.bits >> 16) & 1) != 0)
198 }
199 #[doc = "Bit 17 - RXFULL Interrupt Enable"]
200 #[inline(always)]
201 pub fn rxfull(&self) -> RXFULL_R {
202 RXFULL_R::new(((self.bits >> 17) & 1) != 0)
203 }
204 #[doc = "Bit 18 - CLERR Interrupt Enable"]
205 #[inline(always)]
206 pub fn clerr(&self) -> CLERR_R {
207 CLERR_R::new(((self.bits >> 18) & 1) != 0)
208 }
209}
210impl W {
211 #[doc = "Bit 0 - START Interrupt Enable"]
212 #[inline(always)]
213 pub fn start(&mut self) -> START_W {
214 START_W::new(self)
215 }
216 #[doc = "Bit 1 - RSTART Interrupt Enable"]
217 #[inline(always)]
218 pub fn rstart(&mut self) -> RSTART_W {
219 RSTART_W::new(self)
220 }
221 #[doc = "Bit 2 - ADDR Interrupt Enable"]
222 #[inline(always)]
223 pub fn addr(&mut self) -> ADDR_W {
224 ADDR_W::new(self)
225 }
226 #[doc = "Bit 3 - TXC Interrupt Enable"]
227 #[inline(always)]
228 pub fn txc(&mut self) -> TXC_W {
229 TXC_W::new(self)
230 }
231 #[doc = "Bit 4 - TXBL Interrupt Enable"]
232 #[inline(always)]
233 pub fn txbl(&mut self) -> TXBL_W {
234 TXBL_W::new(self)
235 }
236 #[doc = "Bit 5 - RXDATAV Interrupt Enable"]
237 #[inline(always)]
238 pub fn rxdatav(&mut self) -> RXDATAV_W {
239 RXDATAV_W::new(self)
240 }
241 #[doc = "Bit 6 - ACK Interrupt Enable"]
242 #[inline(always)]
243 pub fn ack(&mut self) -> ACK_W {
244 ACK_W::new(self)
245 }
246 #[doc = "Bit 7 - NACK Interrupt Enable"]
247 #[inline(always)]
248 pub fn nack(&mut self) -> NACK_W {
249 NACK_W::new(self)
250 }
251 #[doc = "Bit 8 - MSTOP Interrupt Enable"]
252 #[inline(always)]
253 pub fn mstop(&mut self) -> MSTOP_W {
254 MSTOP_W::new(self)
255 }
256 #[doc = "Bit 9 - ARBLOST Interrupt Enable"]
257 #[inline(always)]
258 pub fn arblost(&mut self) -> ARBLOST_W {
259 ARBLOST_W::new(self)
260 }
261 #[doc = "Bit 10 - BUSERR Interrupt Enable"]
262 #[inline(always)]
263 pub fn buserr(&mut self) -> BUSERR_W {
264 BUSERR_W::new(self)
265 }
266 #[doc = "Bit 11 - BUSHOLD Interrupt Enable"]
267 #[inline(always)]
268 pub fn bushold(&mut self) -> BUSHOLD_W {
269 BUSHOLD_W::new(self)
270 }
271 #[doc = "Bit 12 - TXOF Interrupt Enable"]
272 #[inline(always)]
273 pub fn txof(&mut self) -> TXOF_W {
274 TXOF_W::new(self)
275 }
276 #[doc = "Bit 13 - RXUF Interrupt Enable"]
277 #[inline(always)]
278 pub fn rxuf(&mut self) -> RXUF_W {
279 RXUF_W::new(self)
280 }
281 #[doc = "Bit 14 - BITO Interrupt Enable"]
282 #[inline(always)]
283 pub fn bito(&mut self) -> BITO_W {
284 BITO_W::new(self)
285 }
286 #[doc = "Bit 15 - CLTO Interrupt Enable"]
287 #[inline(always)]
288 pub fn clto(&mut self) -> CLTO_W {
289 CLTO_W::new(self)
290 }
291 #[doc = "Bit 16 - SSTOP Interrupt Enable"]
292 #[inline(always)]
293 pub fn sstop(&mut self) -> SSTOP_W {
294 SSTOP_W::new(self)
295 }
296 #[doc = "Bit 17 - RXFULL Interrupt Enable"]
297 #[inline(always)]
298 pub fn rxfull(&mut self) -> RXFULL_W {
299 RXFULL_W::new(self)
300 }
301 #[doc = "Bit 18 - CLERR Interrupt Enable"]
302 #[inline(always)]
303 pub fn clerr(&mut self) -> CLERR_W {
304 CLERR_W::new(self)
305 }
306 #[doc = "Writes raw bits to the register."]
307 #[inline(always)]
308 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
309 self.0.bits(bits);
310 self
311 }
312}
313#[doc = "Interrupt Enable Register\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 [ien](index.html) module"]
314pub struct IEN_SPEC;
315impl crate::RegisterSpec for IEN_SPEC {
316 type Ux = u32;
317}
318#[doc = "`read()` method returns [ien::R](R) reader structure"]
319impl crate::Readable for IEN_SPEC {
320 type Reader = R;
321}
322#[doc = "`write(|w| ..)` method takes [ien::W](W) writer structure"]
323impl crate::Writable for IEN_SPEC {
324 type Writer = W;
325}
326#[doc = "`reset()` method sets IEN to value 0"]
327impl crate::Resettable for IEN_SPEC {
328 #[inline(always)]
329 fn reset_value() -> Self::Ux {
330 0
331 }
332}