atsam3n00b/pmc/
ckgr_pllar.rs

1#[doc = "Register `CKGR_PLLAR` reader"]
2pub type R = crate::R<CkgrPllarSpec>;
3#[doc = "Register `CKGR_PLLAR` writer"]
4pub type W = crate::W<CkgrPllarSpec>;
5#[doc = "Field `DIVA` reader - Divider"]
6pub type DivaR = crate::FieldReader;
7#[doc = "Field `DIVA` writer - Divider"]
8pub type DivaW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `PLLACOUNT` reader - PLLA Counter"]
10pub type PllacountR = crate::FieldReader;
11#[doc = "Field `PLLACOUNT` writer - PLLA Counter"]
12pub type PllacountW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13#[doc = "Field `MULA` reader - PLLA Multiplier"]
14pub type MulaR = crate::FieldReader<u16>;
15#[doc = "Field `MULA` writer - PLLA Multiplier"]
16pub type MulaW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
17#[doc = "Field `ONE` reader - Must Be Set to 1"]
18pub type OneR = crate::BitReader;
19#[doc = "Field `ONE` writer - Must Be Set to 1"]
20pub type OneW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 0:7 - Divider"]
23    #[inline(always)]
24    pub fn diva(&self) -> DivaR {
25        DivaR::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:13 - PLLA Counter"]
28    #[inline(always)]
29    pub fn pllacount(&self) -> PllacountR {
30        PllacountR::new(((self.bits >> 8) & 0x3f) as u8)
31    }
32    #[doc = "Bits 16:26 - PLLA Multiplier"]
33    #[inline(always)]
34    pub fn mula(&self) -> MulaR {
35        MulaR::new(((self.bits >> 16) & 0x07ff) as u16)
36    }
37    #[doc = "Bit 29 - Must Be Set to 1"]
38    #[inline(always)]
39    pub fn one(&self) -> OneR {
40        OneR::new(((self.bits >> 29) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bits 0:7 - Divider"]
45    #[inline(always)]
46    #[must_use]
47    pub fn diva(&mut self) -> DivaW<CkgrPllarSpec> {
48        DivaW::new(self, 0)
49    }
50    #[doc = "Bits 8:13 - PLLA Counter"]
51    #[inline(always)]
52    #[must_use]
53    pub fn pllacount(&mut self) -> PllacountW<CkgrPllarSpec> {
54        PllacountW::new(self, 8)
55    }
56    #[doc = "Bits 16:26 - PLLA Multiplier"]
57    #[inline(always)]
58    #[must_use]
59    pub fn mula(&mut self) -> MulaW<CkgrPllarSpec> {
60        MulaW::new(self, 16)
61    }
62    #[doc = "Bit 29 - Must Be Set to 1"]
63    #[inline(always)]
64    #[must_use]
65    pub fn one(&mut self) -> OneW<CkgrPllarSpec> {
66        OneW::new(self, 29)
67    }
68}
69#[doc = "PLLA Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ckgr_pllar::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 [`ckgr_pllar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct CkgrPllarSpec;
71impl crate::RegisterSpec for CkgrPllarSpec {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`ckgr_pllar::R`](R) reader structure"]
75impl crate::Readable for CkgrPllarSpec {}
76#[doc = "`write(|w| ..)` method takes [`ckgr_pllar::W`](W) writer structure"]
77impl crate::Writable for CkgrPllarSpec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81}
82#[doc = "`reset()` method sets CKGR_PLLAR to value 0x3f00"]
83impl crate::Resettable for CkgrPllarSpec {
84    const RESET_VALUE: u32 = 0x3f00;
85}