atsamd21j/pm/
apbamask.rs
1#[doc = "Register `APBAMASK` reader"]
2pub type R = crate::R<ApbamaskSpec>;
3#[doc = "Register `APBAMASK` writer"]
4pub type W = crate::W<ApbamaskSpec>;
5#[doc = "Field `PAC0_` reader - PAC0 APB Clock Enable"]
6pub type Pac0_R = crate::BitReader;
7#[doc = "Field `PAC0_` writer - PAC0 APB Clock Enable"]
8pub type Pac0_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `PM_` reader - PM APB Clock Enable"]
10pub type Pm_R = crate::BitReader;
11#[doc = "Field `PM_` writer - PM APB Clock Enable"]
12pub type Pm_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SYSCTRL_` reader - SYSCTRL APB Clock Enable"]
14pub type Sysctrl_R = crate::BitReader;
15#[doc = "Field `SYSCTRL_` writer - SYSCTRL APB Clock Enable"]
16pub type Sysctrl_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `GCLK_` reader - GCLK APB Clock Enable"]
18pub type Gclk_R = crate::BitReader;
19#[doc = "Field `GCLK_` writer - GCLK APB Clock Enable"]
20pub type Gclk_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `WDT_` reader - WDT APB Clock Enable"]
22pub type Wdt_R = crate::BitReader;
23#[doc = "Field `WDT_` writer - WDT APB Clock Enable"]
24pub type Wdt_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `RTC_` reader - RTC APB Clock Enable"]
26pub type Rtc_R = crate::BitReader;
27#[doc = "Field `RTC_` writer - RTC APB Clock Enable"]
28pub type Rtc_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `EIC_` reader - EIC APB Clock Enable"]
30pub type Eic_R = crate::BitReader;
31#[doc = "Field `EIC_` writer - EIC APB Clock Enable"]
32pub type Eic_W<'a, REG> = crate::BitWriter<'a, REG>;
33impl R {
34 #[doc = "Bit 0 - PAC0 APB Clock Enable"]
35 #[inline(always)]
36 pub fn pac0_(&self) -> Pac0_R {
37 Pac0_R::new((self.bits & 1) != 0)
38 }
39 #[doc = "Bit 1 - PM APB Clock Enable"]
40 #[inline(always)]
41 pub fn pm_(&self) -> Pm_R {
42 Pm_R::new(((self.bits >> 1) & 1) != 0)
43 }
44 #[doc = "Bit 2 - SYSCTRL APB Clock Enable"]
45 #[inline(always)]
46 pub fn sysctrl_(&self) -> Sysctrl_R {
47 Sysctrl_R::new(((self.bits >> 2) & 1) != 0)
48 }
49 #[doc = "Bit 3 - GCLK APB Clock Enable"]
50 #[inline(always)]
51 pub fn gclk_(&self) -> Gclk_R {
52 Gclk_R::new(((self.bits >> 3) & 1) != 0)
53 }
54 #[doc = "Bit 4 - WDT APB Clock Enable"]
55 #[inline(always)]
56 pub fn wdt_(&self) -> Wdt_R {
57 Wdt_R::new(((self.bits >> 4) & 1) != 0)
58 }
59 #[doc = "Bit 5 - RTC APB Clock Enable"]
60 #[inline(always)]
61 pub fn rtc_(&self) -> Rtc_R {
62 Rtc_R::new(((self.bits >> 5) & 1) != 0)
63 }
64 #[doc = "Bit 6 - EIC APB Clock Enable"]
65 #[inline(always)]
66 pub fn eic_(&self) -> Eic_R {
67 Eic_R::new(((self.bits >> 6) & 1) != 0)
68 }
69}
70impl W {
71 #[doc = "Bit 0 - PAC0 APB Clock Enable"]
72 #[inline(always)]
73 #[must_use]
74 pub fn pac0_(&mut self) -> Pac0_W<ApbamaskSpec> {
75 Pac0_W::new(self, 0)
76 }
77 #[doc = "Bit 1 - PM APB Clock Enable"]
78 #[inline(always)]
79 #[must_use]
80 pub fn pm_(&mut self) -> Pm_W<ApbamaskSpec> {
81 Pm_W::new(self, 1)
82 }
83 #[doc = "Bit 2 - SYSCTRL APB Clock Enable"]
84 #[inline(always)]
85 #[must_use]
86 pub fn sysctrl_(&mut self) -> Sysctrl_W<ApbamaskSpec> {
87 Sysctrl_W::new(self, 2)
88 }
89 #[doc = "Bit 3 - GCLK APB Clock Enable"]
90 #[inline(always)]
91 #[must_use]
92 pub fn gclk_(&mut self) -> Gclk_W<ApbamaskSpec> {
93 Gclk_W::new(self, 3)
94 }
95 #[doc = "Bit 4 - WDT APB Clock Enable"]
96 #[inline(always)]
97 #[must_use]
98 pub fn wdt_(&mut self) -> Wdt_W<ApbamaskSpec> {
99 Wdt_W::new(self, 4)
100 }
101 #[doc = "Bit 5 - RTC APB Clock Enable"]
102 #[inline(always)]
103 #[must_use]
104 pub fn rtc_(&mut self) -> Rtc_W<ApbamaskSpec> {
105 Rtc_W::new(self, 5)
106 }
107 #[doc = "Bit 6 - EIC APB Clock Enable"]
108 #[inline(always)]
109 #[must_use]
110 pub fn eic_(&mut self) -> Eic_W<ApbamaskSpec> {
111 Eic_W::new(self, 6)
112 }
113}
114#[doc = "APBA Mask\n\nYou can [`read`](crate::Reg::read) this register and get [`apbamask::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`apbamask::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
115pub struct ApbamaskSpec;
116impl crate::RegisterSpec for ApbamaskSpec {
117 type Ux = u32;
118}
119#[doc = "`read()` method returns [`apbamask::R`](R) reader structure"]
120impl crate::Readable for ApbamaskSpec {}
121#[doc = "`write(|w| ..)` method takes [`apbamask::W`](W) writer structure"]
122impl crate::Writable for ApbamaskSpec {
123 type Safety = crate::Unsafe;
124 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
125 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
126}
127#[doc = "`reset()` method sets APBAMASK to value 0x7f"]
128impl crate::Resettable for ApbamaskSpec {
129 const RESET_VALUE: u32 = 0x7f;
130}