mcxa-pac 0.3.0

Peripheral Access Crate for MCXA256 devices
Documentation
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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
#[doc = "Register `LP_CFG` reader"]
pub type R = crate::R<LpCfgSpec>;
#[doc = "Register `LP_CFG` writer"]
pub type W = crate::W<LpCfgSpec>;
#[doc = "LDO_CORE VDD Drive Strength\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CoreldoVddDs {
    #[doc = "0: Low"]
    Low = 0,
    #[doc = "1: Normal"]
    Normal = 1,
}
impl From<CoreldoVddDs> for bool {
    #[inline(always)]
    fn from(variant: CoreldoVddDs) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CORELDO_VDD_DS` reader - LDO_CORE VDD Drive Strength"]
pub type CoreldoVddDsR = crate::BitReader<CoreldoVddDs>;
impl CoreldoVddDsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CoreldoVddDs {
        match self.bits {
            false => CoreldoVddDs::Low,
            true => CoreldoVddDs::Normal,
        }
    }
    #[doc = "Low"]
    #[inline(always)]
    pub fn is_low(&self) -> bool {
        *self == CoreldoVddDs::Low
    }
    #[doc = "Normal"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == CoreldoVddDs::Normal
    }
}
#[doc = "Field `CORELDO_VDD_DS` writer - LDO_CORE VDD Drive Strength"]
pub type CoreldoVddDsW<'a, REG> = crate::BitWriter<'a, REG, CoreldoVddDs>;
impl<'a, REG> CoreldoVddDsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Low"]
    #[inline(always)]
    pub fn low(self) -> &'a mut crate::W<REG> {
        self.variant(CoreldoVddDs::Low)
    }
    #[doc = "Normal"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut crate::W<REG> {
        self.variant(CoreldoVddDs::Normal)
    }
}
#[doc = "LDO_CORE VDD Regulator Voltage Level\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CoreldoVddLvl {
    #[doc = "1: Mid voltage (1.0 V)"]
    Mid = 1,
    #[doc = "2: Normal voltage (1.1 V)"]
    Normal = 2,
    #[doc = "3: Overdrive voltage (1.15 V)"]
    Over = 3,
}
impl From<CoreldoVddLvl> for u8 {
    #[inline(always)]
    fn from(variant: CoreldoVddLvl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for CoreldoVddLvl {
    type Ux = u8;
}
impl crate::IsEnum for CoreldoVddLvl {}
#[doc = "Field `CORELDO_VDD_LVL` reader - LDO_CORE VDD Regulator Voltage Level"]
pub type CoreldoVddLvlR = crate::FieldReader<CoreldoVddLvl>;
impl CoreldoVddLvlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<CoreldoVddLvl> {
        match self.bits {
            1 => Some(CoreldoVddLvl::Mid),
            2 => Some(CoreldoVddLvl::Normal),
            3 => Some(CoreldoVddLvl::Over),
            _ => None,
        }
    }
    #[doc = "Mid voltage (1.0 V)"]
    #[inline(always)]
    pub fn is_mid(&self) -> bool {
        *self == CoreldoVddLvl::Mid
    }
    #[doc = "Normal voltage (1.1 V)"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == CoreldoVddLvl::Normal
    }
    #[doc = "Overdrive voltage (1.15 V)"]
    #[inline(always)]
    pub fn is_over(&self) -> bool {
        *self == CoreldoVddLvl::Over
    }
}
#[doc = "Field `CORELDO_VDD_LVL` writer - LDO_CORE VDD Regulator Voltage Level"]
pub type CoreldoVddLvlW<'a, REG> = crate::FieldWriter<'a, REG, 2, CoreldoVddLvl>;
impl<'a, REG> CoreldoVddLvlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Mid voltage (1.0 V)"]
    #[inline(always)]
    pub fn mid(self) -> &'a mut crate::W<REG> {
        self.variant(CoreldoVddLvl::Mid)
    }
    #[doc = "Normal voltage (1.1 V)"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut crate::W<REG> {
        self.variant(CoreldoVddLvl::Normal)
    }
    #[doc = "Overdrive voltage (1.15 V)"]
    #[inline(always)]
    pub fn over(self) -> &'a mut crate::W<REG> {
        self.variant(CoreldoVddLvl::Over)
    }
}
#[doc = "SRAM_LDO Deep Power Low Power IREF Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SramldoDpdOn {
    #[doc = "0: Low Power IREF is disabled for power saving in Deep Power Down mode"]
    Disabled = 0,
    #[doc = "1: Low Power IREF is enabled"]
    Enabled = 1,
}
impl From<SramldoDpdOn> for bool {
    #[inline(always)]
    fn from(variant: SramldoDpdOn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRAMLDO_DPD_ON` reader - SRAM_LDO Deep Power Low Power IREF Enable"]
pub type SramldoDpdOnR = crate::BitReader<SramldoDpdOn>;
impl SramldoDpdOnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SramldoDpdOn {
        match self.bits {
            false => SramldoDpdOn::Disabled,
            true => SramldoDpdOn::Enabled,
        }
    }
    #[doc = "Low Power IREF is disabled for power saving in Deep Power Down mode"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == SramldoDpdOn::Disabled
    }
    #[doc = "Low Power IREF is enabled"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == SramldoDpdOn::Enabled
    }
}
#[doc = "Field `SRAMLDO_DPD_ON` writer - SRAM_LDO Deep Power Low Power IREF Enable"]
pub type SramldoDpdOnW<'a, REG> = crate::BitWriter<'a, REG, SramldoDpdOn>;
impl<'a, REG> SramldoDpdOnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Low Power IREF is disabled for power saving in Deep Power Down mode"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(SramldoDpdOn::Disabled)
    }
    #[doc = "Low Power IREF is enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(SramldoDpdOn::Enabled)
    }
}
#[doc = "Bandgap Mode\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Bgmode {
    #[doc = "0: Bandgap disabled"]
    Bgmode0 = 0,
    #[doc = "1: Bandgap enabled, buffer disabled"]
    Bgmode01 = 1,
    #[doc = "2: Bandgap enabled, buffer enabled"]
    Bgmode10 = 2,
}
impl From<Bgmode> for u8 {
    #[inline(always)]
    fn from(variant: Bgmode) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Bgmode {
    type Ux = u8;
}
impl crate::IsEnum for Bgmode {}
#[doc = "Field `BGMODE` reader - Bandgap Mode"]
pub type BgmodeR = crate::FieldReader<Bgmode>;
impl BgmodeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Bgmode> {
        match self.bits {
            0 => Some(Bgmode::Bgmode0),
            1 => Some(Bgmode::Bgmode01),
            2 => Some(Bgmode::Bgmode10),
            _ => None,
        }
    }
    #[doc = "Bandgap disabled"]
    #[inline(always)]
    pub fn is_bgmode0(&self) -> bool {
        *self == Bgmode::Bgmode0
    }
    #[doc = "Bandgap enabled, buffer disabled"]
    #[inline(always)]
    pub fn is_bgmode01(&self) -> bool {
        *self == Bgmode::Bgmode01
    }
    #[doc = "Bandgap enabled, buffer enabled"]
    #[inline(always)]
    pub fn is_bgmode10(&self) -> bool {
        *self == Bgmode::Bgmode10
    }
}
#[doc = "Field `BGMODE` writer - Bandgap Mode"]
pub type BgmodeW<'a, REG> = crate::FieldWriter<'a, REG, 2, Bgmode>;
impl<'a, REG> BgmodeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Bandgap disabled"]
    #[inline(always)]
    pub fn bgmode0(self) -> &'a mut crate::W<REG> {
        self.variant(Bgmode::Bgmode0)
    }
    #[doc = "Bandgap enabled, buffer disabled"]
    #[inline(always)]
    pub fn bgmode01(self) -> &'a mut crate::W<REG> {
        self.variant(Bgmode::Bgmode01)
    }
    #[doc = "Bandgap enabled, buffer enabled"]
    #[inline(always)]
    pub fn bgmode10(self) -> &'a mut crate::W<REG> {
        self.variant(Bgmode::Bgmode10)
    }
}
#[doc = "Low-Power IREF Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LpIrefen {
    #[doc = "0: Disable for power saving in Deep Power Down mode"]
    Disable = 0,
    #[doc = "1: Enable"]
    Enable = 1,
}
impl From<LpIrefen> for bool {
    #[inline(always)]
    fn from(variant: LpIrefen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LP_IREFEN` reader - Low-Power IREF Enable"]
pub type LpIrefenR = crate::BitReader<LpIrefen>;
impl LpIrefenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LpIrefen {
        match self.bits {
            false => LpIrefen::Disable,
            true => LpIrefen::Enable,
        }
    }
    #[doc = "Disable for power saving in Deep Power Down mode"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == LpIrefen::Disable
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == LpIrefen::Enable
    }
}
#[doc = "Field `LP_IREFEN` writer - Low-Power IREF Enable"]
pub type LpIrefenW<'a, REG> = crate::BitWriter<'a, REG, LpIrefen>;
impl<'a, REG> LpIrefenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable for power saving in Deep Power Down mode"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut crate::W<REG> {
        self.variant(LpIrefen::Disable)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut crate::W<REG> {
        self.variant(LpIrefen::Enable)
    }
}
#[doc = "Core Low Voltage Detect Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CoreLvde {
    #[doc = "0: Disable"]
    Disable = 0,
    #[doc = "1: Enable"]
    Enable = 1,
}
impl From<CoreLvde> for bool {
    #[inline(always)]
    fn from(variant: CoreLvde) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CORE_LVDE` reader - Core Low Voltage Detect Enable"]
pub type CoreLvdeR = crate::BitReader<CoreLvde>;
impl CoreLvdeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CoreLvde {
        match self.bits {
            false => CoreLvde::Disable,
            true => CoreLvde::Enable,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == CoreLvde::Disable
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == CoreLvde::Enable
    }
}
#[doc = "Field `CORE_LVDE` writer - Core Low Voltage Detect Enable"]
pub type CoreLvdeW<'a, REG> = crate::BitWriter<'a, REG, CoreLvde>;
impl<'a, REG> CoreLvdeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut crate::W<REG> {
        self.variant(CoreLvde::Disable)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut crate::W<REG> {
        self.variant(CoreLvde::Enable)
    }
}
#[doc = "System Low Voltage Detect Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SysLvde {
    #[doc = "0: Disable"]
    Disable = 0,
    #[doc = "1: Enable"]
    Enable = 1,
}
impl From<SysLvde> for bool {
    #[inline(always)]
    fn from(variant: SysLvde) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SYS_LVDE` reader - System Low Voltage Detect Enable"]
pub type SysLvdeR = crate::BitReader<SysLvde>;
impl SysLvdeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SysLvde {
        match self.bits {
            false => SysLvde::Disable,
            true => SysLvde::Enable,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == SysLvde::Disable
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == SysLvde::Enable
    }
}
#[doc = "Field `SYS_LVDE` writer - System Low Voltage Detect Enable"]
pub type SysLvdeW<'a, REG> = crate::BitWriter<'a, REG, SysLvde>;
impl<'a, REG> SysLvdeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut crate::W<REG> {
        self.variant(SysLvde::Disable)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut crate::W<REG> {
        self.variant(SysLvde::Enable)
    }
}
#[doc = "System High Voltage Detect Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SysHvde {
    #[doc = "0: Disable"]
    Disable = 0,
    #[doc = "1: Enable"]
    Enable = 1,
}
impl From<SysHvde> for bool {
    #[inline(always)]
    fn from(variant: SysHvde) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SYS_HVDE` reader - System High Voltage Detect Enable"]
pub type SysHvdeR = crate::BitReader<SysHvde>;
impl SysHvdeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SysHvde {
        match self.bits {
            false => SysHvde::Disable,
            true => SysHvde::Enable,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == SysHvde::Disable
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == SysHvde::Enable
    }
}
#[doc = "Field `SYS_HVDE` writer - System High Voltage Detect Enable"]
pub type SysHvdeW<'a, REG> = crate::BitWriter<'a, REG, SysHvde>;
impl<'a, REG> SysHvdeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut crate::W<REG> {
        self.variant(SysHvde::Disable)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut crate::W<REG> {
        self.variant(SysHvde::Enable)
    }
}
impl R {
    #[doc = "Bit 0 - LDO_CORE VDD Drive Strength"]
    #[inline(always)]
    pub fn coreldo_vdd_ds(&self) -> CoreldoVddDsR {
        CoreldoVddDsR::new((self.bits & 1) != 0)
    }
    #[doc = "Bits 2:3 - LDO_CORE VDD Regulator Voltage Level"]
    #[inline(always)]
    pub fn coreldo_vdd_lvl(&self) -> CoreldoVddLvlR {
        CoreldoVddLvlR::new(((self.bits >> 2) & 3) as u8)
    }
    #[doc = "Bit 19 - SRAM_LDO Deep Power Low Power IREF Enable"]
    #[inline(always)]
    pub fn sramldo_dpd_on(&self) -> SramldoDpdOnR {
        SramldoDpdOnR::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bits 20:21 - Bandgap Mode"]
    #[inline(always)]
    pub fn bgmode(&self) -> BgmodeR {
        BgmodeR::new(((self.bits >> 20) & 3) as u8)
    }
    #[doc = "Bit 23 - Low-Power IREF Enable"]
    #[inline(always)]
    pub fn lp_irefen(&self) -> LpIrefenR {
        LpIrefenR::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - Core Low Voltage Detect Enable"]
    #[inline(always)]
    pub fn core_lvde(&self) -> CoreLvdeR {
        CoreLvdeR::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - System Low Voltage Detect Enable"]
    #[inline(always)]
    pub fn sys_lvde(&self) -> SysLvdeR {
        SysLvdeR::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 28 - System High Voltage Detect Enable"]
    #[inline(always)]
    pub fn sys_hvde(&self) -> SysHvdeR {
        SysHvdeR::new(((self.bits >> 28) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("LP_CFG")
            .field("coreldo_vdd_ds", &self.coreldo_vdd_ds())
            .field("coreldo_vdd_lvl", &self.coreldo_vdd_lvl())
            .field("sramldo_dpd_on", &self.sramldo_dpd_on())
            .field("bgmode", &self.bgmode())
            .field("lp_irefen", &self.lp_irefen())
            .field("core_lvde", &self.core_lvde())
            .field("sys_lvde", &self.sys_lvde())
            .field("sys_hvde", &self.sys_hvde())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - LDO_CORE VDD Drive Strength"]
    #[inline(always)]
    pub fn coreldo_vdd_ds(&mut self) -> CoreldoVddDsW<'_, LpCfgSpec> {
        CoreldoVddDsW::new(self, 0)
    }
    #[doc = "Bits 2:3 - LDO_CORE VDD Regulator Voltage Level"]
    #[inline(always)]
    pub fn coreldo_vdd_lvl(&mut self) -> CoreldoVddLvlW<'_, LpCfgSpec> {
        CoreldoVddLvlW::new(self, 2)
    }
    #[doc = "Bit 19 - SRAM_LDO Deep Power Low Power IREF Enable"]
    #[inline(always)]
    pub fn sramldo_dpd_on(&mut self) -> SramldoDpdOnW<'_, LpCfgSpec> {
        SramldoDpdOnW::new(self, 19)
    }
    #[doc = "Bits 20:21 - Bandgap Mode"]
    #[inline(always)]
    pub fn bgmode(&mut self) -> BgmodeW<'_, LpCfgSpec> {
        BgmodeW::new(self, 20)
    }
    #[doc = "Bit 23 - Low-Power IREF Enable"]
    #[inline(always)]
    pub fn lp_irefen(&mut self) -> LpIrefenW<'_, LpCfgSpec> {
        LpIrefenW::new(self, 23)
    }
    #[doc = "Bit 24 - Core Low Voltage Detect Enable"]
    #[inline(always)]
    pub fn core_lvde(&mut self) -> CoreLvdeW<'_, LpCfgSpec> {
        CoreLvdeW::new(self, 24)
    }
    #[doc = "Bit 25 - System Low Voltage Detect Enable"]
    #[inline(always)]
    pub fn sys_lvde(&mut self) -> SysLvdeW<'_, LpCfgSpec> {
        SysLvdeW::new(self, 25)
    }
    #[doc = "Bit 28 - System High Voltage Detect Enable"]
    #[inline(always)]
    pub fn sys_hvde(&mut self) -> SysHvdeW<'_, LpCfgSpec> {
        SysHvdeW::new(self, 28)
    }
}
#[doc = "Low-Power Mode Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`lp_cfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lp_cfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct LpCfgSpec;
impl crate::RegisterSpec for LpCfgSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`lp_cfg::R`](R) reader structure"]
impl crate::Readable for LpCfgSpec {}
#[doc = "`write(|w| ..)` method takes [`lp_cfg::W`](W) writer structure"]
impl crate::Writable for LpCfgSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets LP_CFG to value 0x0008_0004"]
impl crate::Resettable for LpCfgSpec {
    const RESET_VALUE: u32 = 0x0008_0004;
}