cc13x2_cc26x2_hal/gpio/
dout27_24.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::DOUT27_24 {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = r" Value of the field"]
46pub struct RESERVED25R {
47    bits: u8,
48}
49impl RESERVED25R {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bits(&self) -> u8 {
53        self.bits
54    }
55}
56#[doc = r" Value of the field"]
57pub struct DIO27R {
58    bits: bool,
59}
60impl DIO27R {
61    #[doc = r" Value of the field as raw bits"]
62    #[inline]
63    pub fn bit(&self) -> bool {
64        self.bits
65    }
66    #[doc = r" Returns `true` if the bit is clear (0)"]
67    #[inline]
68    pub fn bit_is_clear(&self) -> bool {
69        !self.bit()
70    }
71    #[doc = r" Returns `true` if the bit is set (1)"]
72    #[inline]
73    pub fn bit_is_set(&self) -> bool {
74        self.bit()
75    }
76}
77#[doc = r" Value of the field"]
78pub struct RESERVED17R {
79    bits: u8,
80}
81impl RESERVED17R {
82    #[doc = r" Value of the field as raw bits"]
83    #[inline]
84    pub fn bits(&self) -> u8 {
85        self.bits
86    }
87}
88#[doc = r" Value of the field"]
89pub struct DIO26R {
90    bits: bool,
91}
92impl DIO26R {
93    #[doc = r" Value of the field as raw bits"]
94    #[inline]
95    pub fn bit(&self) -> bool {
96        self.bits
97    }
98    #[doc = r" Returns `true` if the bit is clear (0)"]
99    #[inline]
100    pub fn bit_is_clear(&self) -> bool {
101        !self.bit()
102    }
103    #[doc = r" Returns `true` if the bit is set (1)"]
104    #[inline]
105    pub fn bit_is_set(&self) -> bool {
106        self.bit()
107    }
108}
109#[doc = r" Value of the field"]
110pub struct RESERVED9R {
111    bits: u8,
112}
113impl RESERVED9R {
114    #[doc = r" Value of the field as raw bits"]
115    #[inline]
116    pub fn bits(&self) -> u8 {
117        self.bits
118    }
119}
120#[doc = r" Value of the field"]
121pub struct DIO25R {
122    bits: bool,
123}
124impl DIO25R {
125    #[doc = r" Value of the field as raw bits"]
126    #[inline]
127    pub fn bit(&self) -> bool {
128        self.bits
129    }
130    #[doc = r" Returns `true` if the bit is clear (0)"]
131    #[inline]
132    pub fn bit_is_clear(&self) -> bool {
133        !self.bit()
134    }
135    #[doc = r" Returns `true` if the bit is set (1)"]
136    #[inline]
137    pub fn bit_is_set(&self) -> bool {
138        self.bit()
139    }
140}
141#[doc = r" Value of the field"]
142pub struct RESERVED1R {
143    bits: u8,
144}
145impl RESERVED1R {
146    #[doc = r" Value of the field as raw bits"]
147    #[inline]
148    pub fn bits(&self) -> u8 {
149        self.bits
150    }
151}
152#[doc = r" Value of the field"]
153pub struct DIO24R {
154    bits: bool,
155}
156impl DIO24R {
157    #[doc = r" Value of the field as raw bits"]
158    #[inline]
159    pub fn bit(&self) -> bool {
160        self.bits
161    }
162    #[doc = r" Returns `true` if the bit is clear (0)"]
163    #[inline]
164    pub fn bit_is_clear(&self) -> bool {
165        !self.bit()
166    }
167    #[doc = r" Returns `true` if the bit is set (1)"]
168    #[inline]
169    pub fn bit_is_set(&self) -> bool {
170        self.bit()
171    }
172}
173#[doc = r" Proxy"]
174pub struct _RESERVED25W<'a> {
175    w: &'a mut W,
176}
177impl<'a> _RESERVED25W<'a> {
178    #[doc = r" Writes raw bits to the field"]
179    #[inline]
180    pub unsafe fn bits(self, value: u8) -> &'a mut W {
181        const MASK: u8 = 127;
182        const OFFSET: u8 = 25;
183        self.w.bits &= !((MASK as u32) << OFFSET);
184        self.w.bits |= ((value & MASK) as u32) << OFFSET;
185        self.w
186    }
187}
188#[doc = r" Proxy"]
189pub struct _DIO27W<'a> {
190    w: &'a mut W,
191}
192impl<'a> _DIO27W<'a> {
193    #[doc = r" Sets the field bit"]
194    pub fn set_bit(self) -> &'a mut W {
195        self.bit(true)
196    }
197    #[doc = r" Clears the field bit"]
198    pub fn clear_bit(self) -> &'a mut W {
199        self.bit(false)
200    }
201    #[doc = r" Writes raw bits to the field"]
202    #[inline]
203    pub fn bit(self, value: bool) -> &'a mut W {
204        const MASK: bool = true;
205        const OFFSET: u8 = 24;
206        self.w.bits &= !((MASK as u32) << OFFSET);
207        self.w.bits |= ((value & MASK) as u32) << OFFSET;
208        self.w
209    }
210}
211#[doc = r" Proxy"]
212pub struct _RESERVED17W<'a> {
213    w: &'a mut W,
214}
215impl<'a> _RESERVED17W<'a> {
216    #[doc = r" Writes raw bits to the field"]
217    #[inline]
218    pub unsafe fn bits(self, value: u8) -> &'a mut W {
219        const MASK: u8 = 127;
220        const OFFSET: u8 = 17;
221        self.w.bits &= !((MASK as u32) << OFFSET);
222        self.w.bits |= ((value & MASK) as u32) << OFFSET;
223        self.w
224    }
225}
226#[doc = r" Proxy"]
227pub struct _DIO26W<'a> {
228    w: &'a mut W,
229}
230impl<'a> _DIO26W<'a> {
231    #[doc = r" Sets the field bit"]
232    pub fn set_bit(self) -> &'a mut W {
233        self.bit(true)
234    }
235    #[doc = r" Clears the field bit"]
236    pub fn clear_bit(self) -> &'a mut W {
237        self.bit(false)
238    }
239    #[doc = r" Writes raw bits to the field"]
240    #[inline]
241    pub fn bit(self, value: bool) -> &'a mut W {
242        const MASK: bool = true;
243        const OFFSET: u8 = 16;
244        self.w.bits &= !((MASK as u32) << OFFSET);
245        self.w.bits |= ((value & MASK) as u32) << OFFSET;
246        self.w
247    }
248}
249#[doc = r" Proxy"]
250pub struct _RESERVED9W<'a> {
251    w: &'a mut W,
252}
253impl<'a> _RESERVED9W<'a> {
254    #[doc = r" Writes raw bits to the field"]
255    #[inline]
256    pub unsafe fn bits(self, value: u8) -> &'a mut W {
257        const MASK: u8 = 127;
258        const OFFSET: u8 = 9;
259        self.w.bits &= !((MASK as u32) << OFFSET);
260        self.w.bits |= ((value & MASK) as u32) << OFFSET;
261        self.w
262    }
263}
264#[doc = r" Proxy"]
265pub struct _DIO25W<'a> {
266    w: &'a mut W,
267}
268impl<'a> _DIO25W<'a> {
269    #[doc = r" Sets the field bit"]
270    pub fn set_bit(self) -> &'a mut W {
271        self.bit(true)
272    }
273    #[doc = r" Clears the field bit"]
274    pub fn clear_bit(self) -> &'a mut W {
275        self.bit(false)
276    }
277    #[doc = r" Writes raw bits to the field"]
278    #[inline]
279    pub fn bit(self, value: bool) -> &'a mut W {
280        const MASK: bool = true;
281        const OFFSET: u8 = 8;
282        self.w.bits &= !((MASK as u32) << OFFSET);
283        self.w.bits |= ((value & MASK) as u32) << OFFSET;
284        self.w
285    }
286}
287#[doc = r" Proxy"]
288pub struct _RESERVED1W<'a> {
289    w: &'a mut W,
290}
291impl<'a> _RESERVED1W<'a> {
292    #[doc = r" Writes raw bits to the field"]
293    #[inline]
294    pub unsafe fn bits(self, value: u8) -> &'a mut W {
295        const MASK: u8 = 127;
296        const OFFSET: u8 = 1;
297        self.w.bits &= !((MASK as u32) << OFFSET);
298        self.w.bits |= ((value & MASK) as u32) << OFFSET;
299        self.w
300    }
301}
302#[doc = r" Proxy"]
303pub struct _DIO24W<'a> {
304    w: &'a mut W,
305}
306impl<'a> _DIO24W<'a> {
307    #[doc = r" Sets the field bit"]
308    pub fn set_bit(self) -> &'a mut W {
309        self.bit(true)
310    }
311    #[doc = r" Clears the field bit"]
312    pub fn clear_bit(self) -> &'a mut W {
313        self.bit(false)
314    }
315    #[doc = r" Writes raw bits to the field"]
316    #[inline]
317    pub fn bit(self, value: bool) -> &'a mut W {
318        const MASK: bool = true;
319        const OFFSET: u8 = 0;
320        self.w.bits &= !((MASK as u32) << OFFSET);
321        self.w.bits |= ((value & MASK) as u32) << OFFSET;
322        self.w
323    }
324}
325impl R {
326    #[doc = r" Value of the register as raw bits"]
327    #[inline]
328    pub fn bits(&self) -> u32 {
329        self.bits
330    }
331    #[doc = "Bits 25:31 - 31:25\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
332    #[inline]
333    pub fn reserved25(&self) -> RESERVED25R {
334        let bits = {
335            const MASK: u8 = 127;
336            const OFFSET: u8 = 25;
337            ((self.bits >> OFFSET) & MASK as u32) as u8
338        };
339        RESERVED25R { bits }
340    }
341    #[doc = "Bit 24 - 24:24\\] Sets the state of the pin that is configured as DIO#27, if the corresponding DOE31_0 bitfield is set."]
342    #[inline]
343    pub fn dio27(&self) -> DIO27R {
344        let bits = {
345            const MASK: bool = true;
346            const OFFSET: u8 = 24;
347            ((self.bits >> OFFSET) & MASK as u32) != 0
348        };
349        DIO27R { bits }
350    }
351    #[doc = "Bits 17:23 - 23:17\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
352    #[inline]
353    pub fn reserved17(&self) -> RESERVED17R {
354        let bits = {
355            const MASK: u8 = 127;
356            const OFFSET: u8 = 17;
357            ((self.bits >> OFFSET) & MASK as u32) as u8
358        };
359        RESERVED17R { bits }
360    }
361    #[doc = "Bit 16 - 16:16\\] Sets the state of the pin that is configured as DIO#26, if the corresponding DOE31_0 bitfield is set."]
362    #[inline]
363    pub fn dio26(&self) -> DIO26R {
364        let bits = {
365            const MASK: bool = true;
366            const OFFSET: u8 = 16;
367            ((self.bits >> OFFSET) & MASK as u32) != 0
368        };
369        DIO26R { bits }
370    }
371    #[doc = "Bits 9:15 - 15:9\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
372    #[inline]
373    pub fn reserved9(&self) -> RESERVED9R {
374        let bits = {
375            const MASK: u8 = 127;
376            const OFFSET: u8 = 9;
377            ((self.bits >> OFFSET) & MASK as u32) as u8
378        };
379        RESERVED9R { bits }
380    }
381    #[doc = "Bit 8 - 8:8\\] Sets the state of the pin that is configured as DIO#25, if the corresponding DOE31_0 bitfield is set."]
382    #[inline]
383    pub fn dio25(&self) -> DIO25R {
384        let bits = {
385            const MASK: bool = true;
386            const OFFSET: u8 = 8;
387            ((self.bits >> OFFSET) & MASK as u32) != 0
388        };
389        DIO25R { bits }
390    }
391    #[doc = "Bits 1:7 - 7:1\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
392    #[inline]
393    pub fn reserved1(&self) -> RESERVED1R {
394        let bits = {
395            const MASK: u8 = 127;
396            const OFFSET: u8 = 1;
397            ((self.bits >> OFFSET) & MASK as u32) as u8
398        };
399        RESERVED1R { bits }
400    }
401    #[doc = "Bit 0 - 0:0\\] Sets the state of the pin that is configured as DIO#24, if the corresponding DOE31_0 bitfield is set."]
402    #[inline]
403    pub fn dio24(&self) -> DIO24R {
404        let bits = {
405            const MASK: bool = true;
406            const OFFSET: u8 = 0;
407            ((self.bits >> OFFSET) & MASK as u32) != 0
408        };
409        DIO24R { bits }
410    }
411}
412impl W {
413    #[doc = r" Reset value of the register"]
414    #[inline]
415    pub fn reset_value() -> W {
416        W { bits: 0 }
417    }
418    #[doc = r" Writes raw bits to the register"]
419    #[inline]
420    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
421        self.bits = bits;
422        self
423    }
424    #[doc = "Bits 25:31 - 31:25\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
425    #[inline]
426    pub fn reserved25(&mut self) -> _RESERVED25W {
427        _RESERVED25W { w: self }
428    }
429    #[doc = "Bit 24 - 24:24\\] Sets the state of the pin that is configured as DIO#27, if the corresponding DOE31_0 bitfield is set."]
430    #[inline]
431    pub fn dio27(&mut self) -> _DIO27W {
432        _DIO27W { w: self }
433    }
434    #[doc = "Bits 17:23 - 23:17\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
435    #[inline]
436    pub fn reserved17(&mut self) -> _RESERVED17W {
437        _RESERVED17W { w: self }
438    }
439    #[doc = "Bit 16 - 16:16\\] Sets the state of the pin that is configured as DIO#26, if the corresponding DOE31_0 bitfield is set."]
440    #[inline]
441    pub fn dio26(&mut self) -> _DIO26W {
442        _DIO26W { w: self }
443    }
444    #[doc = "Bits 9:15 - 15:9\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
445    #[inline]
446    pub fn reserved9(&mut self) -> _RESERVED9W {
447        _RESERVED9W { w: self }
448    }
449    #[doc = "Bit 8 - 8:8\\] Sets the state of the pin that is configured as DIO#25, if the corresponding DOE31_0 bitfield is set."]
450    #[inline]
451    pub fn dio25(&mut self) -> _DIO25W {
452        _DIO25W { w: self }
453    }
454    #[doc = "Bits 1:7 - 7:1\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
455    #[inline]
456    pub fn reserved1(&mut self) -> _RESERVED1W {
457        _RESERVED1W { w: self }
458    }
459    #[doc = "Bit 0 - 0:0\\] Sets the state of the pin that is configured as DIO#24, if the corresponding DOE31_0 bitfield is set."]
460    #[inline]
461    pub fn dio24(&mut self) -> _DIO24W {
462        _DIO24W { w: self }
463    }
464}