efm32tg11b_pac/efm32tg11b540/usart2/
ien.rs

1#[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 `TXC` reader - TXC Interrupt Enable"]
38pub type TXC_R = crate::BitReader<bool>;
39#[doc = "Field `TXC` writer - TXC Interrupt Enable"]
40pub type TXC_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
41#[doc = "Field `TXBL` reader - TXBL Interrupt Enable"]
42pub type TXBL_R = crate::BitReader<bool>;
43#[doc = "Field `TXBL` writer - TXBL Interrupt Enable"]
44pub type TXBL_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
45#[doc = "Field `RXDATAV` reader - RXDATAV Interrupt Enable"]
46pub type RXDATAV_R = crate::BitReader<bool>;
47#[doc = "Field `RXDATAV` writer - RXDATAV Interrupt Enable"]
48pub type RXDATAV_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
49#[doc = "Field `RXFULL` reader - RXFULL Interrupt Enable"]
50pub type RXFULL_R = crate::BitReader<bool>;
51#[doc = "Field `RXFULL` writer - RXFULL Interrupt Enable"]
52pub type RXFULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
53#[doc = "Field `RXOF` reader - RXOF Interrupt Enable"]
54pub type RXOF_R = crate::BitReader<bool>;
55#[doc = "Field `RXOF` writer - RXOF Interrupt Enable"]
56pub type RXOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
57#[doc = "Field `RXUF` reader - RXUF Interrupt Enable"]
58pub type RXUF_R = crate::BitReader<bool>;
59#[doc = "Field `RXUF` writer - RXUF Interrupt Enable"]
60pub type RXUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
61#[doc = "Field `TXOF` reader - TXOF Interrupt Enable"]
62pub type TXOF_R = crate::BitReader<bool>;
63#[doc = "Field `TXOF` writer - TXOF Interrupt Enable"]
64pub type TXOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
65#[doc = "Field `TXUF` reader - TXUF Interrupt Enable"]
66pub type TXUF_R = crate::BitReader<bool>;
67#[doc = "Field `TXUF` writer - TXUF Interrupt Enable"]
68pub type TXUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
69#[doc = "Field `PERR` reader - PERR Interrupt Enable"]
70pub type PERR_R = crate::BitReader<bool>;
71#[doc = "Field `PERR` writer - PERR Interrupt Enable"]
72pub type PERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
73#[doc = "Field `FERR` reader - FERR Interrupt Enable"]
74pub type FERR_R = crate::BitReader<bool>;
75#[doc = "Field `FERR` writer - FERR Interrupt Enable"]
76pub type FERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
77#[doc = "Field `MPAF` reader - MPAF Interrupt Enable"]
78pub type MPAF_R = crate::BitReader<bool>;
79#[doc = "Field `MPAF` writer - MPAF Interrupt Enable"]
80pub type MPAF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
81#[doc = "Field `SSM` reader - SSM Interrupt Enable"]
82pub type SSM_R = crate::BitReader<bool>;
83#[doc = "Field `SSM` writer - SSM Interrupt Enable"]
84pub type SSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
85#[doc = "Field `CCF` reader - CCF Interrupt Enable"]
86pub type CCF_R = crate::BitReader<bool>;
87#[doc = "Field `CCF` writer - CCF Interrupt Enable"]
88pub type CCF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
89#[doc = "Field `TXIDLE` reader - TXIDLE Interrupt Enable"]
90pub type TXIDLE_R = crate::BitReader<bool>;
91#[doc = "Field `TXIDLE` writer - TXIDLE Interrupt Enable"]
92pub type TXIDLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
93#[doc = "Field `TCMP0` reader - TCMP0 Interrupt Enable"]
94pub type TCMP0_R = crate::BitReader<bool>;
95#[doc = "Field `TCMP0` writer - TCMP0 Interrupt Enable"]
96pub type TCMP0_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
97#[doc = "Field `TCMP1` reader - TCMP1 Interrupt Enable"]
98pub type TCMP1_R = crate::BitReader<bool>;
99#[doc = "Field `TCMP1` writer - TCMP1 Interrupt Enable"]
100pub type TCMP1_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
101#[doc = "Field `TCMP2` reader - TCMP2 Interrupt Enable"]
102pub type TCMP2_R = crate::BitReader<bool>;
103#[doc = "Field `TCMP2` writer - TCMP2 Interrupt Enable"]
104pub type TCMP2_W<'a, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
105impl R {
106    #[doc = "Bit 0 - TXC Interrupt Enable"]
107    #[inline(always)]
108    pub fn txc(&self) -> TXC_R {
109        TXC_R::new((self.bits & 1) != 0)
110    }
111    #[doc = "Bit 1 - TXBL Interrupt Enable"]
112    #[inline(always)]
113    pub fn txbl(&self) -> TXBL_R {
114        TXBL_R::new(((self.bits >> 1) & 1) != 0)
115    }
116    #[doc = "Bit 2 - RXDATAV Interrupt Enable"]
117    #[inline(always)]
118    pub fn rxdatav(&self) -> RXDATAV_R {
119        RXDATAV_R::new(((self.bits >> 2) & 1) != 0)
120    }
121    #[doc = "Bit 3 - RXFULL Interrupt Enable"]
122    #[inline(always)]
123    pub fn rxfull(&self) -> RXFULL_R {
124        RXFULL_R::new(((self.bits >> 3) & 1) != 0)
125    }
126    #[doc = "Bit 4 - RXOF Interrupt Enable"]
127    #[inline(always)]
128    pub fn rxof(&self) -> RXOF_R {
129        RXOF_R::new(((self.bits >> 4) & 1) != 0)
130    }
131    #[doc = "Bit 5 - RXUF Interrupt Enable"]
132    #[inline(always)]
133    pub fn rxuf(&self) -> RXUF_R {
134        RXUF_R::new(((self.bits >> 5) & 1) != 0)
135    }
136    #[doc = "Bit 6 - TXOF Interrupt Enable"]
137    #[inline(always)]
138    pub fn txof(&self) -> TXOF_R {
139        TXOF_R::new(((self.bits >> 6) & 1) != 0)
140    }
141    #[doc = "Bit 7 - TXUF Interrupt Enable"]
142    #[inline(always)]
143    pub fn txuf(&self) -> TXUF_R {
144        TXUF_R::new(((self.bits >> 7) & 1) != 0)
145    }
146    #[doc = "Bit 8 - PERR Interrupt Enable"]
147    #[inline(always)]
148    pub fn perr(&self) -> PERR_R {
149        PERR_R::new(((self.bits >> 8) & 1) != 0)
150    }
151    #[doc = "Bit 9 - FERR Interrupt Enable"]
152    #[inline(always)]
153    pub fn ferr(&self) -> FERR_R {
154        FERR_R::new(((self.bits >> 9) & 1) != 0)
155    }
156    #[doc = "Bit 10 - MPAF Interrupt Enable"]
157    #[inline(always)]
158    pub fn mpaf(&self) -> MPAF_R {
159        MPAF_R::new(((self.bits >> 10) & 1) != 0)
160    }
161    #[doc = "Bit 11 - SSM Interrupt Enable"]
162    #[inline(always)]
163    pub fn ssm(&self) -> SSM_R {
164        SSM_R::new(((self.bits >> 11) & 1) != 0)
165    }
166    #[doc = "Bit 12 - CCF Interrupt Enable"]
167    #[inline(always)]
168    pub fn ccf(&self) -> CCF_R {
169        CCF_R::new(((self.bits >> 12) & 1) != 0)
170    }
171    #[doc = "Bit 13 - TXIDLE Interrupt Enable"]
172    #[inline(always)]
173    pub fn txidle(&self) -> TXIDLE_R {
174        TXIDLE_R::new(((self.bits >> 13) & 1) != 0)
175    }
176    #[doc = "Bit 14 - TCMP0 Interrupt Enable"]
177    #[inline(always)]
178    pub fn tcmp0(&self) -> TCMP0_R {
179        TCMP0_R::new(((self.bits >> 14) & 1) != 0)
180    }
181    #[doc = "Bit 15 - TCMP1 Interrupt Enable"]
182    #[inline(always)]
183    pub fn tcmp1(&self) -> TCMP1_R {
184        TCMP1_R::new(((self.bits >> 15) & 1) != 0)
185    }
186    #[doc = "Bit 16 - TCMP2 Interrupt Enable"]
187    #[inline(always)]
188    pub fn tcmp2(&self) -> TCMP2_R {
189        TCMP2_R::new(((self.bits >> 16) & 1) != 0)
190    }
191}
192impl W {
193    #[doc = "Bit 0 - TXC Interrupt Enable"]
194    #[inline(always)]
195    #[must_use]
196    pub fn txc(&mut self) -> TXC_W<0> {
197        TXC_W::new(self)
198    }
199    #[doc = "Bit 1 - TXBL Interrupt Enable"]
200    #[inline(always)]
201    #[must_use]
202    pub fn txbl(&mut self) -> TXBL_W<1> {
203        TXBL_W::new(self)
204    }
205    #[doc = "Bit 2 - RXDATAV Interrupt Enable"]
206    #[inline(always)]
207    #[must_use]
208    pub fn rxdatav(&mut self) -> RXDATAV_W<2> {
209        RXDATAV_W::new(self)
210    }
211    #[doc = "Bit 3 - RXFULL Interrupt Enable"]
212    #[inline(always)]
213    #[must_use]
214    pub fn rxfull(&mut self) -> RXFULL_W<3> {
215        RXFULL_W::new(self)
216    }
217    #[doc = "Bit 4 - RXOF Interrupt Enable"]
218    #[inline(always)]
219    #[must_use]
220    pub fn rxof(&mut self) -> RXOF_W<4> {
221        RXOF_W::new(self)
222    }
223    #[doc = "Bit 5 - RXUF Interrupt Enable"]
224    #[inline(always)]
225    #[must_use]
226    pub fn rxuf(&mut self) -> RXUF_W<5> {
227        RXUF_W::new(self)
228    }
229    #[doc = "Bit 6 - TXOF Interrupt Enable"]
230    #[inline(always)]
231    #[must_use]
232    pub fn txof(&mut self) -> TXOF_W<6> {
233        TXOF_W::new(self)
234    }
235    #[doc = "Bit 7 - TXUF Interrupt Enable"]
236    #[inline(always)]
237    #[must_use]
238    pub fn txuf(&mut self) -> TXUF_W<7> {
239        TXUF_W::new(self)
240    }
241    #[doc = "Bit 8 - PERR Interrupt Enable"]
242    #[inline(always)]
243    #[must_use]
244    pub fn perr(&mut self) -> PERR_W<8> {
245        PERR_W::new(self)
246    }
247    #[doc = "Bit 9 - FERR Interrupt Enable"]
248    #[inline(always)]
249    #[must_use]
250    pub fn ferr(&mut self) -> FERR_W<9> {
251        FERR_W::new(self)
252    }
253    #[doc = "Bit 10 - MPAF Interrupt Enable"]
254    #[inline(always)]
255    #[must_use]
256    pub fn mpaf(&mut self) -> MPAF_W<10> {
257        MPAF_W::new(self)
258    }
259    #[doc = "Bit 11 - SSM Interrupt Enable"]
260    #[inline(always)]
261    #[must_use]
262    pub fn ssm(&mut self) -> SSM_W<11> {
263        SSM_W::new(self)
264    }
265    #[doc = "Bit 12 - CCF Interrupt Enable"]
266    #[inline(always)]
267    #[must_use]
268    pub fn ccf(&mut self) -> CCF_W<12> {
269        CCF_W::new(self)
270    }
271    #[doc = "Bit 13 - TXIDLE Interrupt Enable"]
272    #[inline(always)]
273    #[must_use]
274    pub fn txidle(&mut self) -> TXIDLE_W<13> {
275        TXIDLE_W::new(self)
276    }
277    #[doc = "Bit 14 - TCMP0 Interrupt Enable"]
278    #[inline(always)]
279    #[must_use]
280    pub fn tcmp0(&mut self) -> TCMP0_W<14> {
281        TCMP0_W::new(self)
282    }
283    #[doc = "Bit 15 - TCMP1 Interrupt Enable"]
284    #[inline(always)]
285    #[must_use]
286    pub fn tcmp1(&mut self) -> TCMP1_W<15> {
287        TCMP1_W::new(self)
288    }
289    #[doc = "Bit 16 - TCMP2 Interrupt Enable"]
290    #[inline(always)]
291    #[must_use]
292    pub fn tcmp2(&mut self) -> TCMP2_W<16> {
293        TCMP2_W::new(self)
294    }
295    #[doc = "Writes raw bits to the register."]
296    #[inline(always)]
297    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
298        self.0.bits(bits);
299        self
300    }
301}
302#[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"]
303pub struct IEN_SPEC;
304impl crate::RegisterSpec for IEN_SPEC {
305    type Ux = u32;
306}
307#[doc = "`read()` method returns [ien::R](R) reader structure"]
308impl crate::Readable for IEN_SPEC {
309    type Reader = R;
310}
311#[doc = "`write(|w| ..)` method takes [ien::W](W) writer structure"]
312impl crate::Writable for IEN_SPEC {
313    type Writer = W;
314    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
315    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
316}
317#[doc = "`reset()` method sets IEN to value 0"]
318impl crate::Resettable for IEN_SPEC {
319    const RESET_VALUE: Self::Ux = 0;
320}