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
#[doc = "Register `GLBANA` reader"]
pub type R = crate::R<GlbanaSpec>;
#[doc = "Register `GLBANA` writer"]
pub type W = crate::W<GlbanaSpec>;
#[doc = "Field `SLDLY` reader - Delay of lock detection"]
pub type SldlyR = crate::FieldReader;
#[doc = "Field `SLDLY` writer - Delay of lock detection"]
pub type SldlyW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `FUP` reader - Force chargepump up"]
pub type FupR = crate::BitReader;
#[doc = "Field `FUP` writer - Force chargepump up"]
pub type FupW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `FDN` reader - Force chargepump down"]
pub type FdnR = crate::BitReader;
#[doc = "Field `FDN` writer - Force chargepump down"]
pub type FdnW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SLCP` reader - HRCs chargepump current selection"]
pub type SlcpR = crate::FieldReader;
#[doc = "Field `SLCP` writer - HRCs chargepump current selection"]
pub type SlcpW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
#[doc = "Field `SLIBLDO` reader - HRCs LDO bias current"]
pub type SlibldoR = crate::FieldReader;
#[doc = "Field `SLIBLDO` writer - HRCs LDO bias current"]
pub type SlibldoW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `SLIBLF` reader - HRCs loop filter bias current"]
pub type SliblfR = crate::FieldReader;
#[doc = "Field `SLIBLF` writer - HRCs loop filter bias current"]
pub type SliblfW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `SLVREF` reader - Reference voltage for chargepump and loop filter"]
pub type SlvrefR = crate::FieldReader;
#[doc = "Field `SLVREF` writer - Reference voltage for chargepump and loop filter"]
pub type SlvrefW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
#[doc = "Field `TRIBIAS` reader - Bias trimming"]
pub type TribiasR = crate::FieldReader;
#[doc = "Field `TRIBIAS` writer - Bias trimming"]
pub type TribiasW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Force chargepump down\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ghren {
    #[doc = "0: Global high resolution generation is enabled"]
    Value1 = 0,
    #[doc = "1: Global high resolution generation is disabled"]
    Value2 = 1,
}
impl From<Ghren> for bool {
    #[inline(always)]
    fn from(variant: Ghren) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `GHREN` reader - Force chargepump down"]
pub type GhrenR = crate::BitReader<Ghren>;
impl GhrenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ghren {
        match self.bits {
            false => Ghren::Value1,
            true => Ghren::Value2,
        }
    }
    #[doc = "Global high resolution generation is enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ghren::Value1
    }
    #[doc = "Global high resolution generation is disabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ghren::Value2
    }
}
#[doc = "Field `GHREN` writer - Force chargepump down"]
pub type GhrenW<'a, REG> = crate::BitWriter<'a, REG, Ghren>;
impl<'a, REG> GhrenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Global high resolution generation is enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ghren::Value1)
    }
    #[doc = "Global high resolution generation is disabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ghren::Value2)
    }
}
impl R {
    #[doc = "Bits 0:1 - Delay of lock detection"]
    #[inline(always)]
    pub fn sldly(&self) -> SldlyR {
        SldlyR::new((self.bits & 3) as u8)
    }
    #[doc = "Bit 2 - Force chargepump up"]
    #[inline(always)]
    pub fn fup(&self) -> FupR {
        FupR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Force chargepump down"]
    #[inline(always)]
    pub fn fdn(&self) -> FdnR {
        FdnR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bits 6:8 - HRCs chargepump current selection"]
    #[inline(always)]
    pub fn slcp(&self) -> SlcpR {
        SlcpR::new(((self.bits >> 6) & 7) as u8)
    }
    #[doc = "Bits 9:10 - HRCs LDO bias current"]
    #[inline(always)]
    pub fn slibldo(&self) -> SlibldoR {
        SlibldoR::new(((self.bits >> 9) & 3) as u8)
    }
    #[doc = "Bits 11:12 - HRCs loop filter bias current"]
    #[inline(always)]
    pub fn sliblf(&self) -> SliblfR {
        SliblfR::new(((self.bits >> 11) & 3) as u8)
    }
    #[doc = "Bits 13:15 - Reference voltage for chargepump and loop filter"]
    #[inline(always)]
    pub fn slvref(&self) -> SlvrefR {
        SlvrefR::new(((self.bits >> 13) & 7) as u8)
    }
    #[doc = "Bits 16:17 - Bias trimming"]
    #[inline(always)]
    pub fn tribias(&self) -> TribiasR {
        TribiasR::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bit 18 - Force chargepump down"]
    #[inline(always)]
    pub fn ghren(&self) -> GhrenR {
        GhrenR::new(((self.bits >> 18) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - Delay of lock detection"]
    #[inline(always)]
    #[must_use]
    pub fn sldly(&mut self) -> SldlyW<GlbanaSpec> {
        SldlyW::new(self, 0)
    }
    #[doc = "Bit 2 - Force chargepump up"]
    #[inline(always)]
    #[must_use]
    pub fn fup(&mut self) -> FupW<GlbanaSpec> {
        FupW::new(self, 2)
    }
    #[doc = "Bit 3 - Force chargepump down"]
    #[inline(always)]
    #[must_use]
    pub fn fdn(&mut self) -> FdnW<GlbanaSpec> {
        FdnW::new(self, 3)
    }
    #[doc = "Bits 6:8 - HRCs chargepump current selection"]
    #[inline(always)]
    #[must_use]
    pub fn slcp(&mut self) -> SlcpW<GlbanaSpec> {
        SlcpW::new(self, 6)
    }
    #[doc = "Bits 9:10 - HRCs LDO bias current"]
    #[inline(always)]
    #[must_use]
    pub fn slibldo(&mut self) -> SlibldoW<GlbanaSpec> {
        SlibldoW::new(self, 9)
    }
    #[doc = "Bits 11:12 - HRCs loop filter bias current"]
    #[inline(always)]
    #[must_use]
    pub fn sliblf(&mut self) -> SliblfW<GlbanaSpec> {
        SliblfW::new(self, 11)
    }
    #[doc = "Bits 13:15 - Reference voltage for chargepump and loop filter"]
    #[inline(always)]
    #[must_use]
    pub fn slvref(&mut self) -> SlvrefW<GlbanaSpec> {
        SlvrefW::new(self, 13)
    }
    #[doc = "Bits 16:17 - Bias trimming"]
    #[inline(always)]
    #[must_use]
    pub fn tribias(&mut self) -> TribiasW<GlbanaSpec> {
        TribiasW::new(self, 16)
    }
    #[doc = "Bit 18 - Force chargepump down"]
    #[inline(always)]
    #[must_use]
    pub fn ghren(&mut self) -> GhrenW<GlbanaSpec> {
        GhrenW::new(self, 18)
    }
}
#[doc = "Global Analog Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`glbana::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 [`glbana::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct GlbanaSpec;
impl crate::RegisterSpec for GlbanaSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`glbana::R`](R) reader structure"]
impl crate::Readable for GlbanaSpec {}
#[doc = "`write(|w| ..)` method takes [`glbana::W`](W) writer structure"]
impl crate::Writable for GlbanaSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets GLBANA to value 0x4b8c"]
impl crate::Resettable for GlbanaSpec {
    const RESET_VALUE: u32 = 0x4b8c;
}