atsam4ls2c_pac/bpm/
fwrunps.rs

1#[doc = "Register `FWRUNPS` reader"]
2pub struct R(crate::R<FWRUNPS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FWRUNPS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FWRUNPS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FWRUNPS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `REGLEVEL` reader - Regulator Voltage Level"]
17pub type REGLEVEL_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `REGTYPE` reader - Regulator Type"]
19pub type REGTYPE_R = crate::FieldReader<u8, REGTYPESELECT_A>;
20#[doc = "Regulator Type\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22#[repr(u8)]
23pub enum REGTYPESELECT_A {
24    #[doc = "0: `0`"]
25    NORMAL = 0,
26    #[doc = "1: `1`"]
27    LP = 1,
28    #[doc = "2: `10`"]
29    XULP = 2,
30}
31impl From<REGTYPESELECT_A> for u8 {
32    #[inline(always)]
33    fn from(variant: REGTYPESELECT_A) -> Self {
34        variant as _
35    }
36}
37impl REGTYPE_R {
38    #[doc = "Get enumerated values variant"]
39    #[inline(always)]
40    pub fn variant(&self) -> Option<REGTYPESELECT_A> {
41        match self.bits {
42            0 => Some(REGTYPESELECT_A::NORMAL),
43            1 => Some(REGTYPESELECT_A::LP),
44            2 => Some(REGTYPESELECT_A::XULP),
45            _ => None,
46        }
47    }
48    #[doc = "Checks if the value of the field is `NORMAL`"]
49    #[inline(always)]
50    pub fn is_normal(&self) -> bool {
51        *self == REGTYPESELECT_A::NORMAL
52    }
53    #[doc = "Checks if the value of the field is `LP`"]
54    #[inline(always)]
55    pub fn is_lp(&self) -> bool {
56        *self == REGTYPESELECT_A::LP
57    }
58    #[doc = "Checks if the value of the field is `XULP`"]
59    #[inline(always)]
60    pub fn is_xulp(&self) -> bool {
61        *self == REGTYPESELECT_A::XULP
62    }
63}
64#[doc = "Field `REFTYPE` reader - Reference Type"]
65pub type REFTYPE_R = crate::FieldReader<u8, REFTYPESELECT_A>;
66#[doc = "Reference Type\n\nValue on reset: 0"]
67#[derive(Clone, Copy, Debug, PartialEq, Eq)]
68#[repr(u8)]
69pub enum REFTYPESELECT_A {
70    #[doc = "0: `0`"]
71    BOTH = 0,
72    #[doc = "1: `1`"]
73    BG = 1,
74    #[doc = "2: `10`"]
75    LPBG = 2,
76    #[doc = "3: `11`"]
77    INTERNAL = 3,
78}
79impl From<REFTYPESELECT_A> for u8 {
80    #[inline(always)]
81    fn from(variant: REFTYPESELECT_A) -> Self {
82        variant as _
83    }
84}
85impl REFTYPE_R {
86    #[doc = "Get enumerated values variant"]
87    #[inline(always)]
88    pub fn variant(&self) -> REFTYPESELECT_A {
89        match self.bits {
90            0 => REFTYPESELECT_A::BOTH,
91            1 => REFTYPESELECT_A::BG,
92            2 => REFTYPESELECT_A::LPBG,
93            3 => REFTYPESELECT_A::INTERNAL,
94            _ => unreachable!(),
95        }
96    }
97    #[doc = "Checks if the value of the field is `BOTH`"]
98    #[inline(always)]
99    pub fn is_both(&self) -> bool {
100        *self == REFTYPESELECT_A::BOTH
101    }
102    #[doc = "Checks if the value of the field is `BG`"]
103    #[inline(always)]
104    pub fn is_bg(&self) -> bool {
105        *self == REFTYPESELECT_A::BG
106    }
107    #[doc = "Checks if the value of the field is `LPBG`"]
108    #[inline(always)]
109    pub fn is_lpbg(&self) -> bool {
110        *self == REFTYPESELECT_A::LPBG
111    }
112    #[doc = "Checks if the value of the field is `INTERNAL`"]
113    #[inline(always)]
114    pub fn is_internal(&self) -> bool {
115        *self == REFTYPESELECT_A::INTERNAL
116    }
117}
118#[doc = "Field `FLASHLATDEL` reader - Flash Latch Delay Value"]
119pub type FLASHLATDEL_R = crate::FieldReader<u8, u8>;
120#[doc = "Field `FLASHBIAS` reader - Flash Bias Value"]
121pub type FLASHBIAS_R = crate::FieldReader<u8, u8>;
122#[doc = "Field `FPPW` reader - Flash Pico Power Mode"]
123pub type FPPW_R = crate::BitReader<bool>;
124#[doc = "Field `RC115` reader - RC 115KHZ Calibration Value"]
125pub type RC115_R = crate::FieldReader<u8, u8>;
126#[doc = "Field `RCFAST` reader - RCFAST Calibration Value"]
127pub type RCFAST_R = crate::FieldReader<u8, u8>;
128impl R {
129    #[doc = "Bits 0:3 - Regulator Voltage Level"]
130    #[inline(always)]
131    pub fn reglevel(&self) -> REGLEVEL_R {
132        REGLEVEL_R::new((self.bits & 0x0f) as u8)
133    }
134    #[doc = "Bits 4:5 - Regulator Type"]
135    #[inline(always)]
136    pub fn regtype(&self) -> REGTYPE_R {
137        REGTYPE_R::new(((self.bits >> 4) & 3) as u8)
138    }
139    #[doc = "Bits 6:7 - Reference Type"]
140    #[inline(always)]
141    pub fn reftype(&self) -> REFTYPE_R {
142        REFTYPE_R::new(((self.bits >> 6) & 3) as u8)
143    }
144    #[doc = "Bits 8:12 - Flash Latch Delay Value"]
145    #[inline(always)]
146    pub fn flashlatdel(&self) -> FLASHLATDEL_R {
147        FLASHLATDEL_R::new(((self.bits >> 8) & 0x1f) as u8)
148    }
149    #[doc = "Bits 13:16 - Flash Bias Value"]
150    #[inline(always)]
151    pub fn flashbias(&self) -> FLASHBIAS_R {
152        FLASHBIAS_R::new(((self.bits >> 13) & 0x0f) as u8)
153    }
154    #[doc = "Bit 17 - Flash Pico Power Mode"]
155    #[inline(always)]
156    pub fn fppw(&self) -> FPPW_R {
157        FPPW_R::new(((self.bits >> 17) & 1) != 0)
158    }
159    #[doc = "Bits 18:24 - RC 115KHZ Calibration Value"]
160    #[inline(always)]
161    pub fn rc115(&self) -> RC115_R {
162        RC115_R::new(((self.bits >> 18) & 0x7f) as u8)
163    }
164    #[doc = "Bits 25:31 - RCFAST Calibration Value"]
165    #[inline(always)]
166    pub fn rcfast(&self) -> RCFAST_R {
167        RCFAST_R::new(((self.bits >> 25) & 0x7f) as u8)
168    }
169}
170#[doc = "Factory Word Run PS Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fwrunps](index.html) module"]
171pub struct FWRUNPS_SPEC;
172impl crate::RegisterSpec for FWRUNPS_SPEC {
173    type Ux = u32;
174}
175#[doc = "`read()` method returns [fwrunps::R](R) reader structure"]
176impl crate::Readable for FWRUNPS_SPEC {
177    type Reader = R;
178}
179#[doc = "`reset()` method sets FWRUNPS to value 0"]
180impl crate::Resettable for FWRUNPS_SPEC {
181    const RESET_VALUE: Self::Ux = 0;
182}