atsamd11c/sysctrl/
osculp32k.rs
1#[doc = "Register `OSCULP32K` reader"]
2pub type R = crate::R<Osculp32kSpec>;
3#[doc = "Register `OSCULP32K` writer"]
4pub type W = crate::W<Osculp32kSpec>;
5#[doc = "Field `CALIB` reader - Oscillator Calibration"]
6pub type CalibR = crate::FieldReader;
7#[doc = "Field `CALIB` writer - Oscillator Calibration"]
8pub type CalibW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `WRTLOCK` reader - Write Lock"]
10pub type WrtlockR = crate::BitReader;
11#[doc = "Field `WRTLOCK` writer - Write Lock"]
12pub type WrtlockW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bits 0:4 - Oscillator Calibration"]
15 #[inline(always)]
16 pub fn calib(&self) -> CalibR {
17 CalibR::new(self.bits & 0x1f)
18 }
19 #[doc = "Bit 7 - Write Lock"]
20 #[inline(always)]
21 pub fn wrtlock(&self) -> WrtlockR {
22 WrtlockR::new(((self.bits >> 7) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bits 0:4 - Oscillator Calibration"]
27 #[inline(always)]
28 #[must_use]
29 pub fn calib(&mut self) -> CalibW<Osculp32kSpec> {
30 CalibW::new(self, 0)
31 }
32 #[doc = "Bit 7 - Write Lock"]
33 #[inline(always)]
34 #[must_use]
35 pub fn wrtlock(&mut self) -> WrtlockW<Osculp32kSpec> {
36 WrtlockW::new(self, 7)
37 }
38}
39#[doc = "32kHz Ultra Low Power Internal Oscillator (OSCULP32K) Control\n\nYou can [`read`](crate::Reg::read) this register and get [`osculp32k::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`osculp32k::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct Osculp32kSpec;
41impl crate::RegisterSpec for Osculp32kSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`osculp32k::R`](R) reader structure"]
45impl crate::Readable for Osculp32kSpec {}
46#[doc = "`write(|w| ..)` method takes [`osculp32k::W`](W) writer structure"]
47impl crate::Writable for Osculp32kSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets OSCULP32K to value 0x1f"]
53impl crate::Resettable for Osculp32kSpec {
54 const RESET_VALUE: u8 = 0x1f;
55}