cc13x2_cc26x2_pac/flash/
fvslp.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::FVSLP {
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 RESERVED16R {
47    bits: u16,
48}
49impl RESERVED16R {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bits(&self) -> u16 {
53        self.bits
54    }
55}
56#[doc = r" Value of the field"]
57pub struct VSL_PR {
58    bits: u8,
59}
60impl VSL_PR {
61    #[doc = r" Value of the field as raw bits"]
62    #[inline]
63    pub fn bits(&self) -> u8 {
64        self.bits
65    }
66}
67#[doc = r" Value of the field"]
68pub struct RESERVED0R {
69    bits: u16,
70}
71impl RESERVED0R {
72    #[doc = r" Value of the field as raw bits"]
73    #[inline]
74    pub fn bits(&self) -> u16 {
75        self.bits
76    }
77}
78#[doc = r" Proxy"]
79pub struct _RESERVED16W<'a> {
80    w: &'a mut W,
81}
82impl<'a> _RESERVED16W<'a> {
83    #[doc = r" Writes raw bits to the field"]
84    #[inline]
85    pub unsafe fn bits(self, value: u16) -> &'a mut W {
86        const MASK: u16 = 65535;
87        const OFFSET: u8 = 16;
88        self.w.bits &= !((MASK as u32) << OFFSET);
89        self.w.bits |= ((value & MASK) as u32) << OFFSET;
90        self.w
91    }
92}
93#[doc = r" Proxy"]
94pub struct _VSL_PW<'a> {
95    w: &'a mut W,
96}
97impl<'a> _VSL_PW<'a> {
98    #[doc = r" Writes raw bits to the field"]
99    #[inline]
100    pub unsafe fn bits(self, value: u8) -> &'a mut W {
101        const MASK: u8 = 15;
102        const OFFSET: u8 = 12;
103        self.w.bits &= !((MASK as u32) << OFFSET);
104        self.w.bits |= ((value & MASK) as u32) << OFFSET;
105        self.w
106    }
107}
108#[doc = r" Proxy"]
109pub struct _RESERVED0W<'a> {
110    w: &'a mut W,
111}
112impl<'a> _RESERVED0W<'a> {
113    #[doc = r" Writes raw bits to the field"]
114    #[inline]
115    pub unsafe fn bits(self, value: u16) -> &'a mut W {
116        const MASK: u16 = 4095;
117        const OFFSET: u8 = 0;
118        self.w.bits &= !((MASK as u32) << OFFSET);
119        self.w.bits |= ((value & MASK) as u32) << OFFSET;
120        self.w
121    }
122}
123impl R {
124    #[doc = r" Value of the register as raw bits"]
125    #[inline]
126    pub fn bits(&self) -> u32 {
127        self.bits
128    }
129    #[doc = "Bits 16:31 - 31:16\\] Internal. Only to be used through TI provided API."]
130    #[inline]
131    pub fn reserved16(&self) -> RESERVED16R {
132        let bits = {
133            const MASK: u16 = 65535;
134            const OFFSET: u8 = 16;
135            ((self.bits >> OFFSET) & MASK as u32) as u16
136        };
137        RESERVED16R { bits }
138    }
139    #[doc = "Bits 12:15 - 15:12\\] Internal. Only to be used through TI provided API."]
140    #[inline]
141    pub fn vsl_p(&self) -> VSL_PR {
142        let bits = {
143            const MASK: u8 = 15;
144            const OFFSET: u8 = 12;
145            ((self.bits >> OFFSET) & MASK as u32) as u8
146        };
147        VSL_PR { bits }
148    }
149    #[doc = "Bits 0:11 - 11:0\\] Internal. Only to be used through TI provided API."]
150    #[inline]
151    pub fn reserved0(&self) -> RESERVED0R {
152        let bits = {
153            const MASK: u16 = 4095;
154            const OFFSET: u8 = 0;
155            ((self.bits >> OFFSET) & MASK as u32) as u16
156        };
157        RESERVED0R { bits }
158    }
159}
160impl W {
161    #[doc = r" Reset value of the register"]
162    #[inline]
163    pub fn reset_value() -> W {
164        W { bits: 32768 }
165    }
166    #[doc = r" Writes raw bits to the register"]
167    #[inline]
168    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
169        self.bits = bits;
170        self
171    }
172    #[doc = "Bits 16:31 - 31:16\\] Internal. Only to be used through TI provided API."]
173    #[inline]
174    pub fn reserved16(&mut self) -> _RESERVED16W {
175        _RESERVED16W { w: self }
176    }
177    #[doc = "Bits 12:15 - 15:12\\] Internal. Only to be used through TI provided API."]
178    #[inline]
179    pub fn vsl_p(&mut self) -> _VSL_PW {
180        _VSL_PW { w: self }
181    }
182    #[doc = "Bits 0:11 - 11:0\\] Internal. Only to be used through TI provided API."]
183    #[inline]
184    pub fn reserved0(&mut self) -> _RESERVED0W {
185        _RESERVED0W { w: self }
186    }
187}