saml10d16a/mclk/
ahbmask.rs

1#[doc = "Reader of register AHBMASK"]
2pub type R = crate::R<u32, super::AHBMASK>;
3#[doc = "Writer for register AHBMASK"]
4pub type W = crate::W<u32, super::AHBMASK>;
5#[doc = "Register AHBMASK `reset()`'s with value 0x1fff"]
6impl crate::ResetValue for super::AHBMASK {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x1fff
11    }
12}
13#[doc = "Reader of field `HPB0_`"]
14pub type HPB0__R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `HPB0_`"]
16pub struct HPB0__W<'a> {
17    w: &'a mut W,
18}
19impl<'a> HPB0__W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
34        self.w
35    }
36}
37#[doc = "Reader of field `HPB1_`"]
38pub type HPB1__R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `HPB1_`"]
40pub struct HPB1__W<'a> {
41    w: &'a mut W,
42}
43impl<'a> HPB1__W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
58        self.w
59    }
60}
61#[doc = "Reader of field `HPB2_`"]
62pub type HPB2__R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `HPB2_`"]
64pub struct HPB2__W<'a> {
65    w: &'a mut W,
66}
67impl<'a> HPB2__W<'a> {
68    #[doc = r"Sets the field bit"]
69    #[inline(always)]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r"Clears the field bit"]
74    #[inline(always)]
75    pub fn clear_bit(self) -> &'a mut W {
76        self.bit(false)
77    }
78    #[doc = r"Writes raw bits to the field"]
79    #[inline(always)]
80    pub fn bit(self, value: bool) -> &'a mut W {
81        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
82        self.w
83    }
84}
85#[doc = "Reader of field `DMAC_`"]
86pub type DMAC__R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `DMAC_`"]
88pub struct DMAC__W<'a> {
89    w: &'a mut W,
90}
91impl<'a> DMAC__W<'a> {
92    #[doc = r"Sets the field bit"]
93    #[inline(always)]
94    pub fn set_bit(self) -> &'a mut W {
95        self.bit(true)
96    }
97    #[doc = r"Clears the field bit"]
98    #[inline(always)]
99    pub fn clear_bit(self) -> &'a mut W {
100        self.bit(false)
101    }
102    #[doc = r"Writes raw bits to the field"]
103    #[inline(always)]
104    pub fn bit(self, value: bool) -> &'a mut W {
105        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
106        self.w
107    }
108}
109#[doc = "Reader of field `DSU_`"]
110pub type DSU__R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `DSU_`"]
112pub struct DSU__W<'a> {
113    w: &'a mut W,
114}
115impl<'a> DSU__W<'a> {
116    #[doc = r"Sets the field bit"]
117    #[inline(always)]
118    pub fn set_bit(self) -> &'a mut W {
119        self.bit(true)
120    }
121    #[doc = r"Clears the field bit"]
122    #[inline(always)]
123    pub fn clear_bit(self) -> &'a mut W {
124        self.bit(false)
125    }
126    #[doc = r"Writes raw bits to the field"]
127    #[inline(always)]
128    pub fn bit(self, value: bool) -> &'a mut W {
129        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
130        self.w
131    }
132}
133#[doc = "Reader of field `PAC_`"]
134pub type PAC__R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `PAC_`"]
136pub struct PAC__W<'a> {
137    w: &'a mut W,
138}
139impl<'a> PAC__W<'a> {
140    #[doc = r"Sets the field bit"]
141    #[inline(always)]
142    pub fn set_bit(self) -> &'a mut W {
143        self.bit(true)
144    }
145    #[doc = r"Clears the field bit"]
146    #[inline(always)]
147    pub fn clear_bit(self) -> &'a mut W {
148        self.bit(false)
149    }
150    #[doc = r"Writes raw bits to the field"]
151    #[inline(always)]
152    pub fn bit(self, value: bool) -> &'a mut W {
153        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
154        self.w
155    }
156}
157#[doc = "Reader of field `NVMCTRL_`"]
158pub type NVMCTRL__R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `NVMCTRL_`"]
160pub struct NVMCTRL__W<'a> {
161    w: &'a mut W,
162}
163impl<'a> NVMCTRL__W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
178        self.w
179    }
180}
181#[doc = "Reader of field `TRAM_`"]
182pub type TRAM__R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `TRAM_`"]
184pub struct TRAM__W<'a> {
185    w: &'a mut W,
186}
187impl<'a> TRAM__W<'a> {
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
202        self.w
203    }
204}
205impl R {
206    #[doc = "Bit 0 - HPB0 AHB Clock Mask"]
207    #[inline(always)]
208    pub fn hpb0_(&self) -> HPB0__R {
209        HPB0__R::new((self.bits & 0x01) != 0)
210    }
211    #[doc = "Bit 1 - HPB1 AHB Clock Mask"]
212    #[inline(always)]
213    pub fn hpb1_(&self) -> HPB1__R {
214        HPB1__R::new(((self.bits >> 1) & 0x01) != 0)
215    }
216    #[doc = "Bit 2 - HPB2 AHB Clock Mask"]
217    #[inline(always)]
218    pub fn hpb2_(&self) -> HPB2__R {
219        HPB2__R::new(((self.bits >> 2) & 0x01) != 0)
220    }
221    #[doc = "Bit 3 - DMAC AHB Clock Mask"]
222    #[inline(always)]
223    pub fn dmac_(&self) -> DMAC__R {
224        DMAC__R::new(((self.bits >> 3) & 0x01) != 0)
225    }
226    #[doc = "Bit 4 - DSU AHB Clock Mask"]
227    #[inline(always)]
228    pub fn dsu_(&self) -> DSU__R {
229        DSU__R::new(((self.bits >> 4) & 0x01) != 0)
230    }
231    #[doc = "Bit 6 - PAC AHB Clock Mask"]
232    #[inline(always)]
233    pub fn pac_(&self) -> PAC__R {
234        PAC__R::new(((self.bits >> 6) & 0x01) != 0)
235    }
236    #[doc = "Bit 7 - NVMCTRL AHB Clock Mask"]
237    #[inline(always)]
238    pub fn nvmctrl_(&self) -> NVMCTRL__R {
239        NVMCTRL__R::new(((self.bits >> 7) & 0x01) != 0)
240    }
241    #[doc = "Bit 12 - TRAM AHB Clock Mask"]
242    #[inline(always)]
243    pub fn tram_(&self) -> TRAM__R {
244        TRAM__R::new(((self.bits >> 12) & 0x01) != 0)
245    }
246}
247impl W {
248    #[doc = "Bit 0 - HPB0 AHB Clock Mask"]
249    #[inline(always)]
250    pub fn hpb0_(&mut self) -> HPB0__W {
251        HPB0__W { w: self }
252    }
253    #[doc = "Bit 1 - HPB1 AHB Clock Mask"]
254    #[inline(always)]
255    pub fn hpb1_(&mut self) -> HPB1__W {
256        HPB1__W { w: self }
257    }
258    #[doc = "Bit 2 - HPB2 AHB Clock Mask"]
259    #[inline(always)]
260    pub fn hpb2_(&mut self) -> HPB2__W {
261        HPB2__W { w: self }
262    }
263    #[doc = "Bit 3 - DMAC AHB Clock Mask"]
264    #[inline(always)]
265    pub fn dmac_(&mut self) -> DMAC__W {
266        DMAC__W { w: self }
267    }
268    #[doc = "Bit 4 - DSU AHB Clock Mask"]
269    #[inline(always)]
270    pub fn dsu_(&mut self) -> DSU__W {
271        DSU__W { w: self }
272    }
273    #[doc = "Bit 6 - PAC AHB Clock Mask"]
274    #[inline(always)]
275    pub fn pac_(&mut self) -> PAC__W {
276        PAC__W { w: self }
277    }
278    #[doc = "Bit 7 - NVMCTRL AHB Clock Mask"]
279    #[inline(always)]
280    pub fn nvmctrl_(&mut self) -> NVMCTRL__W {
281        NVMCTRL__W { w: self }
282    }
283    #[doc = "Bit 12 - TRAM AHB Clock Mask"]
284    #[inline(always)]
285    pub fn tram_(&mut self) -> TRAM__W {
286        TRAM__W { w: self }
287    }
288}