lpc11uxx/flashctrl/
fmsstop.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::FMSSTOP {
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 STOPR {
47 bits: u32,
48}
49impl STOPR {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bits(&self) -> u32 {
53 self.bits
54 }
55}
56#[doc = "Possible values of the field `SIG_START`"]
57#[derive(Clone, Copy, Debug, PartialEq)]
58pub enum SIG_STARTR {
59 #[doc = "Signature generation is stopped"]
60 SIGNATURE_GENERATION,
61 #[doc = "Initiate signature generation"]
62 INITIATE_SIGNATURE_G,
63}
64impl SIG_STARTR {
65 #[doc = r" Returns `true` if the bit is clear (0)"]
66 #[inline]
67 pub fn bit_is_clear(&self) -> bool {
68 !self.bit()
69 }
70 #[doc = r" Returns `true` if the bit is set (1)"]
71 #[inline]
72 pub fn bit_is_set(&self) -> bool {
73 self.bit()
74 }
75 #[doc = r" Value of the field as raw bits"]
76 #[inline]
77 pub fn bit(&self) -> bool {
78 match *self {
79 SIG_STARTR::SIGNATURE_GENERATION => false,
80 SIG_STARTR::INITIATE_SIGNATURE_G => true,
81 }
82 }
83 #[allow(missing_docs)]
84 #[doc(hidden)]
85 #[inline]
86 pub fn _from(value: bool) -> SIG_STARTR {
87 match value {
88 false => SIG_STARTR::SIGNATURE_GENERATION,
89 true => SIG_STARTR::INITIATE_SIGNATURE_G,
90 }
91 }
92 #[doc = "Checks if the value of the field is `SIGNATURE_GENERATION`"]
93 #[inline]
94 pub fn is_signature_generation(&self) -> bool {
95 *self == SIG_STARTR::SIGNATURE_GENERATION
96 }
97 #[doc = "Checks if the value of the field is `INITIATE_SIGNATURE_G`"]
98 #[inline]
99 pub fn is_initiate_signature_g(&self) -> bool {
100 *self == SIG_STARTR::INITIATE_SIGNATURE_G
101 }
102}
103#[doc = r" Proxy"]
104pub struct _STOPW<'a> {
105 w: &'a mut W,
106}
107impl<'a> _STOPW<'a> {
108 #[doc = r" Writes raw bits to the field"]
109 #[inline]
110 pub unsafe fn bits(self, value: u32) -> &'a mut W {
111 const MASK: u32 = 131071;
112 const OFFSET: u8 = 0;
113 self.w.bits &= !((MASK as u32) << OFFSET);
114 self.w.bits |= ((value & MASK) as u32) << OFFSET;
115 self.w
116 }
117}
118#[doc = "Values that can be written to the field `SIG_START`"]
119pub enum SIG_STARTW {
120 #[doc = "Signature generation is stopped"]
121 SIGNATURE_GENERATION,
122 #[doc = "Initiate signature generation"]
123 INITIATE_SIGNATURE_G,
124}
125impl SIG_STARTW {
126 #[allow(missing_docs)]
127 #[doc(hidden)]
128 #[inline]
129 pub fn _bits(&self) -> bool {
130 match *self {
131 SIG_STARTW::SIGNATURE_GENERATION => false,
132 SIG_STARTW::INITIATE_SIGNATURE_G => true,
133 }
134 }
135}
136#[doc = r" Proxy"]
137pub struct _SIG_STARTW<'a> {
138 w: &'a mut W,
139}
140impl<'a> _SIG_STARTW<'a> {
141 #[doc = r" Writes `variant` to the field"]
142 #[inline]
143 pub fn variant(self, variant: SIG_STARTW) -> &'a mut W {
144 {
145 self.bit(variant._bits())
146 }
147 }
148 #[doc = "Signature generation is stopped"]
149 #[inline]
150 pub fn signature_generation(self) -> &'a mut W {
151 self.variant(SIG_STARTW::SIGNATURE_GENERATION)
152 }
153 #[doc = "Initiate signature generation"]
154 #[inline]
155 pub fn initiate_signature_g(self) -> &'a mut W {
156 self.variant(SIG_STARTW::INITIATE_SIGNATURE_G)
157 }
158 #[doc = r" Sets the field bit"]
159 pub fn set_bit(self) -> &'a mut W {
160 self.bit(true)
161 }
162 #[doc = r" Clears the field bit"]
163 pub fn clear_bit(self) -> &'a mut W {
164 self.bit(false)
165 }
166 #[doc = r" Writes raw bits to the field"]
167 #[inline]
168 pub fn bit(self, value: bool) -> &'a mut W {
169 const MASK: bool = true;
170 const OFFSET: u8 = 17;
171 self.w.bits &= !((MASK as u32) << OFFSET);
172 self.w.bits |= ((value & MASK) as u32) << OFFSET;
173 self.w
174 }
175}
176impl R {
177 #[doc = r" Value of the register as raw bits"]
178 #[inline]
179 pub fn bits(&self) -> u32 {
180 self.bits
181 }
182 #[doc = "Bits 0:16 - BIST stop address divided by 16 (corresponds to AHB byte address \\[20:4\\])."]
183 #[inline]
184 pub fn stop(&self) -> STOPR {
185 let bits = {
186 const MASK: u32 = 131071;
187 const OFFSET: u8 = 0;
188 ((self.bits >> OFFSET) & MASK as u32) as u32
189 };
190 STOPR { bits }
191 }
192 #[doc = "Bit 17 - Start control bit for signature generation."]
193 #[inline]
194 pub fn sig_start(&self) -> SIG_STARTR {
195 SIG_STARTR::_from({
196 const MASK: bool = true;
197 const OFFSET: u8 = 17;
198 ((self.bits >> OFFSET) & MASK as u32) != 0
199 })
200 }
201}
202impl W {
203 #[doc = r" Reset value of the register"]
204 #[inline]
205 pub fn reset_value() -> W {
206 W { bits: 0 }
207 }
208 #[doc = r" Writes raw bits to the register"]
209 #[inline]
210 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
211 self.bits = bits;
212 self
213 }
214 #[doc = "Bits 0:16 - BIST stop address divided by 16 (corresponds to AHB byte address \\[20:4\\])."]
215 #[inline]
216 pub fn stop(&mut self) -> _STOPW {
217 _STOPW { w: self }
218 }
219 #[doc = "Bit 17 - Start control bit for signature generation."]
220 #[inline]
221 pub fn sig_start(&mut self) -> _SIG_STARTW {
222 _SIG_STARTW { w: self }
223 }
224}