atsams70q21/afec0/
afec_chsr.rs

1#[doc = "Register `AFEC_CHSR` reader"]
2pub struct R(crate::R<AFEC_CHSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<AFEC_CHSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<AFEC_CHSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<AFEC_CHSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CH0` reader - Channel 0 Status"]
17pub struct CH0_R(crate::FieldReader<bool, bool>);
18impl CH0_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        CH0_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for CH0_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `CH1` reader - Channel 1 Status"]
32pub struct CH1_R(crate::FieldReader<bool, bool>);
33impl CH1_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        CH1_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for CH1_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `CH2` reader - Channel 2 Status"]
47pub struct CH2_R(crate::FieldReader<bool, bool>);
48impl CH2_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: bool) -> Self {
51        CH2_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for CH2_R {
55    type Target = crate::FieldReader<bool, bool>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `CH3` reader - Channel 3 Status"]
62pub struct CH3_R(crate::FieldReader<bool, bool>);
63impl CH3_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        CH3_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for CH3_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76#[doc = "Field `CH4` reader - Channel 4 Status"]
77pub struct CH4_R(crate::FieldReader<bool, bool>);
78impl CH4_R {
79    #[inline(always)]
80    pub(crate) fn new(bits: bool) -> Self {
81        CH4_R(crate::FieldReader::new(bits))
82    }
83}
84impl core::ops::Deref for CH4_R {
85    type Target = crate::FieldReader<bool, bool>;
86    #[inline(always)]
87    fn deref(&self) -> &Self::Target {
88        &self.0
89    }
90}
91#[doc = "Field `CH5` reader - Channel 5 Status"]
92pub struct CH5_R(crate::FieldReader<bool, bool>);
93impl CH5_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: bool) -> Self {
96        CH5_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for CH5_R {
100    type Target = crate::FieldReader<bool, bool>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `CH6` reader - Channel 6 Status"]
107pub struct CH6_R(crate::FieldReader<bool, bool>);
108impl CH6_R {
109    #[inline(always)]
110    pub(crate) fn new(bits: bool) -> Self {
111        CH6_R(crate::FieldReader::new(bits))
112    }
113}
114impl core::ops::Deref for CH6_R {
115    type Target = crate::FieldReader<bool, bool>;
116    #[inline(always)]
117    fn deref(&self) -> &Self::Target {
118        &self.0
119    }
120}
121#[doc = "Field `CH7` reader - Channel 7 Status"]
122pub struct CH7_R(crate::FieldReader<bool, bool>);
123impl CH7_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        CH7_R(crate::FieldReader::new(bits))
127    }
128}
129impl core::ops::Deref for CH7_R {
130    type Target = crate::FieldReader<bool, bool>;
131    #[inline(always)]
132    fn deref(&self) -> &Self::Target {
133        &self.0
134    }
135}
136#[doc = "Field `CH8` reader - Channel 8 Status"]
137pub struct CH8_R(crate::FieldReader<bool, bool>);
138impl CH8_R {
139    #[inline(always)]
140    pub(crate) fn new(bits: bool) -> Self {
141        CH8_R(crate::FieldReader::new(bits))
142    }
143}
144impl core::ops::Deref for CH8_R {
145    type Target = crate::FieldReader<bool, bool>;
146    #[inline(always)]
147    fn deref(&self) -> &Self::Target {
148        &self.0
149    }
150}
151#[doc = "Field `CH9` reader - Channel 9 Status"]
152pub struct CH9_R(crate::FieldReader<bool, bool>);
153impl CH9_R {
154    #[inline(always)]
155    pub(crate) fn new(bits: bool) -> Self {
156        CH9_R(crate::FieldReader::new(bits))
157    }
158}
159impl core::ops::Deref for CH9_R {
160    type Target = crate::FieldReader<bool, bool>;
161    #[inline(always)]
162    fn deref(&self) -> &Self::Target {
163        &self.0
164    }
165}
166#[doc = "Field `CH10` reader - Channel 10 Status"]
167pub struct CH10_R(crate::FieldReader<bool, bool>);
168impl CH10_R {
169    #[inline(always)]
170    pub(crate) fn new(bits: bool) -> Self {
171        CH10_R(crate::FieldReader::new(bits))
172    }
173}
174impl core::ops::Deref for CH10_R {
175    type Target = crate::FieldReader<bool, bool>;
176    #[inline(always)]
177    fn deref(&self) -> &Self::Target {
178        &self.0
179    }
180}
181#[doc = "Field `CH11` reader - Channel 11 Status"]
182pub struct CH11_R(crate::FieldReader<bool, bool>);
183impl CH11_R {
184    #[inline(always)]
185    pub(crate) fn new(bits: bool) -> Self {
186        CH11_R(crate::FieldReader::new(bits))
187    }
188}
189impl core::ops::Deref for CH11_R {
190    type Target = crate::FieldReader<bool, bool>;
191    #[inline(always)]
192    fn deref(&self) -> &Self::Target {
193        &self.0
194    }
195}
196impl R {
197    #[doc = "Bit 0 - Channel 0 Status"]
198    #[inline(always)]
199    pub fn ch0(&self) -> CH0_R {
200        CH0_R::new((self.bits & 0x01) != 0)
201    }
202    #[doc = "Bit 1 - Channel 1 Status"]
203    #[inline(always)]
204    pub fn ch1(&self) -> CH1_R {
205        CH1_R::new(((self.bits >> 1) & 0x01) != 0)
206    }
207    #[doc = "Bit 2 - Channel 2 Status"]
208    #[inline(always)]
209    pub fn ch2(&self) -> CH2_R {
210        CH2_R::new(((self.bits >> 2) & 0x01) != 0)
211    }
212    #[doc = "Bit 3 - Channel 3 Status"]
213    #[inline(always)]
214    pub fn ch3(&self) -> CH3_R {
215        CH3_R::new(((self.bits >> 3) & 0x01) != 0)
216    }
217    #[doc = "Bit 4 - Channel 4 Status"]
218    #[inline(always)]
219    pub fn ch4(&self) -> CH4_R {
220        CH4_R::new(((self.bits >> 4) & 0x01) != 0)
221    }
222    #[doc = "Bit 5 - Channel 5 Status"]
223    #[inline(always)]
224    pub fn ch5(&self) -> CH5_R {
225        CH5_R::new(((self.bits >> 5) & 0x01) != 0)
226    }
227    #[doc = "Bit 6 - Channel 6 Status"]
228    #[inline(always)]
229    pub fn ch6(&self) -> CH6_R {
230        CH6_R::new(((self.bits >> 6) & 0x01) != 0)
231    }
232    #[doc = "Bit 7 - Channel 7 Status"]
233    #[inline(always)]
234    pub fn ch7(&self) -> CH7_R {
235        CH7_R::new(((self.bits >> 7) & 0x01) != 0)
236    }
237    #[doc = "Bit 8 - Channel 8 Status"]
238    #[inline(always)]
239    pub fn ch8(&self) -> CH8_R {
240        CH8_R::new(((self.bits >> 8) & 0x01) != 0)
241    }
242    #[doc = "Bit 9 - Channel 9 Status"]
243    #[inline(always)]
244    pub fn ch9(&self) -> CH9_R {
245        CH9_R::new(((self.bits >> 9) & 0x01) != 0)
246    }
247    #[doc = "Bit 10 - Channel 10 Status"]
248    #[inline(always)]
249    pub fn ch10(&self) -> CH10_R {
250        CH10_R::new(((self.bits >> 10) & 0x01) != 0)
251    }
252    #[doc = "Bit 11 - Channel 11 Status"]
253    #[inline(always)]
254    pub fn ch11(&self) -> CH11_R {
255        CH11_R::new(((self.bits >> 11) & 0x01) != 0)
256    }
257}
258#[doc = "AFEC Channel Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [afec_chsr](index.html) module"]
259pub struct AFEC_CHSR_SPEC;
260impl crate::RegisterSpec for AFEC_CHSR_SPEC {
261    type Ux = u32;
262}
263#[doc = "`read()` method returns [afec_chsr::R](R) reader structure"]
264impl crate::Readable for AFEC_CHSR_SPEC {
265    type Reader = R;
266}
267#[doc = "`reset()` method sets AFEC_CHSR to value 0"]
268impl crate::Resettable for AFEC_CHSR_SPEC {
269    #[inline(always)]
270    fn reset_value() -> Self::Ux {
271        0
272    }
273}