atsaml21e16b/tcc0/
patt.rs

1#[doc = "Register `PATT` reader"]
2pub struct R(crate::R<PATT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PATT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PATT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PATT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PATT` writer"]
17pub struct W(crate::W<PATT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PATT_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<PATT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PATT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PGE0` reader - Pattern Generator 0 Output Enable"]
38pub type PGE0_R = crate::BitReader<bool>;
39#[doc = "Field `PGE0` writer - Pattern Generator 0 Output Enable"]
40pub type PGE0_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
41#[doc = "Field `PGE1` reader - Pattern Generator 1 Output Enable"]
42pub type PGE1_R = crate::BitReader<bool>;
43#[doc = "Field `PGE1` writer - Pattern Generator 1 Output Enable"]
44pub type PGE1_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
45#[doc = "Field `PGE2` reader - Pattern Generator 2 Output Enable"]
46pub type PGE2_R = crate::BitReader<bool>;
47#[doc = "Field `PGE2` writer - Pattern Generator 2 Output Enable"]
48pub type PGE2_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
49#[doc = "Field `PGE3` reader - Pattern Generator 3 Output Enable"]
50pub type PGE3_R = crate::BitReader<bool>;
51#[doc = "Field `PGE3` writer - Pattern Generator 3 Output Enable"]
52pub type PGE3_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
53#[doc = "Field `PGE4` reader - Pattern Generator 4 Output Enable"]
54pub type PGE4_R = crate::BitReader<bool>;
55#[doc = "Field `PGE4` writer - Pattern Generator 4 Output Enable"]
56pub type PGE4_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
57#[doc = "Field `PGE5` reader - Pattern Generator 5 Output Enable"]
58pub type PGE5_R = crate::BitReader<bool>;
59#[doc = "Field `PGE5` writer - Pattern Generator 5 Output Enable"]
60pub type PGE5_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
61#[doc = "Field `PGE6` reader - Pattern Generator 6 Output Enable"]
62pub type PGE6_R = crate::BitReader<bool>;
63#[doc = "Field `PGE6` writer - Pattern Generator 6 Output Enable"]
64pub type PGE6_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
65#[doc = "Field `PGE7` reader - Pattern Generator 7 Output Enable"]
66pub type PGE7_R = crate::BitReader<bool>;
67#[doc = "Field `PGE7` writer - Pattern Generator 7 Output Enable"]
68pub type PGE7_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
69#[doc = "Field `PGV0` reader - Pattern Generator 0 Output Value"]
70pub type PGV0_R = crate::BitReader<bool>;
71#[doc = "Field `PGV0` writer - Pattern Generator 0 Output Value"]
72pub type PGV0_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
73#[doc = "Field `PGV1` reader - Pattern Generator 1 Output Value"]
74pub type PGV1_R = crate::BitReader<bool>;
75#[doc = "Field `PGV1` writer - Pattern Generator 1 Output Value"]
76pub type PGV1_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
77#[doc = "Field `PGV2` reader - Pattern Generator 2 Output Value"]
78pub type PGV2_R = crate::BitReader<bool>;
79#[doc = "Field `PGV2` writer - Pattern Generator 2 Output Value"]
80pub type PGV2_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
81#[doc = "Field `PGV3` reader - Pattern Generator 3 Output Value"]
82pub type PGV3_R = crate::BitReader<bool>;
83#[doc = "Field `PGV3` writer - Pattern Generator 3 Output Value"]
84pub type PGV3_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
85#[doc = "Field `PGV4` reader - Pattern Generator 4 Output Value"]
86pub type PGV4_R = crate::BitReader<bool>;
87#[doc = "Field `PGV4` writer - Pattern Generator 4 Output Value"]
88pub type PGV4_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
89#[doc = "Field `PGV5` reader - Pattern Generator 5 Output Value"]
90pub type PGV5_R = crate::BitReader<bool>;
91#[doc = "Field `PGV5` writer - Pattern Generator 5 Output Value"]
92pub type PGV5_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
93#[doc = "Field `PGV6` reader - Pattern Generator 6 Output Value"]
94pub type PGV6_R = crate::BitReader<bool>;
95#[doc = "Field `PGV6` writer - Pattern Generator 6 Output Value"]
96pub type PGV6_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
97#[doc = "Field `PGV7` reader - Pattern Generator 7 Output Value"]
98pub type PGV7_R = crate::BitReader<bool>;
99#[doc = "Field `PGV7` writer - Pattern Generator 7 Output Value"]
100pub type PGV7_W<'a, const O: u8> = crate::BitWriter<'a, u16, PATT_SPEC, bool, O>;
101impl R {
102    #[doc = "Bit 0 - Pattern Generator 0 Output Enable"]
103    #[inline(always)]
104    pub fn pge0(&self) -> PGE0_R {
105        PGE0_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - Pattern Generator 1 Output Enable"]
108    #[inline(always)]
109    pub fn pge1(&self) -> PGE1_R {
110        PGE1_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - Pattern Generator 2 Output Enable"]
113    #[inline(always)]
114    pub fn pge2(&self) -> PGE2_R {
115        PGE2_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - Pattern Generator 3 Output Enable"]
118    #[inline(always)]
119    pub fn pge3(&self) -> PGE3_R {
120        PGE3_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - Pattern Generator 4 Output Enable"]
123    #[inline(always)]
124    pub fn pge4(&self) -> PGE4_R {
125        PGE4_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 5 - Pattern Generator 5 Output Enable"]
128    #[inline(always)]
129    pub fn pge5(&self) -> PGE5_R {
130        PGE5_R::new(((self.bits >> 5) & 1) != 0)
131    }
132    #[doc = "Bit 6 - Pattern Generator 6 Output Enable"]
133    #[inline(always)]
134    pub fn pge6(&self) -> PGE6_R {
135        PGE6_R::new(((self.bits >> 6) & 1) != 0)
136    }
137    #[doc = "Bit 7 - Pattern Generator 7 Output Enable"]
138    #[inline(always)]
139    pub fn pge7(&self) -> PGE7_R {
140        PGE7_R::new(((self.bits >> 7) & 1) != 0)
141    }
142    #[doc = "Bit 8 - Pattern Generator 0 Output Value"]
143    #[inline(always)]
144    pub fn pgv0(&self) -> PGV0_R {
145        PGV0_R::new(((self.bits >> 8) & 1) != 0)
146    }
147    #[doc = "Bit 9 - Pattern Generator 1 Output Value"]
148    #[inline(always)]
149    pub fn pgv1(&self) -> PGV1_R {
150        PGV1_R::new(((self.bits >> 9) & 1) != 0)
151    }
152    #[doc = "Bit 10 - Pattern Generator 2 Output Value"]
153    #[inline(always)]
154    pub fn pgv2(&self) -> PGV2_R {
155        PGV2_R::new(((self.bits >> 10) & 1) != 0)
156    }
157    #[doc = "Bit 11 - Pattern Generator 3 Output Value"]
158    #[inline(always)]
159    pub fn pgv3(&self) -> PGV3_R {
160        PGV3_R::new(((self.bits >> 11) & 1) != 0)
161    }
162    #[doc = "Bit 12 - Pattern Generator 4 Output Value"]
163    #[inline(always)]
164    pub fn pgv4(&self) -> PGV4_R {
165        PGV4_R::new(((self.bits >> 12) & 1) != 0)
166    }
167    #[doc = "Bit 13 - Pattern Generator 5 Output Value"]
168    #[inline(always)]
169    pub fn pgv5(&self) -> PGV5_R {
170        PGV5_R::new(((self.bits >> 13) & 1) != 0)
171    }
172    #[doc = "Bit 14 - Pattern Generator 6 Output Value"]
173    #[inline(always)]
174    pub fn pgv6(&self) -> PGV6_R {
175        PGV6_R::new(((self.bits >> 14) & 1) != 0)
176    }
177    #[doc = "Bit 15 - Pattern Generator 7 Output Value"]
178    #[inline(always)]
179    pub fn pgv7(&self) -> PGV7_R {
180        PGV7_R::new(((self.bits >> 15) & 1) != 0)
181    }
182}
183impl W {
184    #[doc = "Bit 0 - Pattern Generator 0 Output Enable"]
185    #[inline(always)]
186    #[must_use]
187    pub fn pge0(&mut self) -> PGE0_W<0> {
188        PGE0_W::new(self)
189    }
190    #[doc = "Bit 1 - Pattern Generator 1 Output Enable"]
191    #[inline(always)]
192    #[must_use]
193    pub fn pge1(&mut self) -> PGE1_W<1> {
194        PGE1_W::new(self)
195    }
196    #[doc = "Bit 2 - Pattern Generator 2 Output Enable"]
197    #[inline(always)]
198    #[must_use]
199    pub fn pge2(&mut self) -> PGE2_W<2> {
200        PGE2_W::new(self)
201    }
202    #[doc = "Bit 3 - Pattern Generator 3 Output Enable"]
203    #[inline(always)]
204    #[must_use]
205    pub fn pge3(&mut self) -> PGE3_W<3> {
206        PGE3_W::new(self)
207    }
208    #[doc = "Bit 4 - Pattern Generator 4 Output Enable"]
209    #[inline(always)]
210    #[must_use]
211    pub fn pge4(&mut self) -> PGE4_W<4> {
212        PGE4_W::new(self)
213    }
214    #[doc = "Bit 5 - Pattern Generator 5 Output Enable"]
215    #[inline(always)]
216    #[must_use]
217    pub fn pge5(&mut self) -> PGE5_W<5> {
218        PGE5_W::new(self)
219    }
220    #[doc = "Bit 6 - Pattern Generator 6 Output Enable"]
221    #[inline(always)]
222    #[must_use]
223    pub fn pge6(&mut self) -> PGE6_W<6> {
224        PGE6_W::new(self)
225    }
226    #[doc = "Bit 7 - Pattern Generator 7 Output Enable"]
227    #[inline(always)]
228    #[must_use]
229    pub fn pge7(&mut self) -> PGE7_W<7> {
230        PGE7_W::new(self)
231    }
232    #[doc = "Bit 8 - Pattern Generator 0 Output Value"]
233    #[inline(always)]
234    #[must_use]
235    pub fn pgv0(&mut self) -> PGV0_W<8> {
236        PGV0_W::new(self)
237    }
238    #[doc = "Bit 9 - Pattern Generator 1 Output Value"]
239    #[inline(always)]
240    #[must_use]
241    pub fn pgv1(&mut self) -> PGV1_W<9> {
242        PGV1_W::new(self)
243    }
244    #[doc = "Bit 10 - Pattern Generator 2 Output Value"]
245    #[inline(always)]
246    #[must_use]
247    pub fn pgv2(&mut self) -> PGV2_W<10> {
248        PGV2_W::new(self)
249    }
250    #[doc = "Bit 11 - Pattern Generator 3 Output Value"]
251    #[inline(always)]
252    #[must_use]
253    pub fn pgv3(&mut self) -> PGV3_W<11> {
254        PGV3_W::new(self)
255    }
256    #[doc = "Bit 12 - Pattern Generator 4 Output Value"]
257    #[inline(always)]
258    #[must_use]
259    pub fn pgv4(&mut self) -> PGV4_W<12> {
260        PGV4_W::new(self)
261    }
262    #[doc = "Bit 13 - Pattern Generator 5 Output Value"]
263    #[inline(always)]
264    #[must_use]
265    pub fn pgv5(&mut self) -> PGV5_W<13> {
266        PGV5_W::new(self)
267    }
268    #[doc = "Bit 14 - Pattern Generator 6 Output Value"]
269    #[inline(always)]
270    #[must_use]
271    pub fn pgv6(&mut self) -> PGV6_W<14> {
272        PGV6_W::new(self)
273    }
274    #[doc = "Bit 15 - Pattern Generator 7 Output Value"]
275    #[inline(always)]
276    #[must_use]
277    pub fn pgv7(&mut self) -> PGV7_W<15> {
278        PGV7_W::new(self)
279    }
280    #[doc = "Writes raw bits to the register."]
281    #[inline(always)]
282    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
283        self.0.bits(bits);
284        self
285    }
286}
287#[doc = "Pattern\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 [patt](index.html) module"]
288pub struct PATT_SPEC;
289impl crate::RegisterSpec for PATT_SPEC {
290    type Ux = u16;
291}
292#[doc = "`read()` method returns [patt::R](R) reader structure"]
293impl crate::Readable for PATT_SPEC {
294    type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [patt::W](W) writer structure"]
297impl crate::Writable for PATT_SPEC {
298    type Writer = W;
299    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
300    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
301}
302#[doc = "`reset()` method sets PATT to value 0"]
303impl crate::Resettable for PATT_SPEC {
304    const RESET_VALUE: Self::Ux = 0;
305}