bl702_pac/gpip/
gpadc_config.rs

1#[doc = "Register `gpadc_config` reader"]
2pub struct R(crate::R<GPADC_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<GPADC_CONFIG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<GPADC_CONFIG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<GPADC_CONFIG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `gpadc_config` writer"]
17pub struct W(crate::W<GPADC_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<GPADC_CONFIG_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<GPADC_CONFIG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<GPADC_CONFIG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `gpadc_dma_en` reader - "]
38pub type GPADC_DMA_EN_R = crate::BitReader<bool>;
39#[doc = "Field `gpadc_dma_en` writer - "]
40pub type GPADC_DMA_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
41#[doc = "Field `gpadc_fifo_clr` reader - "]
42pub type GPADC_FIFO_CLR_R = crate::BitReader<bool>;
43#[doc = "Field `gpadc_fifo_clr` writer - "]
44pub type GPADC_FIFO_CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
45#[doc = "Field `gpadc_fifo_ne` reader - "]
46pub type GPADC_FIFO_NE_R = crate::BitReader<bool>;
47#[doc = "Field `gpadc_fifo_ne` writer - "]
48pub type GPADC_FIFO_NE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
49#[doc = "Field `gpadc_fifo_full` reader - "]
50pub type GPADC_FIFO_FULL_R = crate::BitReader<bool>;
51#[doc = "Field `gpadc_fifo_full` writer - "]
52pub type GPADC_FIFO_FULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
53#[doc = "Field `gpadc_rdy` reader - "]
54pub type GPADC_RDY_R = crate::BitReader<bool>;
55#[doc = "Field `gpadc_rdy` writer - "]
56pub type GPADC_RDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
57#[doc = "Field `gpadc_fifo_overrun` reader - "]
58pub type GPADC_FIFO_OVERRUN_R = crate::BitReader<bool>;
59#[doc = "Field `gpadc_fifo_overrun` writer - "]
60pub type GPADC_FIFO_OVERRUN_W<'a, const O: u8> =
61    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
62#[doc = "Field `gpadc_fifo_underrun` reader - "]
63pub type GPADC_FIFO_UNDERRUN_R = crate::BitReader<bool>;
64#[doc = "Field `gpadc_fifo_underrun` writer - "]
65pub type GPADC_FIFO_UNDERRUN_W<'a, const O: u8> =
66    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
67#[doc = "Field `gpadc_fifo_rdy` reader - "]
68pub type GPADC_FIFO_RDY_R = crate::BitReader<bool>;
69#[doc = "Field `gpadc_fifo_rdy` writer - "]
70pub type GPADC_FIFO_RDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
71#[doc = "Field `gpadc_rdy_clr` reader - "]
72pub type GPADC_RDY_CLR_R = crate::BitReader<bool>;
73#[doc = "Field `gpadc_rdy_clr` writer - "]
74pub type GPADC_RDY_CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
75#[doc = "Field `gpadc_fifo_overrun_clr` reader - "]
76pub type GPADC_FIFO_OVERRUN_CLR_R = crate::BitReader<bool>;
77#[doc = "Field `gpadc_fifo_overrun_clr` writer - "]
78pub type GPADC_FIFO_OVERRUN_CLR_W<'a, const O: u8> =
79    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
80#[doc = "Field `gpadc_fifo_underrun_clr` reader - "]
81pub type GPADC_FIFO_UNDERRUN_CLR_R = crate::BitReader<bool>;
82#[doc = "Field `gpadc_fifo_underrun_clr` writer - "]
83pub type GPADC_FIFO_UNDERRUN_CLR_W<'a, const O: u8> =
84    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
85#[doc = "Field `gpadc_rdy_mask` reader - "]
86pub type GPADC_RDY_MASK_R = crate::BitReader<bool>;
87#[doc = "Field `gpadc_rdy_mask` writer - "]
88pub type GPADC_RDY_MASK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
89#[doc = "Field `gpadc_fifo_overrun_mask` reader - "]
90pub type GPADC_FIFO_OVERRUN_MASK_R = crate::BitReader<bool>;
91#[doc = "Field `gpadc_fifo_overrun_mask` writer - "]
92pub type GPADC_FIFO_OVERRUN_MASK_W<'a, const O: u8> =
93    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
94#[doc = "Field `gpadc_fifo_underrun_mask` reader - "]
95pub type GPADC_FIFO_UNDERRUN_MASK_R = crate::BitReader<bool>;
96#[doc = "Field `gpadc_fifo_underrun_mask` writer - "]
97pub type GPADC_FIFO_UNDERRUN_MASK_W<'a, const O: u8> =
98    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
99#[doc = "Field `gpadc_fifo_rdy_mask` reader - "]
100pub type GPADC_FIFO_RDY_MASK_R = crate::BitReader<bool>;
101#[doc = "Field `gpadc_fifo_rdy_mask` writer - "]
102pub type GPADC_FIFO_RDY_MASK_W<'a, const O: u8> =
103    crate::BitWriter<'a, u32, GPADC_CONFIG_SPEC, bool, O>;
104#[doc = "Field `gpadc_fifo_data_count` reader - "]
105pub type GPADC_FIFO_DATA_COUNT_R = crate::FieldReader<u8, u8>;
106#[doc = "Field `gpadc_fifo_data_count` writer - "]
107pub type GPADC_FIFO_DATA_COUNT_W<'a, const O: u8> =
108    crate::FieldWriter<'a, u32, GPADC_CONFIG_SPEC, u8, u8, 6, O>;
109#[doc = "Field `gpadc_fifo_thl` reader - "]
110pub type GPADC_FIFO_THL_R = crate::FieldReader<u8, u8>;
111#[doc = "Field `gpadc_fifo_thl` writer - "]
112pub type GPADC_FIFO_THL_W<'a, const O: u8> =
113    crate::FieldWriter<'a, u32, GPADC_CONFIG_SPEC, u8, u8, 2, O>;
114#[doc = "Field `rsvd_31_24` reader - "]
115pub type RSVD_31_24_R = crate::FieldReader<u8, u8>;
116#[doc = "Field `rsvd_31_24` writer - "]
117pub type RSVD_31_24_W<'a, const O: u8> =
118    crate::FieldWriter<'a, u32, GPADC_CONFIG_SPEC, u8, u8, 8, O>;
119impl R {
120    #[doc = "Bit 0"]
121    #[inline(always)]
122    pub fn gpadc_dma_en(&self) -> GPADC_DMA_EN_R {
123        GPADC_DMA_EN_R::new((self.bits & 1) != 0)
124    }
125    #[doc = "Bit 1"]
126    #[inline(always)]
127    pub fn gpadc_fifo_clr(&self) -> GPADC_FIFO_CLR_R {
128        GPADC_FIFO_CLR_R::new(((self.bits >> 1) & 1) != 0)
129    }
130    #[doc = "Bit 2"]
131    #[inline(always)]
132    pub fn gpadc_fifo_ne(&self) -> GPADC_FIFO_NE_R {
133        GPADC_FIFO_NE_R::new(((self.bits >> 2) & 1) != 0)
134    }
135    #[doc = "Bit 3"]
136    #[inline(always)]
137    pub fn gpadc_fifo_full(&self) -> GPADC_FIFO_FULL_R {
138        GPADC_FIFO_FULL_R::new(((self.bits >> 3) & 1) != 0)
139    }
140    #[doc = "Bit 4"]
141    #[inline(always)]
142    pub fn gpadc_rdy(&self) -> GPADC_RDY_R {
143        GPADC_RDY_R::new(((self.bits >> 4) & 1) != 0)
144    }
145    #[doc = "Bit 5"]
146    #[inline(always)]
147    pub fn gpadc_fifo_overrun(&self) -> GPADC_FIFO_OVERRUN_R {
148        GPADC_FIFO_OVERRUN_R::new(((self.bits >> 5) & 1) != 0)
149    }
150    #[doc = "Bit 6"]
151    #[inline(always)]
152    pub fn gpadc_fifo_underrun(&self) -> GPADC_FIFO_UNDERRUN_R {
153        GPADC_FIFO_UNDERRUN_R::new(((self.bits >> 6) & 1) != 0)
154    }
155    #[doc = "Bit 7"]
156    #[inline(always)]
157    pub fn gpadc_fifo_rdy(&self) -> GPADC_FIFO_RDY_R {
158        GPADC_FIFO_RDY_R::new(((self.bits >> 7) & 1) != 0)
159    }
160    #[doc = "Bit 8"]
161    #[inline(always)]
162    pub fn gpadc_rdy_clr(&self) -> GPADC_RDY_CLR_R {
163        GPADC_RDY_CLR_R::new(((self.bits >> 8) & 1) != 0)
164    }
165    #[doc = "Bit 9"]
166    #[inline(always)]
167    pub fn gpadc_fifo_overrun_clr(&self) -> GPADC_FIFO_OVERRUN_CLR_R {
168        GPADC_FIFO_OVERRUN_CLR_R::new(((self.bits >> 9) & 1) != 0)
169    }
170    #[doc = "Bit 10"]
171    #[inline(always)]
172    pub fn gpadc_fifo_underrun_clr(&self) -> GPADC_FIFO_UNDERRUN_CLR_R {
173        GPADC_FIFO_UNDERRUN_CLR_R::new(((self.bits >> 10) & 1) != 0)
174    }
175    #[doc = "Bit 12"]
176    #[inline(always)]
177    pub fn gpadc_rdy_mask(&self) -> GPADC_RDY_MASK_R {
178        GPADC_RDY_MASK_R::new(((self.bits >> 12) & 1) != 0)
179    }
180    #[doc = "Bit 13"]
181    #[inline(always)]
182    pub fn gpadc_fifo_overrun_mask(&self) -> GPADC_FIFO_OVERRUN_MASK_R {
183        GPADC_FIFO_OVERRUN_MASK_R::new(((self.bits >> 13) & 1) != 0)
184    }
185    #[doc = "Bit 14"]
186    #[inline(always)]
187    pub fn gpadc_fifo_underrun_mask(&self) -> GPADC_FIFO_UNDERRUN_MASK_R {
188        GPADC_FIFO_UNDERRUN_MASK_R::new(((self.bits >> 14) & 1) != 0)
189    }
190    #[doc = "Bit 15"]
191    #[inline(always)]
192    pub fn gpadc_fifo_rdy_mask(&self) -> GPADC_FIFO_RDY_MASK_R {
193        GPADC_FIFO_RDY_MASK_R::new(((self.bits >> 15) & 1) != 0)
194    }
195    #[doc = "Bits 16:21"]
196    #[inline(always)]
197    pub fn gpadc_fifo_data_count(&self) -> GPADC_FIFO_DATA_COUNT_R {
198        GPADC_FIFO_DATA_COUNT_R::new(((self.bits >> 16) & 0x3f) as u8)
199    }
200    #[doc = "Bits 22:23"]
201    #[inline(always)]
202    pub fn gpadc_fifo_thl(&self) -> GPADC_FIFO_THL_R {
203        GPADC_FIFO_THL_R::new(((self.bits >> 22) & 3) as u8)
204    }
205    #[doc = "Bits 24:31"]
206    #[inline(always)]
207    pub fn rsvd_31_24(&self) -> RSVD_31_24_R {
208        RSVD_31_24_R::new(((self.bits >> 24) & 0xff) as u8)
209    }
210}
211impl W {
212    #[doc = "Bit 0"]
213    #[inline(always)]
214    #[must_use]
215    pub fn gpadc_dma_en(&mut self) -> GPADC_DMA_EN_W<0> {
216        GPADC_DMA_EN_W::new(self)
217    }
218    #[doc = "Bit 1"]
219    #[inline(always)]
220    #[must_use]
221    pub fn gpadc_fifo_clr(&mut self) -> GPADC_FIFO_CLR_W<1> {
222        GPADC_FIFO_CLR_W::new(self)
223    }
224    #[doc = "Bit 2"]
225    #[inline(always)]
226    #[must_use]
227    pub fn gpadc_fifo_ne(&mut self) -> GPADC_FIFO_NE_W<2> {
228        GPADC_FIFO_NE_W::new(self)
229    }
230    #[doc = "Bit 3"]
231    #[inline(always)]
232    #[must_use]
233    pub fn gpadc_fifo_full(&mut self) -> GPADC_FIFO_FULL_W<3> {
234        GPADC_FIFO_FULL_W::new(self)
235    }
236    #[doc = "Bit 4"]
237    #[inline(always)]
238    #[must_use]
239    pub fn gpadc_rdy(&mut self) -> GPADC_RDY_W<4> {
240        GPADC_RDY_W::new(self)
241    }
242    #[doc = "Bit 5"]
243    #[inline(always)]
244    #[must_use]
245    pub fn gpadc_fifo_overrun(&mut self) -> GPADC_FIFO_OVERRUN_W<5> {
246        GPADC_FIFO_OVERRUN_W::new(self)
247    }
248    #[doc = "Bit 6"]
249    #[inline(always)]
250    #[must_use]
251    pub fn gpadc_fifo_underrun(&mut self) -> GPADC_FIFO_UNDERRUN_W<6> {
252        GPADC_FIFO_UNDERRUN_W::new(self)
253    }
254    #[doc = "Bit 7"]
255    #[inline(always)]
256    #[must_use]
257    pub fn gpadc_fifo_rdy(&mut self) -> GPADC_FIFO_RDY_W<7> {
258        GPADC_FIFO_RDY_W::new(self)
259    }
260    #[doc = "Bit 8"]
261    #[inline(always)]
262    #[must_use]
263    pub fn gpadc_rdy_clr(&mut self) -> GPADC_RDY_CLR_W<8> {
264        GPADC_RDY_CLR_W::new(self)
265    }
266    #[doc = "Bit 9"]
267    #[inline(always)]
268    #[must_use]
269    pub fn gpadc_fifo_overrun_clr(&mut self) -> GPADC_FIFO_OVERRUN_CLR_W<9> {
270        GPADC_FIFO_OVERRUN_CLR_W::new(self)
271    }
272    #[doc = "Bit 10"]
273    #[inline(always)]
274    #[must_use]
275    pub fn gpadc_fifo_underrun_clr(&mut self) -> GPADC_FIFO_UNDERRUN_CLR_W<10> {
276        GPADC_FIFO_UNDERRUN_CLR_W::new(self)
277    }
278    #[doc = "Bit 12"]
279    #[inline(always)]
280    #[must_use]
281    pub fn gpadc_rdy_mask(&mut self) -> GPADC_RDY_MASK_W<12> {
282        GPADC_RDY_MASK_W::new(self)
283    }
284    #[doc = "Bit 13"]
285    #[inline(always)]
286    #[must_use]
287    pub fn gpadc_fifo_overrun_mask(&mut self) -> GPADC_FIFO_OVERRUN_MASK_W<13> {
288        GPADC_FIFO_OVERRUN_MASK_W::new(self)
289    }
290    #[doc = "Bit 14"]
291    #[inline(always)]
292    #[must_use]
293    pub fn gpadc_fifo_underrun_mask(&mut self) -> GPADC_FIFO_UNDERRUN_MASK_W<14> {
294        GPADC_FIFO_UNDERRUN_MASK_W::new(self)
295    }
296    #[doc = "Bit 15"]
297    #[inline(always)]
298    #[must_use]
299    pub fn gpadc_fifo_rdy_mask(&mut self) -> GPADC_FIFO_RDY_MASK_W<15> {
300        GPADC_FIFO_RDY_MASK_W::new(self)
301    }
302    #[doc = "Bits 16:21"]
303    #[inline(always)]
304    #[must_use]
305    pub fn gpadc_fifo_data_count(&mut self) -> GPADC_FIFO_DATA_COUNT_W<16> {
306        GPADC_FIFO_DATA_COUNT_W::new(self)
307    }
308    #[doc = "Bits 22:23"]
309    #[inline(always)]
310    #[must_use]
311    pub fn gpadc_fifo_thl(&mut self) -> GPADC_FIFO_THL_W<22> {
312        GPADC_FIFO_THL_W::new(self)
313    }
314    #[doc = "Bits 24:31"]
315    #[inline(always)]
316    #[must_use]
317    pub fn rsvd_31_24(&mut self) -> RSVD_31_24_W<24> {
318        RSVD_31_24_W::new(self)
319    }
320    #[doc = "Writes raw bits to the register."]
321    #[inline(always)]
322    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
323        self.0.bits(bits);
324        self
325    }
326}
327#[doc = "gpadc_config.\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 [gpadc_config](index.html) module"]
328pub struct GPADC_CONFIG_SPEC;
329impl crate::RegisterSpec for GPADC_CONFIG_SPEC {
330    type Ux = u32;
331}
332#[doc = "`read()` method returns [gpadc_config::R](R) reader structure"]
333impl crate::Readable for GPADC_CONFIG_SPEC {
334    type Reader = R;
335}
336#[doc = "`write(|w| ..)` method takes [gpadc_config::W](W) writer structure"]
337impl crate::Writable for GPADC_CONFIG_SPEC {
338    type Writer = W;
339    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
340    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
341}
342#[doc = "`reset()` method sets gpadc_config to value 0"]
343impl crate::Resettable for GPADC_CONFIG_SPEC {
344    const RESET_VALUE: Self::Ux = 0;
345}