pic32mx2xx/pic32mx2xxfxxxd/tmr2/
contclr.rs1#[doc = "Register `CONTCLR` reader"]
2pub struct R(crate::R<CONTCLR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONTCLR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONTCLR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONTCLR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CONTCLR` writer"]
17pub struct W(crate::W<CONTCLR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CONTCLR_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<CONTCLR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CONTCLR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `TCS` reader - "]
38pub type TCS_R = crate::BitReader;
39#[doc = "Field `TCS` writer - "]
40pub type TCS_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
41#[doc = "Field `T32` reader - "]
42pub type T32_R = crate::BitReader;
43#[doc = "Field `T32` writer - "]
44pub type T32_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
45#[doc = "Field `TCKPS` reader - "]
46pub type TCKPS_R = crate::FieldReader;
47#[doc = "Field `TCKPS` writer - "]
48pub type TCKPS_W<'a, const O: u8> = crate::FieldWriter<'a, CONTCLR_SPEC, 3, O>;
49#[doc = "Field `TGATE` reader - "]
50pub type TGATE_R = crate::BitReader;
51#[doc = "Field `TGATE` writer - "]
52pub type TGATE_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
53#[doc = "Field `SIDL` reader - "]
54pub type SIDL_R = crate::BitReader;
55#[doc = "Field `SIDL` writer - "]
56pub type SIDL_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
57#[doc = "Field `FRZ` reader - "]
58pub type FRZ_R = crate::BitReader;
59#[doc = "Field `FRZ` writer - "]
60pub type FRZ_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
61#[doc = "Field `ON` reader - "]
62pub type ON_R = crate::BitReader;
63#[doc = "Field `ON` writer - "]
64pub type ON_W<'a, const O: u8> = crate::BitWriter<'a, CONTCLR_SPEC, O>;
65impl R {
66 #[doc = "Bit 1"]
67 #[inline(always)]
68 pub fn tcs(&self) -> TCS_R {
69 TCS_R::new(((self.bits >> 1) & 1) != 0)
70 }
71 #[doc = "Bit 3"]
72 #[inline(always)]
73 pub fn t32(&self) -> T32_R {
74 T32_R::new(((self.bits >> 3) & 1) != 0)
75 }
76 #[doc = "Bits 4:6"]
77 #[inline(always)]
78 pub fn tckps(&self) -> TCKPS_R {
79 TCKPS_R::new(((self.bits >> 4) & 7) as u8)
80 }
81 #[doc = "Bit 7"]
82 #[inline(always)]
83 pub fn tgate(&self) -> TGATE_R {
84 TGATE_R::new(((self.bits >> 7) & 1) != 0)
85 }
86 #[doc = "Bit 13"]
87 #[inline(always)]
88 pub fn sidl(&self) -> SIDL_R {
89 SIDL_R::new(((self.bits >> 13) & 1) != 0)
90 }
91 #[doc = "Bit 14"]
92 #[inline(always)]
93 pub fn frz(&self) -> FRZ_R {
94 FRZ_R::new(((self.bits >> 14) & 1) != 0)
95 }
96 #[doc = "Bit 15"]
97 #[inline(always)]
98 pub fn on(&self) -> ON_R {
99 ON_R::new(((self.bits >> 15) & 1) != 0)
100 }
101}
102impl W {
103 #[doc = "Bit 1"]
104 #[inline(always)]
105 #[must_use]
106 pub fn tcs(&mut self) -> TCS_W<1> {
107 TCS_W::new(self)
108 }
109 #[doc = "Bit 3"]
110 #[inline(always)]
111 #[must_use]
112 pub fn t32(&mut self) -> T32_W<3> {
113 T32_W::new(self)
114 }
115 #[doc = "Bits 4:6"]
116 #[inline(always)]
117 #[must_use]
118 pub fn tckps(&mut self) -> TCKPS_W<4> {
119 TCKPS_W::new(self)
120 }
121 #[doc = "Bit 7"]
122 #[inline(always)]
123 #[must_use]
124 pub fn tgate(&mut self) -> TGATE_W<7> {
125 TGATE_W::new(self)
126 }
127 #[doc = "Bit 13"]
128 #[inline(always)]
129 #[must_use]
130 pub fn sidl(&mut self) -> SIDL_W<13> {
131 SIDL_W::new(self)
132 }
133 #[doc = "Bit 14"]
134 #[inline(always)]
135 #[must_use]
136 pub fn frz(&mut self) -> FRZ_W<14> {
137 FRZ_W::new(self)
138 }
139 #[doc = "Bit 15"]
140 #[inline(always)]
141 #[must_use]
142 pub fn on(&mut self) -> ON_W<15> {
143 ON_W::new(self)
144 }
145 #[doc = "Writes raw bits to the register."]
146 #[inline(always)]
147 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
148 self.0.bits(bits);
149 self
150 }
151}
152#[doc = "T2CONCLR 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 [contclr](index.html) module"]
153pub struct CONTCLR_SPEC;
154impl crate::RegisterSpec for CONTCLR_SPEC {
155 type Ux = u32;
156}
157#[doc = "`read()` method returns [contclr::R](R) reader structure"]
158impl crate::Readable for CONTCLR_SPEC {
159 type Reader = R;
160}
161#[doc = "`write(|w| ..)` method takes [contclr::W](W) writer structure"]
162impl crate::Writable for CONTCLR_SPEC {
163 type Writer = W;
164 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
165 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166}
167#[doc = "`reset()` method sets CONTCLR to value 0"]
168impl crate::Resettable for CONTCLR_SPEC {
169 const RESET_VALUE: Self::Ux = 0;
170}