1#[doc = "Reader of register INVCTRL"]
2pub type R = crate::R<u32, super::INVCTRL>;
3#[doc = "Writer for register INVCTRL"]
4pub type W = crate::W<u32, super::INVCTRL>;
5#[doc = "Register INVCTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::INVCTRL {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Pair Channels 0 Inverting Enable\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum INV0EN_A {
16 #[doc = "0: Inverting is disabled."]
17 _0,
18 #[doc = "1: Inverting is enabled."]
19 _1,
20}
21impl From<INV0EN_A> for bool {
22 #[inline(always)]
23 fn from(variant: INV0EN_A) -> Self {
24 match variant {
25 INV0EN_A::_0 => false,
26 INV0EN_A::_1 => true,
27 }
28 }
29}
30#[doc = "Reader of field `INV0EN`"]
31pub type INV0EN_R = crate::R<bool, INV0EN_A>;
32impl INV0EN_R {
33 #[doc = r"Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> INV0EN_A {
36 match self.bits {
37 false => INV0EN_A::_0,
38 true => INV0EN_A::_1,
39 }
40 }
41 #[doc = "Checks if the value of the field is `_0`"]
42 #[inline(always)]
43 pub fn is_0(&self) -> bool {
44 *self == INV0EN_A::_0
45 }
46 #[doc = "Checks if the value of the field is `_1`"]
47 #[inline(always)]
48 pub fn is_1(&self) -> bool {
49 *self == INV0EN_A::_1
50 }
51}
52#[doc = "Write proxy for field `INV0EN`"]
53pub struct INV0EN_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> INV0EN_W<'a> {
57 #[doc = r"Writes `variant` to the field"]
58 #[inline(always)]
59 pub fn variant(self, variant: INV0EN_A) -> &'a mut W {
60 {
61 self.bit(variant.into())
62 }
63 }
64 #[doc = "Inverting is disabled."]
65 #[inline(always)]
66 pub fn _0(self) -> &'a mut W {
67 self.variant(INV0EN_A::_0)
68 }
69 #[doc = "Inverting is enabled."]
70 #[inline(always)]
71 pub fn _1(self) -> &'a mut W {
72 self.variant(INV0EN_A::_1)
73 }
74 #[doc = r"Sets the field bit"]
75 #[inline(always)]
76 pub fn set_bit(self) -> &'a mut W {
77 self.bit(true)
78 }
79 #[doc = r"Clears the field bit"]
80 #[inline(always)]
81 pub fn clear_bit(self) -> &'a mut W {
82 self.bit(false)
83 }
84 #[doc = r"Writes raw bits to the field"]
85 #[inline(always)]
86 pub fn bit(self, value: bool) -> &'a mut W {
87 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
88 self.w
89 }
90}
91#[doc = "Pair Channels 1 Inverting Enable\n\nValue on reset: 0"]
92#[derive(Clone, Copy, Debug, PartialEq)]
93pub enum INV1EN_A {
94 #[doc = "0: Inverting is disabled."]
95 _0,
96 #[doc = "1: Inverting is enabled."]
97 _1,
98}
99impl From<INV1EN_A> for bool {
100 #[inline(always)]
101 fn from(variant: INV1EN_A) -> Self {
102 match variant {
103 INV1EN_A::_0 => false,
104 INV1EN_A::_1 => true,
105 }
106 }
107}
108#[doc = "Reader of field `INV1EN`"]
109pub type INV1EN_R = crate::R<bool, INV1EN_A>;
110impl INV1EN_R {
111 #[doc = r"Get enumerated values variant"]
112 #[inline(always)]
113 pub fn variant(&self) -> INV1EN_A {
114 match self.bits {
115 false => INV1EN_A::_0,
116 true => INV1EN_A::_1,
117 }
118 }
119 #[doc = "Checks if the value of the field is `_0`"]
120 #[inline(always)]
121 pub fn is_0(&self) -> bool {
122 *self == INV1EN_A::_0
123 }
124 #[doc = "Checks if the value of the field is `_1`"]
125 #[inline(always)]
126 pub fn is_1(&self) -> bool {
127 *self == INV1EN_A::_1
128 }
129}
130#[doc = "Write proxy for field `INV1EN`"]
131pub struct INV1EN_W<'a> {
132 w: &'a mut W,
133}
134impl<'a> INV1EN_W<'a> {
135 #[doc = r"Writes `variant` to the field"]
136 #[inline(always)]
137 pub fn variant(self, variant: INV1EN_A) -> &'a mut W {
138 {
139 self.bit(variant.into())
140 }
141 }
142 #[doc = "Inverting is disabled."]
143 #[inline(always)]
144 pub fn _0(self) -> &'a mut W {
145 self.variant(INV1EN_A::_0)
146 }
147 #[doc = "Inverting is enabled."]
148 #[inline(always)]
149 pub fn _1(self) -> &'a mut W {
150 self.variant(INV1EN_A::_1)
151 }
152 #[doc = r"Sets the field bit"]
153 #[inline(always)]
154 pub fn set_bit(self) -> &'a mut W {
155 self.bit(true)
156 }
157 #[doc = r"Clears the field bit"]
158 #[inline(always)]
159 pub fn clear_bit(self) -> &'a mut W {
160 self.bit(false)
161 }
162 #[doc = r"Writes raw bits to the field"]
163 #[inline(always)]
164 pub fn bit(self, value: bool) -> &'a mut W {
165 self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
166 self.w
167 }
168}
169#[doc = "Pair Channels 2 Inverting Enable\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq)]
171pub enum INV2EN_A {
172 #[doc = "0: Inverting is disabled."]
173 _0,
174 #[doc = "1: Inverting is enabled."]
175 _1,
176}
177impl From<INV2EN_A> for bool {
178 #[inline(always)]
179 fn from(variant: INV2EN_A) -> Self {
180 match variant {
181 INV2EN_A::_0 => false,
182 INV2EN_A::_1 => true,
183 }
184 }
185}
186#[doc = "Reader of field `INV2EN`"]
187pub type INV2EN_R = crate::R<bool, INV2EN_A>;
188impl INV2EN_R {
189 #[doc = r"Get enumerated values variant"]
190 #[inline(always)]
191 pub fn variant(&self) -> INV2EN_A {
192 match self.bits {
193 false => INV2EN_A::_0,
194 true => INV2EN_A::_1,
195 }
196 }
197 #[doc = "Checks if the value of the field is `_0`"]
198 #[inline(always)]
199 pub fn is_0(&self) -> bool {
200 *self == INV2EN_A::_0
201 }
202 #[doc = "Checks if the value of the field is `_1`"]
203 #[inline(always)]
204 pub fn is_1(&self) -> bool {
205 *self == INV2EN_A::_1
206 }
207}
208#[doc = "Write proxy for field `INV2EN`"]
209pub struct INV2EN_W<'a> {
210 w: &'a mut W,
211}
212impl<'a> INV2EN_W<'a> {
213 #[doc = r"Writes `variant` to the field"]
214 #[inline(always)]
215 pub fn variant(self, variant: INV2EN_A) -> &'a mut W {
216 {
217 self.bit(variant.into())
218 }
219 }
220 #[doc = "Inverting is disabled."]
221 #[inline(always)]
222 pub fn _0(self) -> &'a mut W {
223 self.variant(INV2EN_A::_0)
224 }
225 #[doc = "Inverting is enabled."]
226 #[inline(always)]
227 pub fn _1(self) -> &'a mut W {
228 self.variant(INV2EN_A::_1)
229 }
230 #[doc = r"Sets the field bit"]
231 #[inline(always)]
232 pub fn set_bit(self) -> &'a mut W {
233 self.bit(true)
234 }
235 #[doc = r"Clears the field bit"]
236 #[inline(always)]
237 pub fn clear_bit(self) -> &'a mut W {
238 self.bit(false)
239 }
240 #[doc = r"Writes raw bits to the field"]
241 #[inline(always)]
242 pub fn bit(self, value: bool) -> &'a mut W {
243 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
244 self.w
245 }
246}
247#[doc = "Pair Channels 3 Inverting Enable\n\nValue on reset: 0"]
248#[derive(Clone, Copy, Debug, PartialEq)]
249pub enum INV3EN_A {
250 #[doc = "0: Inverting is disabled."]
251 _0,
252 #[doc = "1: Inverting is enabled."]
253 _1,
254}
255impl From<INV3EN_A> for bool {
256 #[inline(always)]
257 fn from(variant: INV3EN_A) -> Self {
258 match variant {
259 INV3EN_A::_0 => false,
260 INV3EN_A::_1 => true,
261 }
262 }
263}
264#[doc = "Reader of field `INV3EN`"]
265pub type INV3EN_R = crate::R<bool, INV3EN_A>;
266impl INV3EN_R {
267 #[doc = r"Get enumerated values variant"]
268 #[inline(always)]
269 pub fn variant(&self) -> INV3EN_A {
270 match self.bits {
271 false => INV3EN_A::_0,
272 true => INV3EN_A::_1,
273 }
274 }
275 #[doc = "Checks if the value of the field is `_0`"]
276 #[inline(always)]
277 pub fn is_0(&self) -> bool {
278 *self == INV3EN_A::_0
279 }
280 #[doc = "Checks if the value of the field is `_1`"]
281 #[inline(always)]
282 pub fn is_1(&self) -> bool {
283 *self == INV3EN_A::_1
284 }
285}
286#[doc = "Write proxy for field `INV3EN`"]
287pub struct INV3EN_W<'a> {
288 w: &'a mut W,
289}
290impl<'a> INV3EN_W<'a> {
291 #[doc = r"Writes `variant` to the field"]
292 #[inline(always)]
293 pub fn variant(self, variant: INV3EN_A) -> &'a mut W {
294 {
295 self.bit(variant.into())
296 }
297 }
298 #[doc = "Inverting is disabled."]
299 #[inline(always)]
300 pub fn _0(self) -> &'a mut W {
301 self.variant(INV3EN_A::_0)
302 }
303 #[doc = "Inverting is enabled."]
304 #[inline(always)]
305 pub fn _1(self) -> &'a mut W {
306 self.variant(INV3EN_A::_1)
307 }
308 #[doc = r"Sets the field bit"]
309 #[inline(always)]
310 pub fn set_bit(self) -> &'a mut W {
311 self.bit(true)
312 }
313 #[doc = r"Clears the field bit"]
314 #[inline(always)]
315 pub fn clear_bit(self) -> &'a mut W {
316 self.bit(false)
317 }
318 #[doc = r"Writes raw bits to the field"]
319 #[inline(always)]
320 pub fn bit(self, value: bool) -> &'a mut W {
321 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
322 self.w
323 }
324}
325impl R {
326 #[doc = "Bit 0 - Pair Channels 0 Inverting Enable"]
327 #[inline(always)]
328 pub fn inv0en(&self) -> INV0EN_R {
329 INV0EN_R::new((self.bits & 0x01) != 0)
330 }
331 #[doc = "Bit 1 - Pair Channels 1 Inverting Enable"]
332 #[inline(always)]
333 pub fn inv1en(&self) -> INV1EN_R {
334 INV1EN_R::new(((self.bits >> 1) & 0x01) != 0)
335 }
336 #[doc = "Bit 2 - Pair Channels 2 Inverting Enable"]
337 #[inline(always)]
338 pub fn inv2en(&self) -> INV2EN_R {
339 INV2EN_R::new(((self.bits >> 2) & 0x01) != 0)
340 }
341 #[doc = "Bit 3 - Pair Channels 3 Inverting Enable"]
342 #[inline(always)]
343 pub fn inv3en(&self) -> INV3EN_R {
344 INV3EN_R::new(((self.bits >> 3) & 0x01) != 0)
345 }
346}
347impl W {
348 #[doc = "Bit 0 - Pair Channels 0 Inverting Enable"]
349 #[inline(always)]
350 pub fn inv0en(&mut self) -> INV0EN_W {
351 INV0EN_W { w: self }
352 }
353 #[doc = "Bit 1 - Pair Channels 1 Inverting Enable"]
354 #[inline(always)]
355 pub fn inv1en(&mut self) -> INV1EN_W {
356 INV1EN_W { w: self }
357 }
358 #[doc = "Bit 2 - Pair Channels 2 Inverting Enable"]
359 #[inline(always)]
360 pub fn inv2en(&mut self) -> INV2EN_W {
361 INV2EN_W { w: self }
362 }
363 #[doc = "Bit 3 - Pair Channels 3 Inverting Enable"]
364 #[inline(always)]
365 pub fn inv3en(&mut self) -> INV3EN_W {
366 INV3EN_W { w: self }
367 }
368}