cc2650/aux_wuc/
pwroffreq.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::PWROFFREQ {
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 { bits: self.register.get() }
26    }
27    #[doc = r" Writes to the register"]
28    #[inline]
29    pub fn write<F>(&self, f: F)
30    where
31        F: FnOnce(&mut W) -> &mut W,
32    {
33        let mut w = W::reset_value();
34        f(&mut w);
35        self.register.set(w.bits);
36    }
37    #[doc = r" Writes the reset value to the register"]
38    #[inline]
39    pub fn reset(&self) {
40        self.write(|w| w)
41    }
42}
43#[doc = r" Value of the field"]
44pub struct REQR {
45    bits: bool,
46}
47impl REQR {
48    #[doc = r" Value of the field as raw bits"]
49    #[inline]
50    pub fn bit(&self) -> bool {
51        self.bits
52    }
53    #[doc = r" Returns `true` if the bit is clear (0)"]
54    #[inline]
55    pub fn bit_is_clear(&self) -> bool {
56        !self.bit()
57    }
58    #[doc = r" Returns `true` if the bit is set (1)"]
59    #[inline]
60    pub fn bit_is_set(&self) -> bool {
61        self.bit()
62    }
63}
64#[doc = r" Proxy"]
65pub struct _REQW<'a> {
66    w: &'a mut W,
67}
68impl<'a> _REQW<'a> {
69    #[doc = r" Sets the field bit"]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r" Clears the field bit"]
74    pub fn clear_bit(self) -> &'a mut W {
75        self.bit(false)
76    }
77    #[doc = r" Writes raw bits to the field"]
78    #[inline]
79    pub fn bit(self, value: bool) -> &'a mut W {
80        const MASK: bool = true;
81        const OFFSET: u8 = 0;
82        self.w.bits &= !((MASK as u32) << OFFSET);
83        self.w.bits |= ((value & MASK) as u32) << OFFSET;
84        self.w
85    }
86}
87impl R {
88    #[doc = r" Value of the register as raw bits"]
89    #[inline]
90    pub fn bits(&self) -> u32 {
91        self.bits
92    }
93    #[doc = "Bit 0 - Power off request 0: No action 1: Request to power down AUX. Once set, this bit shall not be cleared. The bit will be reset again when AUX is powered up again. The request will only happen if AONCTLSTAT.AUX_FORCE_ON = 0 and MCUBUSSTAT.DISCONNECTED=1."]
94    #[inline]
95    pub fn req(&self) -> REQR {
96        let bits = {
97            const MASK: bool = true;
98            const OFFSET: u8 = 0;
99            ((self.bits >> OFFSET) & MASK as u32) != 0
100        };
101        REQR { bits }
102    }
103}
104impl W {
105    #[doc = r" Reset value of the register"]
106    #[inline]
107    pub fn reset_value() -> W {
108        W { bits: 0 }
109    }
110    #[doc = r" Writes raw bits to the register"]
111    #[inline]
112    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
113        self.bits = bits;
114        self
115    }
116    #[doc = "Bit 0 - Power off request 0: No action 1: Request to power down AUX. Once set, this bit shall not be cleared. The bit will be reset again when AUX is powered up again. The request will only happen if AONCTLSTAT.AUX_FORCE_ON = 0 and MCUBUSSTAT.DISCONNECTED=1."]
117    #[inline]
118    pub fn req(&mut self) -> _REQW {
119        _REQW { w: self }
120    }
121}