cc2650/flash/
fsm_cmp_vsu.rs1#[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::FSM_CMP_VSU {
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 RESERVED16R {
45 bits: u16,
46}
47impl RESERVED16R {
48 #[doc = r" Value of the field as raw bits"]
49 #[inline]
50 pub fn bits(&self) -> u16 {
51 self.bits
52 }
53}
54#[doc = r" Value of the field"]
55pub struct ADD_EXZR {
56 bits: u8,
57}
58impl ADD_EXZR {
59 #[doc = r" Value of the field as raw bits"]
60 #[inline]
61 pub fn bits(&self) -> u8 {
62 self.bits
63 }
64}
65#[doc = r" Value of the field"]
66pub struct RESERVED0R {
67 bits: u16,
68}
69impl RESERVED0R {
70 #[doc = r" Value of the field as raw bits"]
71 #[inline]
72 pub fn bits(&self) -> u16 {
73 self.bits
74 }
75}
76#[doc = r" Proxy"]
77pub struct _ADD_EXZW<'a> {
78 w: &'a mut W,
79}
80impl<'a> _ADD_EXZW<'a> {
81 #[doc = r" Writes raw bits to the field"]
82 #[inline]
83 pub unsafe fn bits(self, value: u8) -> &'a mut W {
84 const MASK: u8 = 15;
85 const OFFSET: u8 = 12;
86 self.w.bits &= !((MASK as u32) << OFFSET);
87 self.w.bits |= ((value & MASK) as u32) << OFFSET;
88 self.w
89 }
90}
91impl R {
92 #[doc = r" Value of the register as raw bits"]
93 #[inline]
94 pub fn bits(&self) -> u32 {
95 self.bits
96 }
97 #[doc = "Bits 16:31 - Internal. Only to be used through TI provided API."]
98 #[inline]
99 pub fn reserved16(&self) -> RESERVED16R {
100 let bits = {
101 const MASK: u16 = 65535;
102 const OFFSET: u8 = 16;
103 ((self.bits >> OFFSET) & MASK as u32) as u16
104 };
105 RESERVED16R { bits }
106 }
107 #[doc = "Bits 12:15 - Internal. Only to be used through TI provided API."]
108 #[inline]
109 pub fn add_exz(&self) -> ADD_EXZR {
110 let bits = {
111 const MASK: u8 = 15;
112 const OFFSET: u8 = 12;
113 ((self.bits >> OFFSET) & MASK as u32) as u8
114 };
115 ADD_EXZR { bits }
116 }
117 #[doc = "Bits 0:11 - Internal. Only to be used through TI provided API."]
118 #[inline]
119 pub fn reserved0(&self) -> RESERVED0R {
120 let bits = {
121 const MASK: u16 = 4095;
122 const OFFSET: u8 = 0;
123 ((self.bits >> OFFSET) & MASK as u32) as u16
124 };
125 RESERVED0R { bits }
126 }
127}
128impl W {
129 #[doc = r" Reset value of the register"]
130 #[inline]
131 pub fn reset_value() -> W {
132 W { bits: 0 }
133 }
134 #[doc = r" Writes raw bits to the register"]
135 #[inline]
136 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
137 self.bits = bits;
138 self
139 }
140 #[doc = "Bits 12:15 - Internal. Only to be used through TI provided API."]
141 #[inline]
142 pub fn add_exz(&mut self) -> _ADD_EXZW {
143 _ADD_EXZW { w: self }
144 }
145}