swm341_pac/sys/
clken1.rs

1#[doc = "Register `CLKEN1` reader"]
2pub struct R(crate::R<CLKEN1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CLKEN1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CLKEN1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CLKEN1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CLKEN1` writer"]
17pub struct W(crate::W<CLKEN1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CLKEN1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CLKEN1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CLKEN1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `GPIOE` reader - GPIOE field"]
38pub type GPIOE_R = crate::BitReader<bool>;
39#[doc = "Field `GPIOE` writer - GPIOE field"]
40pub type GPIOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
41#[doc = "Field `SPI2` reader - SPI2 field"]
42pub type SPI2_R = crate::BitReader<bool>;
43#[doc = "Field `SPI2` writer - SPI2 field"]
44pub type SPI2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
45#[doc = "Field `SDRAM` reader - SDRAM field"]
46pub type SDRAM_R = crate::BitReader<bool>;
47#[doc = "Field `SDRAM` writer - SDRAM field"]
48pub type SDRAM_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
49#[doc = "Field `SFC` reader - SFC field"]
50pub type SFC_R = crate::BitReader<bool>;
51#[doc = "Field `SFC` writer - SFC field"]
52pub type SFC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
53#[doc = "Field `ADC1` reader - ADC1 field"]
54pub type ADC1_R = crate::BitReader<bool>;
55#[doc = "Field `ADC1` writer - ADC1 field"]
56pub type ADC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
57#[doc = "Field `CAN1` reader - CAN1 field"]
58pub type CAN1_R = crate::BitReader<bool>;
59#[doc = "Field `CAN1` writer - CAN1 field"]
60pub type CAN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
61#[doc = "Field `RTC` reader - RTC field"]
62pub type RTC_R = crate::BitReader<bool>;
63#[doc = "Field `RTC` writer - RTC field"]
64pub type RTC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
65#[doc = "Field `IOFILT` reader - IOFILT field"]
66pub type IOFILT_R = crate::BitReader<bool>;
67#[doc = "Field `IOFILT` writer - IOFILT field"]
68pub type IOFILT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
69#[doc = "Field `BTIMR` reader - BTIMR field"]
70pub type BTIMR_R = crate::BitReader<bool>;
71#[doc = "Field `BTIMR` writer - BTIMR field"]
72pub type BTIMR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
73#[doc = "Field `JPEG` reader - JPEG field"]
74pub type JPEG_R = crate::BitReader<bool>;
75#[doc = "Field `JPEG` writer - JPEG field"]
76pub type JPEG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
77#[doc = "Field `DAC` reader - DAC field"]
78pub type DAC_R = crate::BitReader<bool>;
79#[doc = "Field `DAC` writer - DAC field"]
80pub type DAC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
81#[doc = "Field `QEI` reader - QEI field"]
82pub type QEI_R = crate::BitReader<bool>;
83#[doc = "Field `QEI` writer - QEI field"]
84pub type QEI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKEN1_SPEC, bool, O>;
85impl R {
86    #[doc = "Bit 0 - GPIOE field"]
87    #[inline(always)]
88    pub fn gpioe(&self) -> GPIOE_R {
89        GPIOE_R::new((self.bits & 1) != 0)
90    }
91    #[doc = "Bit 8 - SPI2 field"]
92    #[inline(always)]
93    pub fn spi2(&self) -> SPI2_R {
94        SPI2_R::new(((self.bits >> 8) & 1) != 0)
95    }
96    #[doc = "Bit 12 - SDRAM field"]
97    #[inline(always)]
98    pub fn sdram(&self) -> SDRAM_R {
99        SDRAM_R::new(((self.bits >> 12) & 1) != 0)
100    }
101    #[doc = "Bit 13 - SFC field"]
102    #[inline(always)]
103    pub fn sfc(&self) -> SFC_R {
104        SFC_R::new(((self.bits >> 13) & 1) != 0)
105    }
106    #[doc = "Bit 16 - ADC1 field"]
107    #[inline(always)]
108    pub fn adc1(&self) -> ADC1_R {
109        ADC1_R::new(((self.bits >> 16) & 1) != 0)
110    }
111    #[doc = "Bit 17 - CAN1 field"]
112    #[inline(always)]
113    pub fn can1(&self) -> CAN1_R {
114        CAN1_R::new(((self.bits >> 17) & 1) != 0)
115    }
116    #[doc = "Bit 19 - RTC field"]
117    #[inline(always)]
118    pub fn rtc(&self) -> RTC_R {
119        RTC_R::new(((self.bits >> 19) & 1) != 0)
120    }
121    #[doc = "Bit 20 - IOFILT field"]
122    #[inline(always)]
123    pub fn iofilt(&self) -> IOFILT_R {
124        IOFILT_R::new(((self.bits >> 20) & 1) != 0)
125    }
126    #[doc = "Bit 22 - BTIMR field"]
127    #[inline(always)]
128    pub fn btimr(&self) -> BTIMR_R {
129        BTIMR_R::new(((self.bits >> 22) & 1) != 0)
130    }
131    #[doc = "Bit 25 - JPEG field"]
132    #[inline(always)]
133    pub fn jpeg(&self) -> JPEG_R {
134        JPEG_R::new(((self.bits >> 25) & 1) != 0)
135    }
136    #[doc = "Bit 26 - DAC field"]
137    #[inline(always)]
138    pub fn dac(&self) -> DAC_R {
139        DAC_R::new(((self.bits >> 26) & 1) != 0)
140    }
141    #[doc = "Bit 27 - QEI field"]
142    #[inline(always)]
143    pub fn qei(&self) -> QEI_R {
144        QEI_R::new(((self.bits >> 27) & 1) != 0)
145    }
146}
147impl W {
148    #[doc = "Bit 0 - GPIOE field"]
149    #[inline(always)]
150    pub fn gpioe(&mut self) -> GPIOE_W<0> {
151        GPIOE_W::new(self)
152    }
153    #[doc = "Bit 8 - SPI2 field"]
154    #[inline(always)]
155    pub fn spi2(&mut self) -> SPI2_W<8> {
156        SPI2_W::new(self)
157    }
158    #[doc = "Bit 12 - SDRAM field"]
159    #[inline(always)]
160    pub fn sdram(&mut self) -> SDRAM_W<12> {
161        SDRAM_W::new(self)
162    }
163    #[doc = "Bit 13 - SFC field"]
164    #[inline(always)]
165    pub fn sfc(&mut self) -> SFC_W<13> {
166        SFC_W::new(self)
167    }
168    #[doc = "Bit 16 - ADC1 field"]
169    #[inline(always)]
170    pub fn adc1(&mut self) -> ADC1_W<16> {
171        ADC1_W::new(self)
172    }
173    #[doc = "Bit 17 - CAN1 field"]
174    #[inline(always)]
175    pub fn can1(&mut self) -> CAN1_W<17> {
176        CAN1_W::new(self)
177    }
178    #[doc = "Bit 19 - RTC field"]
179    #[inline(always)]
180    pub fn rtc(&mut self) -> RTC_W<19> {
181        RTC_W::new(self)
182    }
183    #[doc = "Bit 20 - IOFILT field"]
184    #[inline(always)]
185    pub fn iofilt(&mut self) -> IOFILT_W<20> {
186        IOFILT_W::new(self)
187    }
188    #[doc = "Bit 22 - BTIMR field"]
189    #[inline(always)]
190    pub fn btimr(&mut self) -> BTIMR_W<22> {
191        BTIMR_W::new(self)
192    }
193    #[doc = "Bit 25 - JPEG field"]
194    #[inline(always)]
195    pub fn jpeg(&mut self) -> JPEG_W<25> {
196        JPEG_W::new(self)
197    }
198    #[doc = "Bit 26 - DAC field"]
199    #[inline(always)]
200    pub fn dac(&mut self) -> DAC_W<26> {
201        DAC_W::new(self)
202    }
203    #[doc = "Bit 27 - QEI field"]
204    #[inline(always)]
205    pub fn qei(&mut self) -> QEI_W<27> {
206        QEI_W::new(self)
207    }
208    #[doc = "Writes raw bits to the register."]
209    #[inline(always)]
210    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
211        self.0.bits(bits);
212        self
213    }
214}
215#[doc = "CLKEN1 register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clken1](index.html) module"]
216pub struct CLKEN1_SPEC;
217impl crate::RegisterSpec for CLKEN1_SPEC {
218    type Ux = u32;
219}
220#[doc = "`read()` method returns [clken1::R](R) reader structure"]
221impl crate::Readable for CLKEN1_SPEC {
222    type Reader = R;
223}
224#[doc = "`write(|w| ..)` method takes [clken1::W](W) writer structure"]
225impl crate::Writable for CLKEN1_SPEC {
226    type Writer = W;
227}
228#[doc = "`reset()` method sets CLKEN1 to value 0"]
229impl crate::Resettable for CLKEN1_SPEC {
230    #[inline(always)]
231    fn reset_value() -> Self::Ux {
232        0
233    }
234}