efm32pg22_pac/efm32pg22c200/euart0_ns/
if_.rs

1#[doc = "Register `IF` reader"]
2pub struct R(crate::R<IF_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IF_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IF_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IF_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `IF` writer"]
17pub struct W(crate::W<IF_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IF_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<IF_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IF_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TXC` reader - TX Complete Interrupt Flag"]
38pub type TXC_R = crate::BitReader<bool>;
39#[doc = "Field `TXC` writer - TX Complete Interrupt Flag"]
40pub type TXC_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
41#[doc = "Field `TXFL` reader - TX FIFO Level Interrupt Flag"]
42pub type TXFL_R = crate::BitReader<bool>;
43#[doc = "Field `TXFL` writer - TX FIFO Level Interrupt Flag"]
44pub type TXFL_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
45#[doc = "Field `RXFL` reader - RX FIFO Level Interrupt Flag"]
46pub type RXFL_R = crate::BitReader<bool>;
47#[doc = "Field `RXFL` writer - RX FIFO Level Interrupt Flag"]
48pub type RXFL_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
49#[doc = "Field `RXFULL` reader - RX FIFO Full Interrupt Flag"]
50pub type RXFULL_R = crate::BitReader<bool>;
51#[doc = "Field `RXFULL` writer - RX FIFO Full Interrupt Flag"]
52pub type RXFULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
53#[doc = "Field `RXOF` reader - RX FIFO Overflow Interrupt Flag"]
54pub type RXOF_R = crate::BitReader<bool>;
55#[doc = "Field `RXOF` writer - RX FIFO Overflow Interrupt Flag"]
56pub type RXOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
57#[doc = "Field `RXUF` reader - RX FIFO Underflow Interrupt Flag"]
58pub type RXUF_R = crate::BitReader<bool>;
59#[doc = "Field `RXUF` writer - RX FIFO Underflow Interrupt Flag"]
60pub type RXUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
61#[doc = "Field `TXOF` reader - TX FIFO Overflow Interrupt Flag"]
62pub type TXOF_R = crate::BitReader<bool>;
63#[doc = "Field `TXOF` writer - TX FIFO Overflow Interrupt Flag"]
64pub type TXOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
65#[doc = "Field `PERR` reader - Parity Error Interrupt Flag"]
66pub type PERR_R = crate::BitReader<bool>;
67#[doc = "Field `PERR` writer - Parity Error Interrupt Flag"]
68pub type PERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
69#[doc = "Field `FERR` reader - Framing Error Interrupt Flag"]
70pub type FERR_R = crate::BitReader<bool>;
71#[doc = "Field `FERR` writer - Framing Error Interrupt Flag"]
72pub type FERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
73#[doc = "Field `MPAF` reader - Multi-Processor Address Frame Interrupt"]
74pub type MPAF_R = crate::BitReader<bool>;
75#[doc = "Field `MPAF` writer - Multi-Processor Address Frame Interrupt"]
76pub type MPAF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
77#[doc = "Field `CCF` reader - Collision Check Fail Interrupt Flag"]
78pub type CCF_R = crate::BitReader<bool>;
79#[doc = "Field `CCF` writer - Collision Check Fail Interrupt Flag"]
80pub type CCF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
81#[doc = "Field `TXIDLE` reader - TX Idle Interrupt Flag"]
82pub type TXIDLE_R = crate::BitReader<bool>;
83#[doc = "Field `TXIDLE` writer - TX Idle Interrupt Flag"]
84pub type TXIDLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
85#[doc = "Field `STARTF` reader - Start Frame Interrupt Flag"]
86pub type STARTF_R = crate::BitReader<bool>;
87#[doc = "Field `STARTF` writer - Start Frame Interrupt Flag"]
88pub type STARTF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
89#[doc = "Field `SIGF` reader - Signal Frame Interrupt Flag"]
90pub type SIGF_R = crate::BitReader<bool>;
91#[doc = "Field `SIGF` writer - Signal Frame Interrupt Flag"]
92pub type SIGF_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
93#[doc = "Field `AUTOBAUDDONE` reader - Auto Baud Complete Interrupt Flag"]
94pub type AUTOBAUDDONE_R = crate::BitReader<bool>;
95#[doc = "Field `AUTOBAUDDONE` writer - Auto Baud Complete Interrupt Flag"]
96pub type AUTOBAUDDONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
97impl R {
98    #[doc = "Bit 0 - TX Complete Interrupt Flag"]
99    #[inline(always)]
100    pub fn txc(&self) -> TXC_R {
101        TXC_R::new((self.bits & 1) != 0)
102    }
103    #[doc = "Bit 1 - TX FIFO Level Interrupt Flag"]
104    #[inline(always)]
105    pub fn txfl(&self) -> TXFL_R {
106        TXFL_R::new(((self.bits >> 1) & 1) != 0)
107    }
108    #[doc = "Bit 2 - RX FIFO Level Interrupt Flag"]
109    #[inline(always)]
110    pub fn rxfl(&self) -> RXFL_R {
111        RXFL_R::new(((self.bits >> 2) & 1) != 0)
112    }
113    #[doc = "Bit 3 - RX FIFO Full Interrupt Flag"]
114    #[inline(always)]
115    pub fn rxfull(&self) -> RXFULL_R {
116        RXFULL_R::new(((self.bits >> 3) & 1) != 0)
117    }
118    #[doc = "Bit 4 - RX FIFO Overflow Interrupt Flag"]
119    #[inline(always)]
120    pub fn rxof(&self) -> RXOF_R {
121        RXOF_R::new(((self.bits >> 4) & 1) != 0)
122    }
123    #[doc = "Bit 5 - RX FIFO Underflow Interrupt Flag"]
124    #[inline(always)]
125    pub fn rxuf(&self) -> RXUF_R {
126        RXUF_R::new(((self.bits >> 5) & 1) != 0)
127    }
128    #[doc = "Bit 6 - TX FIFO Overflow Interrupt Flag"]
129    #[inline(always)]
130    pub fn txof(&self) -> TXOF_R {
131        TXOF_R::new(((self.bits >> 6) & 1) != 0)
132    }
133    #[doc = "Bit 8 - Parity Error Interrupt Flag"]
134    #[inline(always)]
135    pub fn perr(&self) -> PERR_R {
136        PERR_R::new(((self.bits >> 8) & 1) != 0)
137    }
138    #[doc = "Bit 9 - Framing Error Interrupt Flag"]
139    #[inline(always)]
140    pub fn ferr(&self) -> FERR_R {
141        FERR_R::new(((self.bits >> 9) & 1) != 0)
142    }
143    #[doc = "Bit 10 - Multi-Processor Address Frame Interrupt"]
144    #[inline(always)]
145    pub fn mpaf(&self) -> MPAF_R {
146        MPAF_R::new(((self.bits >> 10) & 1) != 0)
147    }
148    #[doc = "Bit 12 - Collision Check Fail Interrupt Flag"]
149    #[inline(always)]
150    pub fn ccf(&self) -> CCF_R {
151        CCF_R::new(((self.bits >> 12) & 1) != 0)
152    }
153    #[doc = "Bit 13 - TX Idle Interrupt Flag"]
154    #[inline(always)]
155    pub fn txidle(&self) -> TXIDLE_R {
156        TXIDLE_R::new(((self.bits >> 13) & 1) != 0)
157    }
158    #[doc = "Bit 18 - Start Frame Interrupt Flag"]
159    #[inline(always)]
160    pub fn startf(&self) -> STARTF_R {
161        STARTF_R::new(((self.bits >> 18) & 1) != 0)
162    }
163    #[doc = "Bit 19 - Signal Frame Interrupt Flag"]
164    #[inline(always)]
165    pub fn sigf(&self) -> SIGF_R {
166        SIGF_R::new(((self.bits >> 19) & 1) != 0)
167    }
168    #[doc = "Bit 24 - Auto Baud Complete Interrupt Flag"]
169    #[inline(always)]
170    pub fn autobauddone(&self) -> AUTOBAUDDONE_R {
171        AUTOBAUDDONE_R::new(((self.bits >> 24) & 1) != 0)
172    }
173}
174impl W {
175    #[doc = "Bit 0 - TX Complete Interrupt Flag"]
176    #[inline(always)]
177    #[must_use]
178    pub fn txc(&mut self) -> TXC_W<0> {
179        TXC_W::new(self)
180    }
181    #[doc = "Bit 1 - TX FIFO Level Interrupt Flag"]
182    #[inline(always)]
183    #[must_use]
184    pub fn txfl(&mut self) -> TXFL_W<1> {
185        TXFL_W::new(self)
186    }
187    #[doc = "Bit 2 - RX FIFO Level Interrupt Flag"]
188    #[inline(always)]
189    #[must_use]
190    pub fn rxfl(&mut self) -> RXFL_W<2> {
191        RXFL_W::new(self)
192    }
193    #[doc = "Bit 3 - RX FIFO Full Interrupt Flag"]
194    #[inline(always)]
195    #[must_use]
196    pub fn rxfull(&mut self) -> RXFULL_W<3> {
197        RXFULL_W::new(self)
198    }
199    #[doc = "Bit 4 - RX FIFO Overflow Interrupt Flag"]
200    #[inline(always)]
201    #[must_use]
202    pub fn rxof(&mut self) -> RXOF_W<4> {
203        RXOF_W::new(self)
204    }
205    #[doc = "Bit 5 - RX FIFO Underflow Interrupt Flag"]
206    #[inline(always)]
207    #[must_use]
208    pub fn rxuf(&mut self) -> RXUF_W<5> {
209        RXUF_W::new(self)
210    }
211    #[doc = "Bit 6 - TX FIFO Overflow Interrupt Flag"]
212    #[inline(always)]
213    #[must_use]
214    pub fn txof(&mut self) -> TXOF_W<6> {
215        TXOF_W::new(self)
216    }
217    #[doc = "Bit 8 - Parity Error Interrupt Flag"]
218    #[inline(always)]
219    #[must_use]
220    pub fn perr(&mut self) -> PERR_W<8> {
221        PERR_W::new(self)
222    }
223    #[doc = "Bit 9 - Framing Error Interrupt Flag"]
224    #[inline(always)]
225    #[must_use]
226    pub fn ferr(&mut self) -> FERR_W<9> {
227        FERR_W::new(self)
228    }
229    #[doc = "Bit 10 - Multi-Processor Address Frame Interrupt"]
230    #[inline(always)]
231    #[must_use]
232    pub fn mpaf(&mut self) -> MPAF_W<10> {
233        MPAF_W::new(self)
234    }
235    #[doc = "Bit 12 - Collision Check Fail Interrupt Flag"]
236    #[inline(always)]
237    #[must_use]
238    pub fn ccf(&mut self) -> CCF_W<12> {
239        CCF_W::new(self)
240    }
241    #[doc = "Bit 13 - TX Idle Interrupt Flag"]
242    #[inline(always)]
243    #[must_use]
244    pub fn txidle(&mut self) -> TXIDLE_W<13> {
245        TXIDLE_W::new(self)
246    }
247    #[doc = "Bit 18 - Start Frame Interrupt Flag"]
248    #[inline(always)]
249    #[must_use]
250    pub fn startf(&mut self) -> STARTF_W<18> {
251        STARTF_W::new(self)
252    }
253    #[doc = "Bit 19 - Signal Frame Interrupt Flag"]
254    #[inline(always)]
255    #[must_use]
256    pub fn sigf(&mut self) -> SIGF_W<19> {
257        SIGF_W::new(self)
258    }
259    #[doc = "Bit 24 - Auto Baud Complete Interrupt Flag"]
260    #[inline(always)]
261    #[must_use]
262    pub fn autobauddone(&mut self) -> AUTOBAUDDONE_W<24> {
263        AUTOBAUDDONE_W::new(self)
264    }
265    #[doc = "Writes raw bits to the register."]
266    #[inline(always)]
267    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
268        self.0.bits(bits);
269        self
270    }
271}
272#[doc = "No Description\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 [if_](index.html) module"]
273pub struct IF_SPEC;
274impl crate::RegisterSpec for IF_SPEC {
275    type Ux = u32;
276}
277#[doc = "`read()` method returns [if_::R](R) reader structure"]
278impl crate::Readable for IF_SPEC {
279    type Reader = R;
280}
281#[doc = "`write(|w| ..)` method takes [if_::W](W) writer structure"]
282impl crate::Writable for IF_SPEC {
283    type Writer = W;
284    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
285    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
286}
287#[doc = "`reset()` method sets IF to value 0"]
288impl crate::Resettable for IF_SPEC {
289    const RESET_VALUE: Self::Ux = 0;
290}