atsamd51j/osc32kctrl/
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 `EN32K` reader - Enable Out 32k"]
6pub type En32kR = crate::BitReader;
7#[doc = "Field `EN32K` writer - Enable Out 32k"]
8pub type En32kW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `EN1K` reader - Enable Out 1k"]
10pub type En1kR = crate::BitReader;
11#[doc = "Field `EN1K` writer - Enable Out 1k"]
12pub type En1kW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WRTLOCK` reader - Write Lock"]
14pub type WrtlockR = crate::BitReader;
15#[doc = "Field `WRTLOCK` writer - Write Lock"]
16pub type WrtlockW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 1 - Enable Out 32k"]
19    #[inline(always)]
20    pub fn en32k(&self) -> En32kR {
21        En32kR::new(((self.bits >> 1) & 1) != 0)
22    }
23    #[doc = "Bit 2 - Enable Out 1k"]
24    #[inline(always)]
25    pub fn en1k(&self) -> En1kR {
26        En1kR::new(((self.bits >> 2) & 1) != 0)
27    }
28    #[doc = "Bit 15 - Write Lock"]
29    #[inline(always)]
30    pub fn wrtlock(&self) -> WrtlockR {
31        WrtlockR::new(((self.bits >> 15) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bit 1 - Enable Out 32k"]
36    #[inline(always)]
37    #[must_use]
38    pub fn en32k(&mut self) -> En32kW<Osculp32kSpec> {
39        En32kW::new(self, 1)
40    }
41    #[doc = "Bit 2 - Enable Out 1k"]
42    #[inline(always)]
43    #[must_use]
44    pub fn en1k(&mut self) -> En1kW<Osculp32kSpec> {
45        En1kW::new(self, 2)
46    }
47    #[doc = "Bit 15 - Write Lock"]
48    #[inline(always)]
49    #[must_use]
50    pub fn wrtlock(&mut self) -> WrtlockW<Osculp32kSpec> {
51        WrtlockW::new(self, 15)
52    }
53}
54#[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)."]
55pub struct Osculp32kSpec;
56impl crate::RegisterSpec for Osculp32kSpec {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`osculp32k::R`](R) reader structure"]
60impl crate::Readable for Osculp32kSpec {}
61#[doc = "`write(|w| ..)` method takes [`osculp32k::W`](W) writer structure"]
62impl crate::Writable for Osculp32kSpec {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets OSCULP32K to value 0"]
68impl crate::Resettable for Osculp32kSpec {
69    const RESET_VALUE: u32 = 0;
70}