atsam4lc8c/usbc/upcon1clr/
mod.rs

1#[doc = r" Value to write to the register"]
2pub struct W {
3    bits: u32,
4}
5impl super::UPCON1CLR {
6    #[doc = r" Writes to the register"]
7    #[inline]
8    pub fn write<F>(&self, f: F)
9    where
10        F: FnOnce(&mut W) -> &mut W,
11    {
12        let mut w = W::reset_value();
13        f(&mut w);
14        self.register.set(w.bits);
15    }
16}
17#[doc = r" Proxy"]
18pub struct _RXINECW<'a> {
19    w: &'a mut W,
20}
21impl<'a> _RXINECW<'a> {
22    #[doc = r" Sets the field bit"]
23    pub fn set_bit(self) -> &'a mut W {
24        self.bit(true)
25    }
26    #[doc = r" Clears the field bit"]
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]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        const MASK: bool = true;
34        const OFFSET: u8 = 0;
35        self.w.bits &= !((MASK as u32) << OFFSET);
36        self.w.bits |= ((value & MASK) as u32) << OFFSET;
37        self.w
38    }
39}
40#[doc = r" Proxy"]
41pub struct _TXOUTECW<'a> {
42    w: &'a mut W,
43}
44impl<'a> _TXOUTECW<'a> {
45    #[doc = r" Sets the field bit"]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r" Clears the field bit"]
50    pub fn clear_bit(self) -> &'a mut W {
51        self.bit(false)
52    }
53    #[doc = r" Writes raw bits to the field"]
54    #[inline]
55    pub fn bit(self, value: bool) -> &'a mut W {
56        const MASK: bool = true;
57        const OFFSET: u8 = 1;
58        self.w.bits &= !((MASK as u32) << OFFSET);
59        self.w.bits |= ((value & MASK) as u32) << OFFSET;
60        self.w
61    }
62}
63#[doc = r" Proxy"]
64pub struct _TXSTPECW<'a> {
65    w: &'a mut W,
66}
67impl<'a> _TXSTPECW<'a> {
68    #[doc = r" Sets the field bit"]
69    pub fn set_bit(self) -> &'a mut W {
70        self.bit(true)
71    }
72    #[doc = r" Clears the field bit"]
73    pub fn clear_bit(self) -> &'a mut W {
74        self.bit(false)
75    }
76    #[doc = r" Writes raw bits to the field"]
77    #[inline]
78    pub fn bit(self, value: bool) -> &'a mut W {
79        const MASK: bool = true;
80        const OFFSET: u8 = 2;
81        self.w.bits &= !((MASK as u32) << OFFSET);
82        self.w.bits |= ((value & MASK) as u32) << OFFSET;
83        self.w
84    }
85}
86#[doc = r" Proxy"]
87pub struct _PERRECW<'a> {
88    w: &'a mut W,
89}
90impl<'a> _PERRECW<'a> {
91    #[doc = r" Sets the field bit"]
92    pub fn set_bit(self) -> &'a mut W {
93        self.bit(true)
94    }
95    #[doc = r" Clears the field bit"]
96    pub fn clear_bit(self) -> &'a mut W {
97        self.bit(false)
98    }
99    #[doc = r" Writes raw bits to the field"]
100    #[inline]
101    pub fn bit(self, value: bool) -> &'a mut W {
102        const MASK: bool = true;
103        const OFFSET: u8 = 3;
104        self.w.bits &= !((MASK as u32) << OFFSET);
105        self.w.bits |= ((value & MASK) as u32) << OFFSET;
106        self.w
107    }
108}
109#[doc = r" Proxy"]
110pub struct _NAKEDECW<'a> {
111    w: &'a mut W,
112}
113impl<'a> _NAKEDECW<'a> {
114    #[doc = r" Sets the field bit"]
115    pub fn set_bit(self) -> &'a mut W {
116        self.bit(true)
117    }
118    #[doc = r" Clears the field bit"]
119    pub fn clear_bit(self) -> &'a mut W {
120        self.bit(false)
121    }
122    #[doc = r" Writes raw bits to the field"]
123    #[inline]
124    pub fn bit(self, value: bool) -> &'a mut W {
125        const MASK: bool = true;
126        const OFFSET: u8 = 4;
127        self.w.bits &= !((MASK as u32) << OFFSET);
128        self.w.bits |= ((value & MASK) as u32) << OFFSET;
129        self.w
130    }
131}
132#[doc = r" Proxy"]
133pub struct _ERRORFIECW<'a> {
134    w: &'a mut W,
135}
136impl<'a> _ERRORFIECW<'a> {
137    #[doc = r" Sets the field bit"]
138    pub fn set_bit(self) -> &'a mut W {
139        self.bit(true)
140    }
141    #[doc = r" Clears the field bit"]
142    pub fn clear_bit(self) -> &'a mut W {
143        self.bit(false)
144    }
145    #[doc = r" Writes raw bits to the field"]
146    #[inline]
147    pub fn bit(self, value: bool) -> &'a mut W {
148        const MASK: bool = true;
149        const OFFSET: u8 = 5;
150        self.w.bits &= !((MASK as u32) << OFFSET);
151        self.w.bits |= ((value & MASK) as u32) << OFFSET;
152        self.w
153    }
154}
155#[doc = r" Proxy"]
156pub struct _RXSTALLDECW<'a> {
157    w: &'a mut W,
158}
159impl<'a> _RXSTALLDECW<'a> {
160    #[doc = r" Sets the field bit"]
161    pub fn set_bit(self) -> &'a mut W {
162        self.bit(true)
163    }
164    #[doc = r" Clears the field bit"]
165    pub fn clear_bit(self) -> &'a mut W {
166        self.bit(false)
167    }
168    #[doc = r" Writes raw bits to the field"]
169    #[inline]
170    pub fn bit(self, value: bool) -> &'a mut W {
171        const MASK: bool = true;
172        const OFFSET: u8 = 6;
173        self.w.bits &= !((MASK as u32) << OFFSET);
174        self.w.bits |= ((value & MASK) as u32) << OFFSET;
175        self.w
176    }
177}
178#[doc = r" Proxy"]
179pub struct _RAMACERECW<'a> {
180    w: &'a mut W,
181}
182impl<'a> _RAMACERECW<'a> {
183    #[doc = r" Sets the field bit"]
184    pub fn set_bit(self) -> &'a mut W {
185        self.bit(true)
186    }
187    #[doc = r" Clears the field bit"]
188    pub fn clear_bit(self) -> &'a mut W {
189        self.bit(false)
190    }
191    #[doc = r" Writes raw bits to the field"]
192    #[inline]
193    pub fn bit(self, value: bool) -> &'a mut W {
194        const MASK: bool = true;
195        const OFFSET: u8 = 10;
196        self.w.bits &= !((MASK as u32) << OFFSET);
197        self.w.bits |= ((value & MASK) as u32) << OFFSET;
198        self.w
199    }
200}
201#[doc = r" Proxy"]
202pub struct _NBUSYBKECW<'a> {
203    w: &'a mut W,
204}
205impl<'a> _NBUSYBKECW<'a> {
206    #[doc = r" Sets the field bit"]
207    pub fn set_bit(self) -> &'a mut W {
208        self.bit(true)
209    }
210    #[doc = r" Clears the field bit"]
211    pub fn clear_bit(self) -> &'a mut W {
212        self.bit(false)
213    }
214    #[doc = r" Writes raw bits to the field"]
215    #[inline]
216    pub fn bit(self, value: bool) -> &'a mut W {
217        const MASK: bool = true;
218        const OFFSET: u8 = 12;
219        self.w.bits &= !((MASK as u32) << OFFSET);
220        self.w.bits |= ((value & MASK) as u32) << OFFSET;
221        self.w
222    }
223}
224#[doc = r" Proxy"]
225pub struct _FIFOCONCW<'a> {
226    w: &'a mut W,
227}
228impl<'a> _FIFOCONCW<'a> {
229    #[doc = r" Sets the field bit"]
230    pub fn set_bit(self) -> &'a mut W {
231        self.bit(true)
232    }
233    #[doc = r" Clears the field bit"]
234    pub fn clear_bit(self) -> &'a mut W {
235        self.bit(false)
236    }
237    #[doc = r" Writes raw bits to the field"]
238    #[inline]
239    pub fn bit(self, value: bool) -> &'a mut W {
240        const MASK: bool = true;
241        const OFFSET: u8 = 14;
242        self.w.bits &= !((MASK as u32) << OFFSET);
243        self.w.bits |= ((value & MASK) as u32) << OFFSET;
244        self.w
245    }
246}
247#[doc = r" Proxy"]
248pub struct _PFREEZECW<'a> {
249    w: &'a mut W,
250}
251impl<'a> _PFREEZECW<'a> {
252    #[doc = r" Sets the field bit"]
253    pub fn set_bit(self) -> &'a mut W {
254        self.bit(true)
255    }
256    #[doc = r" Clears the field bit"]
257    pub fn clear_bit(self) -> &'a mut W {
258        self.bit(false)
259    }
260    #[doc = r" Writes raw bits to the field"]
261    #[inline]
262    pub fn bit(self, value: bool) -> &'a mut W {
263        const MASK: bool = true;
264        const OFFSET: u8 = 17;
265        self.w.bits &= !((MASK as u32) << OFFSET);
266        self.w.bits |= ((value & MASK) as u32) << OFFSET;
267        self.w
268    }
269}
270#[doc = r" Proxy"]
271pub struct _INITBKCW<'a> {
272    w: &'a mut W,
273}
274impl<'a> _INITBKCW<'a> {
275    #[doc = r" Sets the field bit"]
276    pub fn set_bit(self) -> &'a mut W {
277        self.bit(true)
278    }
279    #[doc = r" Clears the field bit"]
280    pub fn clear_bit(self) -> &'a mut W {
281        self.bit(false)
282    }
283    #[doc = r" Writes raw bits to the field"]
284    #[inline]
285    pub fn bit(self, value: bool) -> &'a mut W {
286        const MASK: bool = true;
287        const OFFSET: u8 = 19;
288        self.w.bits &= !((MASK as u32) << OFFSET);
289        self.w.bits |= ((value & MASK) as u32) << OFFSET;
290        self.w
291    }
292}
293impl W {
294    #[doc = r" Reset value of the register"]
295    #[inline]
296    pub fn reset_value() -> W {
297        W { bits: 0 }
298    }
299    #[doc = r" Writes raw bits to the register"]
300    #[inline]
301    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
302        self.bits = bits;
303        self
304    }
305    #[doc = "Bit 0 - RXINE Clear"]
306    #[inline]
307    pub fn rxinec(&mut self) -> _RXINECW {
308        _RXINECW { w: self }
309    }
310    #[doc = "Bit 1 - TXOUTE Clear"]
311    #[inline]
312    pub fn txoutec(&mut self) -> _TXOUTECW {
313        _TXOUTECW { w: self }
314    }
315    #[doc = "Bit 2 - TXSTPE Clear"]
316    #[inline]
317    pub fn txstpec(&mut self) -> _TXSTPECW {
318        _TXSTPECW { w: self }
319    }
320    #[doc = "Bit 3 - PERRE Clear"]
321    #[inline]
322    pub fn perrec(&mut self) -> _PERRECW {
323        _PERRECW { w: self }
324    }
325    #[doc = "Bit 4 - NAKEDE Clear"]
326    #[inline]
327    pub fn nakedec(&mut self) -> _NAKEDECW {
328        _NAKEDECW { w: self }
329    }
330    #[doc = "Bit 5 - ERRORFIE Clear"]
331    #[inline]
332    pub fn errorfiec(&mut self) -> _ERRORFIECW {
333        _ERRORFIECW { w: self }
334    }
335    #[doc = "Bit 6 - RXTALLDE Clear"]
336    #[inline]
337    pub fn rxstalldec(&mut self) -> _RXSTALLDECW {
338        _RXSTALLDECW { w: self }
339    }
340    #[doc = "Bit 10 - RAMACERE Clear"]
341    #[inline]
342    pub fn ramacerec(&mut self) -> _RAMACERECW {
343        _RAMACERECW { w: self }
344    }
345    #[doc = "Bit 12 - NBUSYBKE Clear"]
346    #[inline]
347    pub fn nbusybkec(&mut self) -> _NBUSYBKECW {
348        _NBUSYBKECW { w: self }
349    }
350    #[doc = "Bit 14 - FIFOCON Clear"]
351    #[inline]
352    pub fn fifoconc(&mut self) -> _FIFOCONCW {
353        _FIFOCONCW { w: self }
354    }
355    #[doc = "Bit 17 - PFREEZE Clear"]
356    #[inline]
357    pub fn pfreezec(&mut self) -> _PFREEZECW {
358        _PFREEZECW { w: self }
359    }
360    #[doc = "Bit 19 - INITBK Clear"]
361    #[inline]
362    pub fn initbkc(&mut self) -> _INITBKCW {
363        _INITBKCW { w: self }
364    }
365}