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
#[doc = "Register `PLLCON2` reader"]
pub type R = crate::R<Pllcon2Spec>;
#[doc = "Register `PLLCON2` writer"]
pub type W = crate::W<Pllcon2Spec>;
#[doc = "P-Divider Input Selection\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Pinsel {
    #[doc = "0: PLL external oscillator selected"]
    Value1 = 0,
    #[doc = "1: Backup clock fofi selected"]
    Value2 = 1,
}
impl From<Pinsel> for bool {
    #[inline(always)]
    fn from(variant: Pinsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PINSEL` reader - P-Divider Input Selection"]
pub type PinselR = crate::BitReader<Pinsel>;
impl PinselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Pinsel {
        match self.bits {
            false => Pinsel::Value1,
            true => Pinsel::Value2,
        }
    }
    #[doc = "PLL external oscillator selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Pinsel::Value1
    }
    #[doc = "Backup clock fofi selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Pinsel::Value2
    }
}
#[doc = "Field `PINSEL` writer - P-Divider Input Selection"]
pub type PinselW<'a, REG> = crate::BitWriter<'a, REG, Pinsel>;
impl<'a, REG> PinselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "PLL external oscillator selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Pinsel::Value1)
    }
    #[doc = "Backup clock fofi selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Pinsel::Value2)
    }
}
#[doc = "K1-Divider Input Selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum K1insel {
    #[doc = "0: PLL external oscillator selected"]
    Value1 = 0,
    #[doc = "1: Backup clock fofi selected"]
    Value2 = 1,
}
impl From<K1insel> for bool {
    #[inline(always)]
    fn from(variant: K1insel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `K1INSEL` reader - K1-Divider Input Selection"]
pub type K1inselR = crate::BitReader<K1insel>;
impl K1inselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> K1insel {
        match self.bits {
            false => K1insel::Value1,
            true => K1insel::Value2,
        }
    }
    #[doc = "PLL external oscillator selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == K1insel::Value1
    }
    #[doc = "Backup clock fofi selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == K1insel::Value2
    }
}
#[doc = "Field `K1INSEL` writer - K1-Divider Input Selection"]
pub type K1inselW<'a, REG> = crate::BitWriter<'a, REG, K1insel>;
impl<'a, REG> K1inselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "PLL external oscillator selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(K1insel::Value1)
    }
    #[doc = "Backup clock fofi selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(K1insel::Value2)
    }
}
impl R {
    #[doc = "Bit 0 - P-Divider Input Selection"]
    #[inline(always)]
    pub fn pinsel(&self) -> PinselR {
        PinselR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 8 - K1-Divider Input Selection"]
    #[inline(always)]
    pub fn k1insel(&self) -> K1inselR {
        K1inselR::new(((self.bits >> 8) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - P-Divider Input Selection"]
    #[inline(always)]
    #[must_use]
    pub fn pinsel(&mut self) -> PinselW<Pllcon2Spec> {
        PinselW::new(self, 0)
    }
    #[doc = "Bit 8 - K1-Divider Input Selection"]
    #[inline(always)]
    #[must_use]
    pub fn k1insel(&mut self) -> K1inselW<Pllcon2Spec> {
        K1inselW::new(self, 8)
    }
}
#[doc = "PLL Configuration 2 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon2::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 [`pllcon2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Pllcon2Spec;
impl crate::RegisterSpec for Pllcon2Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`pllcon2::R`](R) reader structure"]
impl crate::Readable for Pllcon2Spec {}
#[doc = "`write(|w| ..)` method takes [`pllcon2::W`](W) writer structure"]
impl crate::Writable for Pllcon2Spec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets PLLCON2 to value 0x01"]
impl crate::Resettable for Pllcon2Spec {
    const RESET_VALUE: u32 = 0x01;
}