1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
#[doc = "Register `LOCK` reader"]
pub type R = crate::R<LockSpec>;
#[doc = "Register `LOCK` writer"]
pub type W = crate::W<LockSpec>;
#[doc = "Port lock bit 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lk0 {
    #[doc = "0: Port configuration not locked"]
    Unlocked = 0,
    #[doc = "1: Port configuration locked"]
    Locked = 1,
}
impl From<Lk0> for bool {
    #[inline(always)]
    fn from(variant: Lk0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LK0` reader - Port lock bit 0"]
pub type Lk0R = crate::BitReader<Lk0>;
impl Lk0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lk0 {
        match self.bits {
            false => Lk0::Unlocked,
            true => Lk0::Locked,
        }
    }
    #[doc = "Port configuration not locked"]
    #[inline(always)]
    pub fn is_unlocked(&self) -> bool {
        *self == Lk0::Unlocked
    }
    #[doc = "Port configuration locked"]
    #[inline(always)]
    pub fn is_locked(&self) -> bool {
        *self == Lk0::Locked
    }
}
#[doc = "Field `LK0` writer - Port lock bit 0"]
pub type Lk0W<'a, REG> = crate::BitWriter<'a, REG, Lk0>;
impl<'a, REG> Lk0W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Port configuration not locked"]
    #[inline(always)]
    pub fn unlocked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk0::Unlocked)
    }
    #[doc = "Port configuration locked"]
    #[inline(always)]
    pub fn locked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk0::Locked)
    }
}
#[doc = "Field `LK1` reader - Port lock bit 1"]
pub use Lk0R as Lk1R;
#[doc = "Field `LK2` reader - Port lock bit 2"]
pub use Lk0R as Lk2R;
#[doc = "Field `LK3` reader - Port lock bit 3"]
pub use Lk0R as Lk3R;
#[doc = "Field `LK4` reader - Port lock bit 4"]
pub use Lk0R as Lk4R;
#[doc = "Field `LK5` reader - Port lock bit 5"]
pub use Lk0R as Lk5R;
#[doc = "Field `LK6` reader - Port lock bit 6"]
pub use Lk0R as Lk6R;
#[doc = "Field `LK7` reader - Port lock bit 7"]
pub use Lk0R as Lk7R;
#[doc = "Field `LK8` reader - Port lock bit 8"]
pub use Lk0R as Lk8R;
#[doc = "Field `LK9` reader - Port lock bit 9"]
pub use Lk0R as Lk9R;
#[doc = "Field `LK1` writer - Port lock bit 1"]
pub use Lk0W as Lk1W;
#[doc = "Field `LK2` writer - Port lock bit 2"]
pub use Lk0W as Lk2W;
#[doc = "Field `LK3` writer - Port lock bit 3"]
pub use Lk0W as Lk3W;
#[doc = "Field `LK4` writer - Port lock bit 4"]
pub use Lk0W as Lk4W;
#[doc = "Field `LK5` writer - Port lock bit 5"]
pub use Lk0W as Lk5W;
#[doc = "Field `LK6` writer - Port lock bit 6"]
pub use Lk0W as Lk6W;
#[doc = "Field `LK7` writer - Port lock bit 7"]
pub use Lk0W as Lk7W;
#[doc = "Field `LK8` writer - Port lock bit 8"]
pub use Lk0W as Lk8W;
#[doc = "Field `LK9` writer - Port lock bit 9"]
pub use Lk0W as Lk9W;
#[doc = "Port lock bit 10\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lk10 {
    #[doc = "0: Port configuration not locked"]
    Unlocked = 0,
    #[doc = "1: Port configuration locked"]
    Locked = 1,
}
impl From<Lk10> for bool {
    #[inline(always)]
    fn from(variant: Lk10) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LK10` reader - Port lock bit 10"]
pub type Lk10R = crate::BitReader<Lk10>;
impl Lk10R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lk10 {
        match self.bits {
            false => Lk10::Unlocked,
            true => Lk10::Locked,
        }
    }
    #[doc = "Port configuration not locked"]
    #[inline(always)]
    pub fn is_unlocked(&self) -> bool {
        *self == Lk10::Unlocked
    }
    #[doc = "Port configuration locked"]
    #[inline(always)]
    pub fn is_locked(&self) -> bool {
        *self == Lk10::Locked
    }
}
#[doc = "Field `LK10` writer - Port lock bit 10"]
pub type Lk10W<'a, REG> = crate::BitWriter<'a, REG, Lk10>;
impl<'a, REG> Lk10W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Port configuration not locked"]
    #[inline(always)]
    pub fn unlocked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk10::Unlocked)
    }
    #[doc = "Port configuration locked"]
    #[inline(always)]
    pub fn locked(self) -> &'a mut crate::W<REG> {
        self.variant(Lk10::Locked)
    }
}
#[doc = "Field `LK11` reader - Port lock bit 11"]
pub use Lk10R as Lk11R;
#[doc = "Field `LK12` reader - Port lock bit 12"]
pub use Lk10R as Lk12R;
#[doc = "Field `LK13` reader - Port lock bit 13"]
pub use Lk10R as Lk13R;
#[doc = "Field `LK14` reader - Port lock bit 14"]
pub use Lk10R as Lk14R;
#[doc = "Field `LK15` reader - Port lock bit 15"]
pub use Lk10R as Lk15R;
#[doc = "Field `LK11` writer - Port lock bit 11"]
pub use Lk10W as Lk11W;
#[doc = "Field `LK12` writer - Port lock bit 12"]
pub use Lk10W as Lk12W;
#[doc = "Field `LK13` writer - Port lock bit 13"]
pub use Lk10W as Lk13W;
#[doc = "Field `LK14` writer - Port lock bit 14"]
pub use Lk10W as Lk14W;
#[doc = "Field `LK15` writer - Port lock bit 15"]
pub use Lk10W as Lk15W;
#[doc = "Lock key\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lkk {
    #[doc = "0: Port configuration lock key not active"]
    NotActive = 0,
    #[doc = "1: Port configuration lock key active"]
    Active = 1,
}
impl From<Lkk> for bool {
    #[inline(always)]
    fn from(variant: Lkk) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LKK` reader - Lock key"]
pub type LkkR = crate::BitReader<Lkk>;
impl LkkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lkk {
        match self.bits {
            false => Lkk::NotActive,
            true => Lkk::Active,
        }
    }
    #[doc = "Port configuration lock key not active"]
    #[inline(always)]
    pub fn is_not_active(&self) -> bool {
        *self == Lkk::NotActive
    }
    #[doc = "Port configuration lock key active"]
    #[inline(always)]
    pub fn is_active(&self) -> bool {
        *self == Lkk::Active
    }
}
#[doc = "Field `LKK` writer - Lock key"]
pub type LkkW<'a, REG> = crate::BitWriter<'a, REG, Lkk>;
impl<'a, REG> LkkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Port configuration lock key not active"]
    #[inline(always)]
    pub fn not_active(self) -> &'a mut crate::W<REG> {
        self.variant(Lkk::NotActive)
    }
    #[doc = "Port configuration lock key active"]
    #[inline(always)]
    pub fn active(self) -> &'a mut crate::W<REG> {
        self.variant(Lkk::Active)
    }
}
impl R {
    #[doc = "Bit 0 - Port lock bit 0"]
    #[inline(always)]
    pub fn lk0(&self) -> Lk0R {
        Lk0R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Port lock bit 1"]
    #[inline(always)]
    pub fn lk1(&self) -> Lk1R {
        Lk1R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Port lock bit 2"]
    #[inline(always)]
    pub fn lk2(&self) -> Lk2R {
        Lk2R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Port lock bit 3"]
    #[inline(always)]
    pub fn lk3(&self) -> Lk3R {
        Lk3R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Port lock bit 4"]
    #[inline(always)]
    pub fn lk4(&self) -> Lk4R {
        Lk4R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Port lock bit 5"]
    #[inline(always)]
    pub fn lk5(&self) -> Lk5R {
        Lk5R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Port lock bit 6"]
    #[inline(always)]
    pub fn lk6(&self) -> Lk6R {
        Lk6R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Port lock bit 7"]
    #[inline(always)]
    pub fn lk7(&self) -> Lk7R {
        Lk7R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Port lock bit 8"]
    #[inline(always)]
    pub fn lk8(&self) -> Lk8R {
        Lk8R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Port lock bit 9"]
    #[inline(always)]
    pub fn lk9(&self) -> Lk9R {
        Lk9R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Port lock bit 10"]
    #[inline(always)]
    pub fn lk10(&self) -> Lk10R {
        Lk10R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Port lock bit 11"]
    #[inline(always)]
    pub fn lk11(&self) -> Lk11R {
        Lk11R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Port lock bit 12"]
    #[inline(always)]
    pub fn lk12(&self) -> Lk12R {
        Lk12R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Port lock bit 13"]
    #[inline(always)]
    pub fn lk13(&self) -> Lk13R {
        Lk13R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Port lock bit 14"]
    #[inline(always)]
    pub fn lk14(&self) -> Lk14R {
        Lk14R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Port lock bit 15"]
    #[inline(always)]
    pub fn lk15(&self) -> Lk15R {
        Lk15R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 16 - Lock key"]
    #[inline(always)]
    pub fn lkk(&self) -> LkkR {
        LkkR::new(((self.bits >> 16) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Port lock bit 0"]
    #[inline(always)]
    #[must_use]
    pub fn lk0(&mut self) -> Lk0W<LockSpec> {
        Lk0W::new(self, 0)
    }
    #[doc = "Bit 1 - Port lock bit 1"]
    #[inline(always)]
    #[must_use]
    pub fn lk1(&mut self) -> Lk1W<LockSpec> {
        Lk1W::new(self, 1)
    }
    #[doc = "Bit 2 - Port lock bit 2"]
    #[inline(always)]
    #[must_use]
    pub fn lk2(&mut self) -> Lk2W<LockSpec> {
        Lk2W::new(self, 2)
    }
    #[doc = "Bit 3 - Port lock bit 3"]
    #[inline(always)]
    #[must_use]
    pub fn lk3(&mut self) -> Lk3W<LockSpec> {
        Lk3W::new(self, 3)
    }
    #[doc = "Bit 4 - Port lock bit 4"]
    #[inline(always)]
    #[must_use]
    pub fn lk4(&mut self) -> Lk4W<LockSpec> {
        Lk4W::new(self, 4)
    }
    #[doc = "Bit 5 - Port lock bit 5"]
    #[inline(always)]
    #[must_use]
    pub fn lk5(&mut self) -> Lk5W<LockSpec> {
        Lk5W::new(self, 5)
    }
    #[doc = "Bit 6 - Port lock bit 6"]
    #[inline(always)]
    #[must_use]
    pub fn lk6(&mut self) -> Lk6W<LockSpec> {
        Lk6W::new(self, 6)
    }
    #[doc = "Bit 7 - Port lock bit 7"]
    #[inline(always)]
    #[must_use]
    pub fn lk7(&mut self) -> Lk7W<LockSpec> {
        Lk7W::new(self, 7)
    }
    #[doc = "Bit 8 - Port lock bit 8"]
    #[inline(always)]
    #[must_use]
    pub fn lk8(&mut self) -> Lk8W<LockSpec> {
        Lk8W::new(self, 8)
    }
    #[doc = "Bit 9 - Port lock bit 9"]
    #[inline(always)]
    #[must_use]
    pub fn lk9(&mut self) -> Lk9W<LockSpec> {
        Lk9W::new(self, 9)
    }
    #[doc = "Bit 10 - Port lock bit 10"]
    #[inline(always)]
    #[must_use]
    pub fn lk10(&mut self) -> Lk10W<LockSpec> {
        Lk10W::new(self, 10)
    }
    #[doc = "Bit 11 - Port lock bit 11"]
    #[inline(always)]
    #[must_use]
    pub fn lk11(&mut self) -> Lk11W<LockSpec> {
        Lk11W::new(self, 11)
    }
    #[doc = "Bit 12 - Port lock bit 12"]
    #[inline(always)]
    #[must_use]
    pub fn lk12(&mut self) -> Lk12W<LockSpec> {
        Lk12W::new(self, 12)
    }
    #[doc = "Bit 13 - Port lock bit 13"]
    #[inline(always)]
    #[must_use]
    pub fn lk13(&mut self) -> Lk13W<LockSpec> {
        Lk13W::new(self, 13)
    }
    #[doc = "Bit 14 - Port lock bit 14"]
    #[inline(always)]
    #[must_use]
    pub fn lk14(&mut self) -> Lk14W<LockSpec> {
        Lk14W::new(self, 14)
    }
    #[doc = "Bit 15 - Port lock bit 15"]
    #[inline(always)]
    #[must_use]
    pub fn lk15(&mut self) -> Lk15W<LockSpec> {
        Lk15W::new(self, 15)
    }
    #[doc = "Bit 16 - Lock key"]
    #[inline(always)]
    #[must_use]
    pub fn lkk(&mut self) -> LkkW<LockSpec> {
        LkkW::new(self, 16)
    }
}
#[doc = "GPIO port configuration lock register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lock::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lock::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct LockSpec;
impl crate::RegisterSpec for LockSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`lock::R`](R) reader structure"]
impl crate::Readable for LockSpec {}
#[doc = "`write(|w| ..)` method takes [`lock::W`](W) writer structure"]
impl crate::Writable for LockSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets LOCK to value 0"]
impl crate::Resettable for LockSpec {
    const RESET_VALUE: u32 = 0;
}