atsamd21j18a/i2s/
intflag.rs

1#[doc = "Reader of register INTFLAG"]
2pub type R = crate::R<u16, super::INTFLAG>;
3#[doc = "Writer for register INTFLAG"]
4pub type W = crate::W<u16, super::INTFLAG>;
5#[doc = "Register INTFLAG `reset()`'s with value 0"]
6impl crate::ResetValue for super::INTFLAG {
7    type Type = u16;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `RXRDY0`"]
14pub type RXRDY0_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `RXRDY0`"]
16pub struct RXRDY0_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RXRDY0_W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !0x01) | ((value as u16) & 0x01);
34        self.w
35    }
36}
37#[doc = "Reader of field `RXRDY1`"]
38pub type RXRDY1_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `RXRDY1`"]
40pub struct RXRDY1_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> RXRDY1_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u16) & 0x01) << 1);
58        self.w
59    }
60}
61#[doc = "Reader of field `RXOR0`"]
62pub type RXOR0_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `RXOR0`"]
64pub struct RXOR0_W<'a> {
65    w: &'a mut W,
66}
67impl<'a> RXOR0_W<'a> {
68    #[doc = r"Sets the field bit"]
69    #[inline(always)]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r"Clears the field bit"]
74    #[inline(always)]
75    pub fn clear_bit(self) -> &'a mut W {
76        self.bit(false)
77    }
78    #[doc = r"Writes raw bits to the field"]
79    #[inline(always)]
80    pub fn bit(self, value: bool) -> &'a mut W {
81        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u16) & 0x01) << 4);
82        self.w
83    }
84}
85#[doc = "Reader of field `RXOR1`"]
86pub type RXOR1_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `RXOR1`"]
88pub struct RXOR1_W<'a> {
89    w: &'a mut W,
90}
91impl<'a> RXOR1_W<'a> {
92    #[doc = r"Sets the field bit"]
93    #[inline(always)]
94    pub fn set_bit(self) -> &'a mut W {
95        self.bit(true)
96    }
97    #[doc = r"Clears the field bit"]
98    #[inline(always)]
99    pub fn clear_bit(self) -> &'a mut W {
100        self.bit(false)
101    }
102    #[doc = r"Writes raw bits to the field"]
103    #[inline(always)]
104    pub fn bit(self, value: bool) -> &'a mut W {
105        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u16) & 0x01) << 5);
106        self.w
107    }
108}
109#[doc = "Reader of field `TXRDY0`"]
110pub type TXRDY0_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `TXRDY0`"]
112pub struct TXRDY0_W<'a> {
113    w: &'a mut W,
114}
115impl<'a> TXRDY0_W<'a> {
116    #[doc = r"Sets the field bit"]
117    #[inline(always)]
118    pub fn set_bit(self) -> &'a mut W {
119        self.bit(true)
120    }
121    #[doc = r"Clears the field bit"]
122    #[inline(always)]
123    pub fn clear_bit(self) -> &'a mut W {
124        self.bit(false)
125    }
126    #[doc = r"Writes raw bits to the field"]
127    #[inline(always)]
128    pub fn bit(self, value: bool) -> &'a mut W {
129        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u16) & 0x01) << 8);
130        self.w
131    }
132}
133#[doc = "Reader of field `TXRDY1`"]
134pub type TXRDY1_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `TXRDY1`"]
136pub struct TXRDY1_W<'a> {
137    w: &'a mut W,
138}
139impl<'a> TXRDY1_W<'a> {
140    #[doc = r"Sets the field bit"]
141    #[inline(always)]
142    pub fn set_bit(self) -> &'a mut W {
143        self.bit(true)
144    }
145    #[doc = r"Clears the field bit"]
146    #[inline(always)]
147    pub fn clear_bit(self) -> &'a mut W {
148        self.bit(false)
149    }
150    #[doc = r"Writes raw bits to the field"]
151    #[inline(always)]
152    pub fn bit(self, value: bool) -> &'a mut W {
153        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u16) & 0x01) << 9);
154        self.w
155    }
156}
157#[doc = "Reader of field `TXUR0`"]
158pub type TXUR0_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `TXUR0`"]
160pub struct TXUR0_W<'a> {
161    w: &'a mut W,
162}
163impl<'a> TXUR0_W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u16) & 0x01) << 12);
178        self.w
179    }
180}
181#[doc = "Reader of field `TXUR1`"]
182pub type TXUR1_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `TXUR1`"]
184pub struct TXUR1_W<'a> {
185    w: &'a mut W,
186}
187impl<'a> TXUR1_W<'a> {
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u16) & 0x01) << 13);
202        self.w
203    }
204}
205impl R {
206    #[doc = "Bit 0 - Receive Ready 0"]
207    #[inline(always)]
208    pub fn rxrdy0(&self) -> RXRDY0_R {
209        RXRDY0_R::new((self.bits & 0x01) != 0)
210    }
211    #[doc = "Bit 1 - Receive Ready 1"]
212    #[inline(always)]
213    pub fn rxrdy1(&self) -> RXRDY1_R {
214        RXRDY1_R::new(((self.bits >> 1) & 0x01) != 0)
215    }
216    #[doc = "Bit 4 - Receive Overrun 0"]
217    #[inline(always)]
218    pub fn rxor0(&self) -> RXOR0_R {
219        RXOR0_R::new(((self.bits >> 4) & 0x01) != 0)
220    }
221    #[doc = "Bit 5 - Receive Overrun 1"]
222    #[inline(always)]
223    pub fn rxor1(&self) -> RXOR1_R {
224        RXOR1_R::new(((self.bits >> 5) & 0x01) != 0)
225    }
226    #[doc = "Bit 8 - Transmit Ready 0"]
227    #[inline(always)]
228    pub fn txrdy0(&self) -> TXRDY0_R {
229        TXRDY0_R::new(((self.bits >> 8) & 0x01) != 0)
230    }
231    #[doc = "Bit 9 - Transmit Ready 1"]
232    #[inline(always)]
233    pub fn txrdy1(&self) -> TXRDY1_R {
234        TXRDY1_R::new(((self.bits >> 9) & 0x01) != 0)
235    }
236    #[doc = "Bit 12 - Transmit Underrun 0"]
237    #[inline(always)]
238    pub fn txur0(&self) -> TXUR0_R {
239        TXUR0_R::new(((self.bits >> 12) & 0x01) != 0)
240    }
241    #[doc = "Bit 13 - Transmit Underrun 1"]
242    #[inline(always)]
243    pub fn txur1(&self) -> TXUR1_R {
244        TXUR1_R::new(((self.bits >> 13) & 0x01) != 0)
245    }
246}
247impl W {
248    #[doc = "Bit 0 - Receive Ready 0"]
249    #[inline(always)]
250    pub fn rxrdy0(&mut self) -> RXRDY0_W {
251        RXRDY0_W { w: self }
252    }
253    #[doc = "Bit 1 - Receive Ready 1"]
254    #[inline(always)]
255    pub fn rxrdy1(&mut self) -> RXRDY1_W {
256        RXRDY1_W { w: self }
257    }
258    #[doc = "Bit 4 - Receive Overrun 0"]
259    #[inline(always)]
260    pub fn rxor0(&mut self) -> RXOR0_W {
261        RXOR0_W { w: self }
262    }
263    #[doc = "Bit 5 - Receive Overrun 1"]
264    #[inline(always)]
265    pub fn rxor1(&mut self) -> RXOR1_W {
266        RXOR1_W { w: self }
267    }
268    #[doc = "Bit 8 - Transmit Ready 0"]
269    #[inline(always)]
270    pub fn txrdy0(&mut self) -> TXRDY0_W {
271        TXRDY0_W { w: self }
272    }
273    #[doc = "Bit 9 - Transmit Ready 1"]
274    #[inline(always)]
275    pub fn txrdy1(&mut self) -> TXRDY1_W {
276        TXRDY1_W { w: self }
277    }
278    #[doc = "Bit 12 - Transmit Underrun 0"]
279    #[inline(always)]
280    pub fn txur0(&mut self) -> TXUR0_W {
281        TXUR0_W { w: self }
282    }
283    #[doc = "Bit 13 - Transmit Underrun 1"]
284    #[inline(always)]
285    pub fn txur1(&mut self) -> TXUR1_W {
286        TXUR1_W { w: self }
287    }
288}