pic32mx2xx/pic32mx2xxfxxxd/portc/
odc.rs

1#[doc = "Register `ODC` reader"]
2pub struct R(crate::R<ODC_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ODC_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ODC_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ODC_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ODC` writer"]
17pub struct W(crate::W<ODC_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<ODC_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<ODC_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<ODC_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ODCC0` reader - "]
38pub type ODCC0_R = crate::BitReader;
39#[doc = "Field `ODCC0` writer - "]
40pub type ODCC0_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
41#[doc = "Field `ODCC1` reader - "]
42pub type ODCC1_R = crate::BitReader;
43#[doc = "Field `ODCC1` writer - "]
44pub type ODCC1_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
45#[doc = "Field `ODCC2` reader - "]
46pub type ODCC2_R = crate::BitReader;
47#[doc = "Field `ODCC2` writer - "]
48pub type ODCC2_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
49#[doc = "Field `ODCC3` reader - "]
50pub type ODCC3_R = crate::BitReader;
51#[doc = "Field `ODCC3` writer - "]
52pub type ODCC3_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
53#[doc = "Field `ODCC4` reader - "]
54pub type ODCC4_R = crate::BitReader;
55#[doc = "Field `ODCC4` writer - "]
56pub type ODCC4_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
57#[doc = "Field `ODCC5` reader - "]
58pub type ODCC5_R = crate::BitReader;
59#[doc = "Field `ODCC5` writer - "]
60pub type ODCC5_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
61#[doc = "Field `ODCC6` reader - "]
62pub type ODCC6_R = crate::BitReader;
63#[doc = "Field `ODCC6` writer - "]
64pub type ODCC6_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
65#[doc = "Field `ODCC7` reader - "]
66pub type ODCC7_R = crate::BitReader;
67#[doc = "Field `ODCC7` writer - "]
68pub type ODCC7_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
69#[doc = "Field `ODCC8` reader - "]
70pub type ODCC8_R = crate::BitReader;
71#[doc = "Field `ODCC8` writer - "]
72pub type ODCC8_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
73#[doc = "Field `ODCC9` reader - "]
74pub type ODCC9_R = crate::BitReader;
75#[doc = "Field `ODCC9` writer - "]
76pub type ODCC9_W<'a, const O: u8> = crate::BitWriter<'a, ODC_SPEC, O>;
77impl R {
78    #[doc = "Bit 0"]
79    #[inline(always)]
80    pub fn odcc0(&self) -> ODCC0_R {
81        ODCC0_R::new((self.bits & 1) != 0)
82    }
83    #[doc = "Bit 1"]
84    #[inline(always)]
85    pub fn odcc1(&self) -> ODCC1_R {
86        ODCC1_R::new(((self.bits >> 1) & 1) != 0)
87    }
88    #[doc = "Bit 2"]
89    #[inline(always)]
90    pub fn odcc2(&self) -> ODCC2_R {
91        ODCC2_R::new(((self.bits >> 2) & 1) != 0)
92    }
93    #[doc = "Bit 3"]
94    #[inline(always)]
95    pub fn odcc3(&self) -> ODCC3_R {
96        ODCC3_R::new(((self.bits >> 3) & 1) != 0)
97    }
98    #[doc = "Bit 4"]
99    #[inline(always)]
100    pub fn odcc4(&self) -> ODCC4_R {
101        ODCC4_R::new(((self.bits >> 4) & 1) != 0)
102    }
103    #[doc = "Bit 5"]
104    #[inline(always)]
105    pub fn odcc5(&self) -> ODCC5_R {
106        ODCC5_R::new(((self.bits >> 5) & 1) != 0)
107    }
108    #[doc = "Bit 6"]
109    #[inline(always)]
110    pub fn odcc6(&self) -> ODCC6_R {
111        ODCC6_R::new(((self.bits >> 6) & 1) != 0)
112    }
113    #[doc = "Bit 7"]
114    #[inline(always)]
115    pub fn odcc7(&self) -> ODCC7_R {
116        ODCC7_R::new(((self.bits >> 7) & 1) != 0)
117    }
118    #[doc = "Bit 8"]
119    #[inline(always)]
120    pub fn odcc8(&self) -> ODCC8_R {
121        ODCC8_R::new(((self.bits >> 8) & 1) != 0)
122    }
123    #[doc = "Bit 9"]
124    #[inline(always)]
125    pub fn odcc9(&self) -> ODCC9_R {
126        ODCC9_R::new(((self.bits >> 9) & 1) != 0)
127    }
128}
129impl W {
130    #[doc = "Bit 0"]
131    #[inline(always)]
132    #[must_use]
133    pub fn odcc0(&mut self) -> ODCC0_W<0> {
134        ODCC0_W::new(self)
135    }
136    #[doc = "Bit 1"]
137    #[inline(always)]
138    #[must_use]
139    pub fn odcc1(&mut self) -> ODCC1_W<1> {
140        ODCC1_W::new(self)
141    }
142    #[doc = "Bit 2"]
143    #[inline(always)]
144    #[must_use]
145    pub fn odcc2(&mut self) -> ODCC2_W<2> {
146        ODCC2_W::new(self)
147    }
148    #[doc = "Bit 3"]
149    #[inline(always)]
150    #[must_use]
151    pub fn odcc3(&mut self) -> ODCC3_W<3> {
152        ODCC3_W::new(self)
153    }
154    #[doc = "Bit 4"]
155    #[inline(always)]
156    #[must_use]
157    pub fn odcc4(&mut self) -> ODCC4_W<4> {
158        ODCC4_W::new(self)
159    }
160    #[doc = "Bit 5"]
161    #[inline(always)]
162    #[must_use]
163    pub fn odcc5(&mut self) -> ODCC5_W<5> {
164        ODCC5_W::new(self)
165    }
166    #[doc = "Bit 6"]
167    #[inline(always)]
168    #[must_use]
169    pub fn odcc6(&mut self) -> ODCC6_W<6> {
170        ODCC6_W::new(self)
171    }
172    #[doc = "Bit 7"]
173    #[inline(always)]
174    #[must_use]
175    pub fn odcc7(&mut self) -> ODCC7_W<7> {
176        ODCC7_W::new(self)
177    }
178    #[doc = "Bit 8"]
179    #[inline(always)]
180    #[must_use]
181    pub fn odcc8(&mut self) -> ODCC8_W<8> {
182        ODCC8_W::new(self)
183    }
184    #[doc = "Bit 9"]
185    #[inline(always)]
186    #[must_use]
187    pub fn odcc9(&mut self) -> ODCC9_W<9> {
188        ODCC9_W::new(self)
189    }
190    #[doc = "Writes raw bits to the register."]
191    #[inline(always)]
192    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
193        self.0.bits(bits);
194        self
195    }
196}
197#[doc = "ODCC register\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 [odc](index.html) module"]
198pub struct ODC_SPEC;
199impl crate::RegisterSpec for ODC_SPEC {
200    type Ux = u32;
201}
202#[doc = "`read()` method returns [odc::R](R) reader structure"]
203impl crate::Readable for ODC_SPEC {
204    type Reader = R;
205}
206#[doc = "`write(|w| ..)` method takes [odc::W](W) writer structure"]
207impl crate::Writable for ODC_SPEC {
208    type Writer = W;
209    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
210    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
211}
212#[doc = "`reset()` method sets ODC to value 0"]
213impl crate::Resettable for ODC_SPEC {
214    const RESET_VALUE: Self::Ux = 0;
215}