cc13x2_cc26x2_pac/flash/
efuseprogram.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::EFUSEPROGRAM {
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 RESERVED31R {
47    bits: bool,
48}
49impl RESERVED31R {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct COMPAREDISABLER {
68    bits: bool,
69}
70impl COMPAREDISABLER {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = r" Value of the field"]
88pub struct CLOCKSTALLR {
89    bits: u16,
90}
91impl CLOCKSTALLR {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bits(&self) -> u16 {
95        self.bits
96    }
97}
98#[doc = r" Value of the field"]
99pub struct VPPTOVDDR {
100    bits: bool,
101}
102impl VPPTOVDDR {
103    #[doc = r" Value of the field as raw bits"]
104    #[inline]
105    pub fn bit(&self) -> bool {
106        self.bits
107    }
108    #[doc = r" Returns `true` if the bit is clear (0)"]
109    #[inline]
110    pub fn bit_is_clear(&self) -> bool {
111        !self.bit()
112    }
113    #[doc = r" Returns `true` if the bit is set (1)"]
114    #[inline]
115    pub fn bit_is_set(&self) -> bool {
116        self.bit()
117    }
118}
119#[doc = r" Value of the field"]
120pub struct ITERATIONSR {
121    bits: u8,
122}
123impl ITERATIONSR {
124    #[doc = r" Value of the field as raw bits"]
125    #[inline]
126    pub fn bits(&self) -> u8 {
127        self.bits
128    }
129}
130#[doc = r" Value of the field"]
131pub struct WRITECLOCKR {
132    bits: u16,
133}
134impl WRITECLOCKR {
135    #[doc = r" Value of the field as raw bits"]
136    #[inline]
137    pub fn bits(&self) -> u16 {
138        self.bits
139    }
140}
141#[doc = r" Proxy"]
142pub struct _RESERVED31W<'a> {
143    w: &'a mut W,
144}
145impl<'a> _RESERVED31W<'a> {
146    #[doc = r" Sets the field bit"]
147    pub fn set_bit(self) -> &'a mut W {
148        self.bit(true)
149    }
150    #[doc = r" Clears the field bit"]
151    pub fn clear_bit(self) -> &'a mut W {
152        self.bit(false)
153    }
154    #[doc = r" Writes raw bits to the field"]
155    #[inline]
156    pub fn bit(self, value: bool) -> &'a mut W {
157        const MASK: bool = true;
158        const OFFSET: u8 = 31;
159        self.w.bits &= !((MASK as u32) << OFFSET);
160        self.w.bits |= ((value & MASK) as u32) << OFFSET;
161        self.w
162    }
163}
164#[doc = r" Proxy"]
165pub struct _COMPAREDISABLEW<'a> {
166    w: &'a mut W,
167}
168impl<'a> _COMPAREDISABLEW<'a> {
169    #[doc = r" Sets the field bit"]
170    pub fn set_bit(self) -> &'a mut W {
171        self.bit(true)
172    }
173    #[doc = r" Clears the field bit"]
174    pub fn clear_bit(self) -> &'a mut W {
175        self.bit(false)
176    }
177    #[doc = r" Writes raw bits to the field"]
178    #[inline]
179    pub fn bit(self, value: bool) -> &'a mut W {
180        const MASK: bool = true;
181        const OFFSET: u8 = 30;
182        self.w.bits &= !((MASK as u32) << OFFSET);
183        self.w.bits |= ((value & MASK) as u32) << OFFSET;
184        self.w
185    }
186}
187#[doc = r" Proxy"]
188pub struct _CLOCKSTALLW<'a> {
189    w: &'a mut W,
190}
191impl<'a> _CLOCKSTALLW<'a> {
192    #[doc = r" Writes raw bits to the field"]
193    #[inline]
194    pub unsafe fn bits(self, value: u16) -> &'a mut W {
195        const MASK: u16 = 65535;
196        const OFFSET: u8 = 14;
197        self.w.bits &= !((MASK as u32) << OFFSET);
198        self.w.bits |= ((value & MASK) as u32) << OFFSET;
199        self.w
200    }
201}
202#[doc = r" Proxy"]
203pub struct _VPPTOVDDW<'a> {
204    w: &'a mut W,
205}
206impl<'a> _VPPTOVDDW<'a> {
207    #[doc = r" Sets the field bit"]
208    pub fn set_bit(self) -> &'a mut W {
209        self.bit(true)
210    }
211    #[doc = r" Clears the field bit"]
212    pub fn clear_bit(self) -> &'a mut W {
213        self.bit(false)
214    }
215    #[doc = r" Writes raw bits to the field"]
216    #[inline]
217    pub fn bit(self, value: bool) -> &'a mut W {
218        const MASK: bool = true;
219        const OFFSET: u8 = 13;
220        self.w.bits &= !((MASK as u32) << OFFSET);
221        self.w.bits |= ((value & MASK) as u32) << OFFSET;
222        self.w
223    }
224}
225#[doc = r" Proxy"]
226pub struct _ITERATIONSW<'a> {
227    w: &'a mut W,
228}
229impl<'a> _ITERATIONSW<'a> {
230    #[doc = r" Writes raw bits to the field"]
231    #[inline]
232    pub unsafe fn bits(self, value: u8) -> &'a mut W {
233        const MASK: u8 = 15;
234        const OFFSET: u8 = 9;
235        self.w.bits &= !((MASK as u32) << OFFSET);
236        self.w.bits |= ((value & MASK) as u32) << OFFSET;
237        self.w
238    }
239}
240#[doc = r" Proxy"]
241pub struct _WRITECLOCKW<'a> {
242    w: &'a mut W,
243}
244impl<'a> _WRITECLOCKW<'a> {
245    #[doc = r" Writes raw bits to the field"]
246    #[inline]
247    pub unsafe fn bits(self, value: u16) -> &'a mut W {
248        const MASK: u16 = 511;
249        const OFFSET: u8 = 0;
250        self.w.bits &= !((MASK as u32) << OFFSET);
251        self.w.bits |= ((value & MASK) as u32) << OFFSET;
252        self.w
253    }
254}
255impl R {
256    #[doc = r" Value of the register as raw bits"]
257    #[inline]
258    pub fn bits(&self) -> u32 {
259        self.bits
260    }
261    #[doc = "Bit 31 - 31:31\\] Internal. Only to be used through TI provided API."]
262    #[inline]
263    pub fn reserved31(&self) -> RESERVED31R {
264        let bits = {
265            const MASK: bool = true;
266            const OFFSET: u8 = 31;
267            ((self.bits >> OFFSET) & MASK as u32) != 0
268        };
269        RESERVED31R { bits }
270    }
271    #[doc = "Bit 30 - 30:30\\] Internal. Only to be used through TI provided API."]
272    #[inline]
273    pub fn comparedisable(&self) -> COMPAREDISABLER {
274        let bits = {
275            const MASK: bool = true;
276            const OFFSET: u8 = 30;
277            ((self.bits >> OFFSET) & MASK as u32) != 0
278        };
279        COMPAREDISABLER { bits }
280    }
281    #[doc = "Bits 14:29 - 29:14\\] Internal. Only to be used through TI provided API."]
282    #[inline]
283    pub fn clockstall(&self) -> CLOCKSTALLR {
284        let bits = {
285            const MASK: u16 = 65535;
286            const OFFSET: u8 = 14;
287            ((self.bits >> OFFSET) & MASK as u32) as u16
288        };
289        CLOCKSTALLR { bits }
290    }
291    #[doc = "Bit 13 - 13:13\\] Internal. Only to be used through TI provided API."]
292    #[inline]
293    pub fn vpptovdd(&self) -> VPPTOVDDR {
294        let bits = {
295            const MASK: bool = true;
296            const OFFSET: u8 = 13;
297            ((self.bits >> OFFSET) & MASK as u32) != 0
298        };
299        VPPTOVDDR { bits }
300    }
301    #[doc = "Bits 9:12 - 12:9\\] Internal. Only to be used through TI provided API."]
302    #[inline]
303    pub fn iterations(&self) -> ITERATIONSR {
304        let bits = {
305            const MASK: u8 = 15;
306            const OFFSET: u8 = 9;
307            ((self.bits >> OFFSET) & MASK as u32) as u8
308        };
309        ITERATIONSR { bits }
310    }
311    #[doc = "Bits 0:8 - 8:0\\] Internal. Only to be used through TI provided API."]
312    #[inline]
313    pub fn writeclock(&self) -> WRITECLOCKR {
314        let bits = {
315            const MASK: u16 = 511;
316            const OFFSET: u8 = 0;
317            ((self.bits >> OFFSET) & MASK as u32) as u16
318        };
319        WRITECLOCKR { bits }
320    }
321}
322impl W {
323    #[doc = r" Reset value of the register"]
324    #[inline]
325    pub fn reset_value() -> W {
326        W { bits: 0 }
327    }
328    #[doc = r" Writes raw bits to the register"]
329    #[inline]
330    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
331        self.bits = bits;
332        self
333    }
334    #[doc = "Bit 31 - 31:31\\] Internal. Only to be used through TI provided API."]
335    #[inline]
336    pub fn reserved31(&mut self) -> _RESERVED31W {
337        _RESERVED31W { w: self }
338    }
339    #[doc = "Bit 30 - 30:30\\] Internal. Only to be used through TI provided API."]
340    #[inline]
341    pub fn comparedisable(&mut self) -> _COMPAREDISABLEW {
342        _COMPAREDISABLEW { w: self }
343    }
344    #[doc = "Bits 14:29 - 29:14\\] Internal. Only to be used through TI provided API."]
345    #[inline]
346    pub fn clockstall(&mut self) -> _CLOCKSTALLW {
347        _CLOCKSTALLW { w: self }
348    }
349    #[doc = "Bit 13 - 13:13\\] Internal. Only to be used through TI provided API."]
350    #[inline]
351    pub fn vpptovdd(&mut self) -> _VPPTOVDDW {
352        _VPPTOVDDW { w: self }
353    }
354    #[doc = "Bits 9:12 - 12:9\\] Internal. Only to be used through TI provided API."]
355    #[inline]
356    pub fn iterations(&mut self) -> _ITERATIONSW {
357        _ITERATIONSW { w: self }
358    }
359    #[doc = "Bits 0:8 - 8:0\\] Internal. Only to be used through TI provided API."]
360    #[inline]
361    pub fn writeclock(&mut self) -> _WRITECLOCKW {
362        _WRITECLOCKW { w: self }
363    }
364}