bl702_pac/aon/
gpadc_reg_scn_pos1.rs

1#[doc = "Register `gpadc_reg_scn_pos1` reader"]
2pub struct R(crate::R<GPADC_REG_SCN_POS1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<GPADC_REG_SCN_POS1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<GPADC_REG_SCN_POS1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<GPADC_REG_SCN_POS1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `gpadc_reg_scn_pos1` writer"]
17pub struct W(crate::W<GPADC_REG_SCN_POS1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<GPADC_REG_SCN_POS1_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_REG_SCN_POS1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<GPADC_REG_SCN_POS1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `gpadc_scan_pos_0` reader - "]
38pub type GPADC_SCAN_POS_0_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `gpadc_scan_pos_0` writer - "]
40pub type GPADC_SCAN_POS_0_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
42#[doc = "Field `gpadc_scan_pos_1` reader - "]
43pub type GPADC_SCAN_POS_1_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `gpadc_scan_pos_1` writer - "]
45pub type GPADC_SCAN_POS_1_W<'a, const O: u8> =
46    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
47#[doc = "Field `gpadc_scan_pos_2` reader - "]
48pub type GPADC_SCAN_POS_2_R = crate::FieldReader<u8, u8>;
49#[doc = "Field `gpadc_scan_pos_2` writer - "]
50pub type GPADC_SCAN_POS_2_W<'a, const O: u8> =
51    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
52#[doc = "Field `gpadc_scan_pos_3` reader - "]
53pub type GPADC_SCAN_POS_3_R = crate::FieldReader<u8, u8>;
54#[doc = "Field `gpadc_scan_pos_3` writer - "]
55pub type GPADC_SCAN_POS_3_W<'a, const O: u8> =
56    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
57#[doc = "Field `gpadc_scan_pos_4` reader - "]
58pub type GPADC_SCAN_POS_4_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `gpadc_scan_pos_4` writer - "]
60pub type GPADC_SCAN_POS_4_W<'a, const O: u8> =
61    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
62#[doc = "Field `gpadc_scan_pos_5` reader - "]
63pub type GPADC_SCAN_POS_5_R = crate::FieldReader<u8, u8>;
64#[doc = "Field `gpadc_scan_pos_5` writer - "]
65pub type GPADC_SCAN_POS_5_W<'a, const O: u8> =
66    crate::FieldWriter<'a, u32, GPADC_REG_SCN_POS1_SPEC, u8, u8, 5, O>;
67impl R {
68    #[doc = "Bits 0:4"]
69    #[inline(always)]
70    pub fn gpadc_scan_pos_0(&self) -> GPADC_SCAN_POS_0_R {
71        GPADC_SCAN_POS_0_R::new((self.bits & 0x1f) as u8)
72    }
73    #[doc = "Bits 5:9"]
74    #[inline(always)]
75    pub fn gpadc_scan_pos_1(&self) -> GPADC_SCAN_POS_1_R {
76        GPADC_SCAN_POS_1_R::new(((self.bits >> 5) & 0x1f) as u8)
77    }
78    #[doc = "Bits 10:14"]
79    #[inline(always)]
80    pub fn gpadc_scan_pos_2(&self) -> GPADC_SCAN_POS_2_R {
81        GPADC_SCAN_POS_2_R::new(((self.bits >> 10) & 0x1f) as u8)
82    }
83    #[doc = "Bits 15:19"]
84    #[inline(always)]
85    pub fn gpadc_scan_pos_3(&self) -> GPADC_SCAN_POS_3_R {
86        GPADC_SCAN_POS_3_R::new(((self.bits >> 15) & 0x1f) as u8)
87    }
88    #[doc = "Bits 20:24"]
89    #[inline(always)]
90    pub fn gpadc_scan_pos_4(&self) -> GPADC_SCAN_POS_4_R {
91        GPADC_SCAN_POS_4_R::new(((self.bits >> 20) & 0x1f) as u8)
92    }
93    #[doc = "Bits 25:29"]
94    #[inline(always)]
95    pub fn gpadc_scan_pos_5(&self) -> GPADC_SCAN_POS_5_R {
96        GPADC_SCAN_POS_5_R::new(((self.bits >> 25) & 0x1f) as u8)
97    }
98}
99impl W {
100    #[doc = "Bits 0:4"]
101    #[inline(always)]
102    #[must_use]
103    pub fn gpadc_scan_pos_0(&mut self) -> GPADC_SCAN_POS_0_W<0> {
104        GPADC_SCAN_POS_0_W::new(self)
105    }
106    #[doc = "Bits 5:9"]
107    #[inline(always)]
108    #[must_use]
109    pub fn gpadc_scan_pos_1(&mut self) -> GPADC_SCAN_POS_1_W<5> {
110        GPADC_SCAN_POS_1_W::new(self)
111    }
112    #[doc = "Bits 10:14"]
113    #[inline(always)]
114    #[must_use]
115    pub fn gpadc_scan_pos_2(&mut self) -> GPADC_SCAN_POS_2_W<10> {
116        GPADC_SCAN_POS_2_W::new(self)
117    }
118    #[doc = "Bits 15:19"]
119    #[inline(always)]
120    #[must_use]
121    pub fn gpadc_scan_pos_3(&mut self) -> GPADC_SCAN_POS_3_W<15> {
122        GPADC_SCAN_POS_3_W::new(self)
123    }
124    #[doc = "Bits 20:24"]
125    #[inline(always)]
126    #[must_use]
127    pub fn gpadc_scan_pos_4(&mut self) -> GPADC_SCAN_POS_4_W<20> {
128        GPADC_SCAN_POS_4_W::new(self)
129    }
130    #[doc = "Bits 25:29"]
131    #[inline(always)]
132    #[must_use]
133    pub fn gpadc_scan_pos_5(&mut self) -> GPADC_SCAN_POS_5_W<25> {
134        GPADC_SCAN_POS_5_W::new(self)
135    }
136    #[doc = "Writes raw bits to the register."]
137    #[inline(always)]
138    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
139        self.0.bits(bits);
140        self
141    }
142}
143#[doc = "adc converation sequence 1\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_reg_scn_pos1](index.html) module"]
144pub struct GPADC_REG_SCN_POS1_SPEC;
145impl crate::RegisterSpec for GPADC_REG_SCN_POS1_SPEC {
146    type Ux = u32;
147}
148#[doc = "`read()` method returns [gpadc_reg_scn_pos1::R](R) reader structure"]
149impl crate::Readable for GPADC_REG_SCN_POS1_SPEC {
150    type Reader = R;
151}
152#[doc = "`write(|w| ..)` method takes [gpadc_reg_scn_pos1::W](W) writer structure"]
153impl crate::Writable for GPADC_REG_SCN_POS1_SPEC {
154    type Writer = W;
155    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
156    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
157}
158#[doc = "`reset()` method sets gpadc_reg_scn_pos1 to value 0"]
159impl crate::Resettable for GPADC_REG_SCN_POS1_SPEC {
160    const RESET_VALUE: Self::Ux = 0;
161}