rv32m1_ri5cy_pac/lpuart2/
modir.rs1#[doc = "Reader of register MODIR"]
2pub type R = crate::R<u32, super::MODIR>;
3#[doc = "Writer for register MODIR"]
4pub type W = crate::W<u32, super::MODIR>;
5#[doc = "Register MODIR `reset()`'s with value 0"]
6impl crate::ResetValue for super::MODIR {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Transmitter clear-to-send enable\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum TXCTSE_A {
16 #[doc = "0: CTS has no effect on the transmitter."]
17 TXCTSE_0,
18 #[doc = "1: Enables clear-to-send operation. The transmitter checks the state of CTS each time it is ready to send a character. If CTS is asserted, the character is sent. If CTS is deasserted, the signal TXD remains in the mark state and transmission is delayed until CTS is asserted. Changes in CTS as a character is being sent do not affect its transmission."]
19 TXCTSE_1,
20}
21impl From<TXCTSE_A> for bool {
22 #[inline(always)]
23 fn from(variant: TXCTSE_A) -> Self {
24 match variant {
25 TXCTSE_A::TXCTSE_0 => false,
26 TXCTSE_A::TXCTSE_1 => true,
27 }
28 }
29}
30#[doc = "Reader of field `TXCTSE`"]
31pub type TXCTSE_R = crate::R<bool, TXCTSE_A>;
32impl TXCTSE_R {
33 #[doc = r"Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> TXCTSE_A {
36 match self.bits {
37 false => TXCTSE_A::TXCTSE_0,
38 true => TXCTSE_A::TXCTSE_1,
39 }
40 }
41 #[doc = "Checks if the value of the field is `TXCTSE_0`"]
42 #[inline(always)]
43 pub fn is_txctse_0(&self) -> bool {
44 *self == TXCTSE_A::TXCTSE_0
45 }
46 #[doc = "Checks if the value of the field is `TXCTSE_1`"]
47 #[inline(always)]
48 pub fn is_txctse_1(&self) -> bool {
49 *self == TXCTSE_A::TXCTSE_1
50 }
51}
52#[doc = "Write proxy for field `TXCTSE`"]
53pub struct TXCTSE_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> TXCTSE_W<'a> {
57 #[doc = r"Writes `variant` to the field"]
58 #[inline(always)]
59 pub fn variant(self, variant: TXCTSE_A) -> &'a mut W {
60 {
61 self.bit(variant.into())
62 }
63 }
64 #[doc = "CTS has no effect on the transmitter."]
65 #[inline(always)]
66 pub fn txctse_0(self) -> &'a mut W {
67 self.variant(TXCTSE_A::TXCTSE_0)
68 }
69 #[doc = "Enables clear-to-send operation. The transmitter checks the state of CTS each time it is ready to send a character. If CTS is asserted, the character is sent. If CTS is deasserted, the signal TXD remains in the mark state and transmission is delayed until CTS is asserted. Changes in CTS as a character is being sent do not affect its transmission."]
70 #[inline(always)]
71 pub fn txctse_1(self) -> &'a mut W {
72 self.variant(TXCTSE_A::TXCTSE_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 = "Transmitter request-to-send enable\n\nValue on reset: 0"]
92#[derive(Clone, Copy, Debug, PartialEq)]
93pub enum TXRTSE_A {
94 #[doc = "0: The transmitter has no effect on RTS."]
95 TXRTSE_0,
96 #[doc = "1: When a character is placed into an empty transmitter data buffer , RTS asserts one bit time before the start bit is transmitted. RTS deasserts one bit time after all characters in the transmitter data buffer and shift register are completely sent, including the last stop bit."]
97 TXRTSE_1,
98}
99impl From<TXRTSE_A> for bool {
100 #[inline(always)]
101 fn from(variant: TXRTSE_A) -> Self {
102 match variant {
103 TXRTSE_A::TXRTSE_0 => false,
104 TXRTSE_A::TXRTSE_1 => true,
105 }
106 }
107}
108#[doc = "Reader of field `TXRTSE`"]
109pub type TXRTSE_R = crate::R<bool, TXRTSE_A>;
110impl TXRTSE_R {
111 #[doc = r"Get enumerated values variant"]
112 #[inline(always)]
113 pub fn variant(&self) -> TXRTSE_A {
114 match self.bits {
115 false => TXRTSE_A::TXRTSE_0,
116 true => TXRTSE_A::TXRTSE_1,
117 }
118 }
119 #[doc = "Checks if the value of the field is `TXRTSE_0`"]
120 #[inline(always)]
121 pub fn is_txrtse_0(&self) -> bool {
122 *self == TXRTSE_A::TXRTSE_0
123 }
124 #[doc = "Checks if the value of the field is `TXRTSE_1`"]
125 #[inline(always)]
126 pub fn is_txrtse_1(&self) -> bool {
127 *self == TXRTSE_A::TXRTSE_1
128 }
129}
130#[doc = "Write proxy for field `TXRTSE`"]
131pub struct TXRTSE_W<'a> {
132 w: &'a mut W,
133}
134impl<'a> TXRTSE_W<'a> {
135 #[doc = r"Writes `variant` to the field"]
136 #[inline(always)]
137 pub fn variant(self, variant: TXRTSE_A) -> &'a mut W {
138 {
139 self.bit(variant.into())
140 }
141 }
142 #[doc = "The transmitter has no effect on RTS."]
143 #[inline(always)]
144 pub fn txrtse_0(self) -> &'a mut W {
145 self.variant(TXRTSE_A::TXRTSE_0)
146 }
147 #[doc = "When a character is placed into an empty transmitter data buffer , RTS asserts one bit time before the start bit is transmitted. RTS deasserts one bit time after all characters in the transmitter data buffer and shift register are completely sent, including the last stop bit."]
148 #[inline(always)]
149 pub fn txrtse_1(self) -> &'a mut W {
150 self.variant(TXRTSE_A::TXRTSE_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 = "Transmitter request-to-send polarity\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq)]
171pub enum TXRTSPOL_A {
172 #[doc = "0: Transmitter RTS is active low."]
173 TXRTSPOL_0,
174 #[doc = "1: Transmitter RTS is active high."]
175 TXRTSPOL_1,
176}
177impl From<TXRTSPOL_A> for bool {
178 #[inline(always)]
179 fn from(variant: TXRTSPOL_A) -> Self {
180 match variant {
181 TXRTSPOL_A::TXRTSPOL_0 => false,
182 TXRTSPOL_A::TXRTSPOL_1 => true,
183 }
184 }
185}
186#[doc = "Reader of field `TXRTSPOL`"]
187pub type TXRTSPOL_R = crate::R<bool, TXRTSPOL_A>;
188impl TXRTSPOL_R {
189 #[doc = r"Get enumerated values variant"]
190 #[inline(always)]
191 pub fn variant(&self) -> TXRTSPOL_A {
192 match self.bits {
193 false => TXRTSPOL_A::TXRTSPOL_0,
194 true => TXRTSPOL_A::TXRTSPOL_1,
195 }
196 }
197 #[doc = "Checks if the value of the field is `TXRTSPOL_0`"]
198 #[inline(always)]
199 pub fn is_txrtspol_0(&self) -> bool {
200 *self == TXRTSPOL_A::TXRTSPOL_0
201 }
202 #[doc = "Checks if the value of the field is `TXRTSPOL_1`"]
203 #[inline(always)]
204 pub fn is_txrtspol_1(&self) -> bool {
205 *self == TXRTSPOL_A::TXRTSPOL_1
206 }
207}
208#[doc = "Write proxy for field `TXRTSPOL`"]
209pub struct TXRTSPOL_W<'a> {
210 w: &'a mut W,
211}
212impl<'a> TXRTSPOL_W<'a> {
213 #[doc = r"Writes `variant` to the field"]
214 #[inline(always)]
215 pub fn variant(self, variant: TXRTSPOL_A) -> &'a mut W {
216 {
217 self.bit(variant.into())
218 }
219 }
220 #[doc = "Transmitter RTS is active low."]
221 #[inline(always)]
222 pub fn txrtspol_0(self) -> &'a mut W {
223 self.variant(TXRTSPOL_A::TXRTSPOL_0)
224 }
225 #[doc = "Transmitter RTS is active high."]
226 #[inline(always)]
227 pub fn txrtspol_1(self) -> &'a mut W {
228 self.variant(TXRTSPOL_A::TXRTSPOL_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 = "Receiver request-to-send enable\n\nValue on reset: 0"]
248#[derive(Clone, Copy, Debug, PartialEq)]
249pub enum RXRTSE_A {
250 #[doc = "0: The receiver has no effect on RTS."]
251 RXRTSE_0,
252 #[doc = "1: no description available"]
253 RXRTSE_1,
254}
255impl From<RXRTSE_A> for bool {
256 #[inline(always)]
257 fn from(variant: RXRTSE_A) -> Self {
258 match variant {
259 RXRTSE_A::RXRTSE_0 => false,
260 RXRTSE_A::RXRTSE_1 => true,
261 }
262 }
263}
264#[doc = "Reader of field `RXRTSE`"]
265pub type RXRTSE_R = crate::R<bool, RXRTSE_A>;
266impl RXRTSE_R {
267 #[doc = r"Get enumerated values variant"]
268 #[inline(always)]
269 pub fn variant(&self) -> RXRTSE_A {
270 match self.bits {
271 false => RXRTSE_A::RXRTSE_0,
272 true => RXRTSE_A::RXRTSE_1,
273 }
274 }
275 #[doc = "Checks if the value of the field is `RXRTSE_0`"]
276 #[inline(always)]
277 pub fn is_rxrtse_0(&self) -> bool {
278 *self == RXRTSE_A::RXRTSE_0
279 }
280 #[doc = "Checks if the value of the field is `RXRTSE_1`"]
281 #[inline(always)]
282 pub fn is_rxrtse_1(&self) -> bool {
283 *self == RXRTSE_A::RXRTSE_1
284 }
285}
286#[doc = "Write proxy for field `RXRTSE`"]
287pub struct RXRTSE_W<'a> {
288 w: &'a mut W,
289}
290impl<'a> RXRTSE_W<'a> {
291 #[doc = r"Writes `variant` to the field"]
292 #[inline(always)]
293 pub fn variant(self, variant: RXRTSE_A) -> &'a mut W {
294 {
295 self.bit(variant.into())
296 }
297 }
298 #[doc = "The receiver has no effect on RTS."]
299 #[inline(always)]
300 pub fn rxrtse_0(self) -> &'a mut W {
301 self.variant(RXRTSE_A::RXRTSE_0)
302 }
303 #[doc = "no description available"]
304 #[inline(always)]
305 pub fn rxrtse_1(self) -> &'a mut W {
306 self.variant(RXRTSE_A::RXRTSE_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}
325#[doc = "Transmit CTS Configuration\n\nValue on reset: 0"]
326#[derive(Clone, Copy, Debug, PartialEq)]
327pub enum TXCTSC_A {
328 #[doc = "0: CTS input is sampled at the start of each character."]
329 TXCTSC_0,
330 #[doc = "1: CTS input is sampled when the transmitter is idle."]
331 TXCTSC_1,
332}
333impl From<TXCTSC_A> for bool {
334 #[inline(always)]
335 fn from(variant: TXCTSC_A) -> Self {
336 match variant {
337 TXCTSC_A::TXCTSC_0 => false,
338 TXCTSC_A::TXCTSC_1 => true,
339 }
340 }
341}
342#[doc = "Reader of field `TXCTSC`"]
343pub type TXCTSC_R = crate::R<bool, TXCTSC_A>;
344impl TXCTSC_R {
345 #[doc = r"Get enumerated values variant"]
346 #[inline(always)]
347 pub fn variant(&self) -> TXCTSC_A {
348 match self.bits {
349 false => TXCTSC_A::TXCTSC_0,
350 true => TXCTSC_A::TXCTSC_1,
351 }
352 }
353 #[doc = "Checks if the value of the field is `TXCTSC_0`"]
354 #[inline(always)]
355 pub fn is_txctsc_0(&self) -> bool {
356 *self == TXCTSC_A::TXCTSC_0
357 }
358 #[doc = "Checks if the value of the field is `TXCTSC_1`"]
359 #[inline(always)]
360 pub fn is_txctsc_1(&self) -> bool {
361 *self == TXCTSC_A::TXCTSC_1
362 }
363}
364#[doc = "Write proxy for field `TXCTSC`"]
365pub struct TXCTSC_W<'a> {
366 w: &'a mut W,
367}
368impl<'a> TXCTSC_W<'a> {
369 #[doc = r"Writes `variant` to the field"]
370 #[inline(always)]
371 pub fn variant(self, variant: TXCTSC_A) -> &'a mut W {
372 {
373 self.bit(variant.into())
374 }
375 }
376 #[doc = "CTS input is sampled at the start of each character."]
377 #[inline(always)]
378 pub fn txctsc_0(self) -> &'a mut W {
379 self.variant(TXCTSC_A::TXCTSC_0)
380 }
381 #[doc = "CTS input is sampled when the transmitter is idle."]
382 #[inline(always)]
383 pub fn txctsc_1(self) -> &'a mut W {
384 self.variant(TXCTSC_A::TXCTSC_1)
385 }
386 #[doc = r"Sets the field bit"]
387 #[inline(always)]
388 pub fn set_bit(self) -> &'a mut W {
389 self.bit(true)
390 }
391 #[doc = r"Clears the field bit"]
392 #[inline(always)]
393 pub fn clear_bit(self) -> &'a mut W {
394 self.bit(false)
395 }
396 #[doc = r"Writes raw bits to the field"]
397 #[inline(always)]
398 pub fn bit(self, value: bool) -> &'a mut W {
399 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
400 self.w
401 }
402}
403#[doc = "Transmit CTS Source\n\nValue on reset: 0"]
404#[derive(Clone, Copy, Debug, PartialEq)]
405pub enum TXCTSSRC_A {
406 #[doc = "0: CTS input is the CTS_B pin."]
407 TXCTSSRC_0,
408 #[doc = "1: CTS input is the inverted Receiver Match result."]
409 TXCTSSRC_1,
410}
411impl From<TXCTSSRC_A> for bool {
412 #[inline(always)]
413 fn from(variant: TXCTSSRC_A) -> Self {
414 match variant {
415 TXCTSSRC_A::TXCTSSRC_0 => false,
416 TXCTSSRC_A::TXCTSSRC_1 => true,
417 }
418 }
419}
420#[doc = "Reader of field `TXCTSSRC`"]
421pub type TXCTSSRC_R = crate::R<bool, TXCTSSRC_A>;
422impl TXCTSSRC_R {
423 #[doc = r"Get enumerated values variant"]
424 #[inline(always)]
425 pub fn variant(&self) -> TXCTSSRC_A {
426 match self.bits {
427 false => TXCTSSRC_A::TXCTSSRC_0,
428 true => TXCTSSRC_A::TXCTSSRC_1,
429 }
430 }
431 #[doc = "Checks if the value of the field is `TXCTSSRC_0`"]
432 #[inline(always)]
433 pub fn is_txctssrc_0(&self) -> bool {
434 *self == TXCTSSRC_A::TXCTSSRC_0
435 }
436 #[doc = "Checks if the value of the field is `TXCTSSRC_1`"]
437 #[inline(always)]
438 pub fn is_txctssrc_1(&self) -> bool {
439 *self == TXCTSSRC_A::TXCTSSRC_1
440 }
441}
442#[doc = "Write proxy for field `TXCTSSRC`"]
443pub struct TXCTSSRC_W<'a> {
444 w: &'a mut W,
445}
446impl<'a> TXCTSSRC_W<'a> {
447 #[doc = r"Writes `variant` to the field"]
448 #[inline(always)]
449 pub fn variant(self, variant: TXCTSSRC_A) -> &'a mut W {
450 {
451 self.bit(variant.into())
452 }
453 }
454 #[doc = "CTS input is the CTS_B pin."]
455 #[inline(always)]
456 pub fn txctssrc_0(self) -> &'a mut W {
457 self.variant(TXCTSSRC_A::TXCTSSRC_0)
458 }
459 #[doc = "CTS input is the inverted Receiver Match result."]
460 #[inline(always)]
461 pub fn txctssrc_1(self) -> &'a mut W {
462 self.variant(TXCTSSRC_A::TXCTSSRC_1)
463 }
464 #[doc = r"Sets the field bit"]
465 #[inline(always)]
466 pub fn set_bit(self) -> &'a mut W {
467 self.bit(true)
468 }
469 #[doc = r"Clears the field bit"]
470 #[inline(always)]
471 pub fn clear_bit(self) -> &'a mut W {
472 self.bit(false)
473 }
474 #[doc = r"Writes raw bits to the field"]
475 #[inline(always)]
476 pub fn bit(self, value: bool) -> &'a mut W {
477 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
478 self.w
479 }
480}
481#[doc = "Reader of field `RTSWATER`"]
482pub type RTSWATER_R = crate::R<u8, u8>;
483#[doc = "Write proxy for field `RTSWATER`"]
484pub struct RTSWATER_W<'a> {
485 w: &'a mut W,
486}
487impl<'a> RTSWATER_W<'a> {
488 #[doc = r"Writes raw bits to the field"]
489 #[inline(always)]
490 pub unsafe fn bits(self, value: u8) -> &'a mut W {
491 self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
492 self.w
493 }
494}
495#[doc = "Transmitter narrow pulse\n\nValue on reset: 0"]
496#[derive(Clone, Copy, Debug, PartialEq)]
497pub enum TNP_A {
498 #[doc = "0: 1/OSR."]
499 TNP_0,
500 #[doc = "1: 2/OSR."]
501 TNP_1,
502 #[doc = "2: 3/OSR."]
503 TNP_2,
504 #[doc = "3: 4/OSR."]
505 TNP_3,
506}
507impl From<TNP_A> for u8 {
508 #[inline(always)]
509 fn from(variant: TNP_A) -> Self {
510 match variant {
511 TNP_A::TNP_0 => 0,
512 TNP_A::TNP_1 => 1,
513 TNP_A::TNP_2 => 2,
514 TNP_A::TNP_3 => 3,
515 }
516 }
517}
518#[doc = "Reader of field `TNP`"]
519pub type TNP_R = crate::R<u8, TNP_A>;
520impl TNP_R {
521 #[doc = r"Get enumerated values variant"]
522 #[inline(always)]
523 pub fn variant(&self) -> TNP_A {
524 match self.bits {
525 0 => TNP_A::TNP_0,
526 1 => TNP_A::TNP_1,
527 2 => TNP_A::TNP_2,
528 3 => TNP_A::TNP_3,
529 _ => unreachable!(),
530 }
531 }
532 #[doc = "Checks if the value of the field is `TNP_0`"]
533 #[inline(always)]
534 pub fn is_tnp_0(&self) -> bool {
535 *self == TNP_A::TNP_0
536 }
537 #[doc = "Checks if the value of the field is `TNP_1`"]
538 #[inline(always)]
539 pub fn is_tnp_1(&self) -> bool {
540 *self == TNP_A::TNP_1
541 }
542 #[doc = "Checks if the value of the field is `TNP_2`"]
543 #[inline(always)]
544 pub fn is_tnp_2(&self) -> bool {
545 *self == TNP_A::TNP_2
546 }
547 #[doc = "Checks if the value of the field is `TNP_3`"]
548 #[inline(always)]
549 pub fn is_tnp_3(&self) -> bool {
550 *self == TNP_A::TNP_3
551 }
552}
553#[doc = "Write proxy for field `TNP`"]
554pub struct TNP_W<'a> {
555 w: &'a mut W,
556}
557impl<'a> TNP_W<'a> {
558 #[doc = r"Writes `variant` to the field"]
559 #[inline(always)]
560 pub fn variant(self, variant: TNP_A) -> &'a mut W {
561 {
562 self.bits(variant.into())
563 }
564 }
565 #[doc = "1/OSR."]
566 #[inline(always)]
567 pub fn tnp_0(self) -> &'a mut W {
568 self.variant(TNP_A::TNP_0)
569 }
570 #[doc = "2/OSR."]
571 #[inline(always)]
572 pub fn tnp_1(self) -> &'a mut W {
573 self.variant(TNP_A::TNP_1)
574 }
575 #[doc = "3/OSR."]
576 #[inline(always)]
577 pub fn tnp_2(self) -> &'a mut W {
578 self.variant(TNP_A::TNP_2)
579 }
580 #[doc = "4/OSR."]
581 #[inline(always)]
582 pub fn tnp_3(self) -> &'a mut W {
583 self.variant(TNP_A::TNP_3)
584 }
585 #[doc = r"Writes raw bits to the field"]
586 #[inline(always)]
587 pub fn bits(self, value: u8) -> &'a mut W {
588 self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16);
589 self.w
590 }
591}
592#[doc = "Infrared enable\n\nValue on reset: 0"]
593#[derive(Clone, Copy, Debug, PartialEq)]
594pub enum IREN_A {
595 #[doc = "0: IR disabled."]
596 IREN_0,
597 #[doc = "1: IR enabled."]
598 IREN_1,
599}
600impl From<IREN_A> for bool {
601 #[inline(always)]
602 fn from(variant: IREN_A) -> Self {
603 match variant {
604 IREN_A::IREN_0 => false,
605 IREN_A::IREN_1 => true,
606 }
607 }
608}
609#[doc = "Reader of field `IREN`"]
610pub type IREN_R = crate::R<bool, IREN_A>;
611impl IREN_R {
612 #[doc = r"Get enumerated values variant"]
613 #[inline(always)]
614 pub fn variant(&self) -> IREN_A {
615 match self.bits {
616 false => IREN_A::IREN_0,
617 true => IREN_A::IREN_1,
618 }
619 }
620 #[doc = "Checks if the value of the field is `IREN_0`"]
621 #[inline(always)]
622 pub fn is_iren_0(&self) -> bool {
623 *self == IREN_A::IREN_0
624 }
625 #[doc = "Checks if the value of the field is `IREN_1`"]
626 #[inline(always)]
627 pub fn is_iren_1(&self) -> bool {
628 *self == IREN_A::IREN_1
629 }
630}
631#[doc = "Write proxy for field `IREN`"]
632pub struct IREN_W<'a> {
633 w: &'a mut W,
634}
635impl<'a> IREN_W<'a> {
636 #[doc = r"Writes `variant` to the field"]
637 #[inline(always)]
638 pub fn variant(self, variant: IREN_A) -> &'a mut W {
639 {
640 self.bit(variant.into())
641 }
642 }
643 #[doc = "IR disabled."]
644 #[inline(always)]
645 pub fn iren_0(self) -> &'a mut W {
646 self.variant(IREN_A::IREN_0)
647 }
648 #[doc = "IR enabled."]
649 #[inline(always)]
650 pub fn iren_1(self) -> &'a mut W {
651 self.variant(IREN_A::IREN_1)
652 }
653 #[doc = r"Sets the field bit"]
654 #[inline(always)]
655 pub fn set_bit(self) -> &'a mut W {
656 self.bit(true)
657 }
658 #[doc = r"Clears the field bit"]
659 #[inline(always)]
660 pub fn clear_bit(self) -> &'a mut W {
661 self.bit(false)
662 }
663 #[doc = r"Writes raw bits to the field"]
664 #[inline(always)]
665 pub fn bit(self, value: bool) -> &'a mut W {
666 self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
667 self.w
668 }
669}
670impl R {
671 #[doc = "Bit 0 - Transmitter clear-to-send enable"]
672 #[inline(always)]
673 pub fn txctse(&self) -> TXCTSE_R {
674 TXCTSE_R::new((self.bits & 0x01) != 0)
675 }
676 #[doc = "Bit 1 - Transmitter request-to-send enable"]
677 #[inline(always)]
678 pub fn txrtse(&self) -> TXRTSE_R {
679 TXRTSE_R::new(((self.bits >> 1) & 0x01) != 0)
680 }
681 #[doc = "Bit 2 - Transmitter request-to-send polarity"]
682 #[inline(always)]
683 pub fn txrtspol(&self) -> TXRTSPOL_R {
684 TXRTSPOL_R::new(((self.bits >> 2) & 0x01) != 0)
685 }
686 #[doc = "Bit 3 - Receiver request-to-send enable"]
687 #[inline(always)]
688 pub fn rxrtse(&self) -> RXRTSE_R {
689 RXRTSE_R::new(((self.bits >> 3) & 0x01) != 0)
690 }
691 #[doc = "Bit 4 - Transmit CTS Configuration"]
692 #[inline(always)]
693 pub fn txctsc(&self) -> TXCTSC_R {
694 TXCTSC_R::new(((self.bits >> 4) & 0x01) != 0)
695 }
696 #[doc = "Bit 5 - Transmit CTS Source"]
697 #[inline(always)]
698 pub fn txctssrc(&self) -> TXCTSSRC_R {
699 TXCTSSRC_R::new(((self.bits >> 5) & 0x01) != 0)
700 }
701 #[doc = "Bits 8:10 - Receive RTS Configuration"]
702 #[inline(always)]
703 pub fn rtswater(&self) -> RTSWATER_R {
704 RTSWATER_R::new(((self.bits >> 8) & 0x07) as u8)
705 }
706 #[doc = "Bits 16:17 - Transmitter narrow pulse"]
707 #[inline(always)]
708 pub fn tnp(&self) -> TNP_R {
709 TNP_R::new(((self.bits >> 16) & 0x03) as u8)
710 }
711 #[doc = "Bit 18 - Infrared enable"]
712 #[inline(always)]
713 pub fn iren(&self) -> IREN_R {
714 IREN_R::new(((self.bits >> 18) & 0x01) != 0)
715 }
716}
717impl W {
718 #[doc = "Bit 0 - Transmitter clear-to-send enable"]
719 #[inline(always)]
720 pub fn txctse(&mut self) -> TXCTSE_W {
721 TXCTSE_W { w: self }
722 }
723 #[doc = "Bit 1 - Transmitter request-to-send enable"]
724 #[inline(always)]
725 pub fn txrtse(&mut self) -> TXRTSE_W {
726 TXRTSE_W { w: self }
727 }
728 #[doc = "Bit 2 - Transmitter request-to-send polarity"]
729 #[inline(always)]
730 pub fn txrtspol(&mut self) -> TXRTSPOL_W {
731 TXRTSPOL_W { w: self }
732 }
733 #[doc = "Bit 3 - Receiver request-to-send enable"]
734 #[inline(always)]
735 pub fn rxrtse(&mut self) -> RXRTSE_W {
736 RXRTSE_W { w: self }
737 }
738 #[doc = "Bit 4 - Transmit CTS Configuration"]
739 #[inline(always)]
740 pub fn txctsc(&mut self) -> TXCTSC_W {
741 TXCTSC_W { w: self }
742 }
743 #[doc = "Bit 5 - Transmit CTS Source"]
744 #[inline(always)]
745 pub fn txctssrc(&mut self) -> TXCTSSRC_W {
746 TXCTSSRC_W { w: self }
747 }
748 #[doc = "Bits 8:10 - Receive RTS Configuration"]
749 #[inline(always)]
750 pub fn rtswater(&mut self) -> RTSWATER_W {
751 RTSWATER_W { w: self }
752 }
753 #[doc = "Bits 16:17 - Transmitter narrow pulse"]
754 #[inline(always)]
755 pub fn tnp(&mut self) -> TNP_W {
756 TNP_W { w: self }
757 }
758 #[doc = "Bit 18 - Infrared enable"]
759 #[inline(always)]
760 pub fn iren(&mut self) -> IREN_W {
761 IREN_W { w: self }
762 }
763}