1#[doc = "Register `transmit_config` reader"]
2pub struct R(crate::R<TRANSMIT_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<TRANSMIT_CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<TRANSMIT_CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<TRANSMIT_CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `transmit_config` writer"]
17pub struct W(crate::W<TRANSMIT_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<TRANSMIT_CONFIG_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<TRANSMIT_CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<TRANSMIT_CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `function` reader - Enable transmit function"]
38pub type FUNCTION_R = crate::BitReader<FUNCTION_A>;
39#[doc = "Enable transmit function\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum FUNCTION_A {
42 #[doc = "1: Enable UART receive function signal"]
43 ENABLE = 1,
44 #[doc = "0: Disable UART receive function signal"]
45 DISABLE = 0,
46}
47impl From<FUNCTION_A> for bool {
48 #[inline(always)]
49 fn from(variant: FUNCTION_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl FUNCTION_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> FUNCTION_A {
57 match self.bits {
58 true => FUNCTION_A::ENABLE,
59 false => FUNCTION_A::DISABLE,
60 }
61 }
62 #[doc = "Checks if the value of the field is `ENABLE`"]
63 #[inline(always)]
64 pub fn is_enable(&self) -> bool {
65 *self == FUNCTION_A::ENABLE
66 }
67 #[doc = "Checks if the value of the field is `DISABLE`"]
68 #[inline(always)]
69 pub fn is_disable(&self) -> bool {
70 *self == FUNCTION_A::DISABLE
71 }
72}
73#[doc = "Field `function` writer - Enable transmit function"]
74pub type FUNCTION_W<'a, const O: u8> =
75 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, FUNCTION_A, O>;
76impl<'a, const O: u8> FUNCTION_W<'a, O> {
77 #[doc = "Enable UART receive function signal"]
78 #[inline(always)]
79 pub fn enable(self) -> &'a mut W {
80 self.variant(FUNCTION_A::ENABLE)
81 }
82 #[doc = "Disable UART receive function signal"]
83 #[inline(always)]
84 pub fn disable(self) -> &'a mut W {
85 self.variant(FUNCTION_A::DISABLE)
86 }
87}
88#[doc = "Field `cts` reader - Enable Clear-to-Send flow control signal"]
89pub type CTS_R = crate::BitReader<CTS_A>;
90#[doc = "Enable Clear-to-Send flow control signal\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum CTS_A {
93 #[doc = "1: Enable Clear-to-Send flow control signal"]
94 ENABLE = 1,
95 #[doc = "0: Disable Clear-to-Send flow control signal"]
96 DISABLE = 0,
97}
98impl From<CTS_A> for bool {
99 #[inline(always)]
100 fn from(variant: CTS_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl CTS_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> CTS_A {
108 match self.bits {
109 true => CTS_A::ENABLE,
110 false => CTS_A::DISABLE,
111 }
112 }
113 #[doc = "Checks if the value of the field is `ENABLE`"]
114 #[inline(always)]
115 pub fn is_enable(&self) -> bool {
116 *self == CTS_A::ENABLE
117 }
118 #[doc = "Checks if the value of the field is `DISABLE`"]
119 #[inline(always)]
120 pub fn is_disable(&self) -> bool {
121 *self == CTS_A::DISABLE
122 }
123}
124#[doc = "Field `cts` writer - Enable Clear-to-Send flow control signal"]
125pub type CTS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, CTS_A, O>;
126impl<'a, const O: u8> CTS_W<'a, O> {
127 #[doc = "Enable Clear-to-Send flow control signal"]
128 #[inline(always)]
129 pub fn enable(self) -> &'a mut W {
130 self.variant(CTS_A::ENABLE)
131 }
132 #[doc = "Disable Clear-to-Send flow control signal"]
133 #[inline(always)]
134 pub fn disable(self) -> &'a mut W {
135 self.variant(CTS_A::DISABLE)
136 }
137}
138#[doc = "Field `freerun` reader - Enable freerun mode"]
139pub type FREERUN_R = crate::BitReader<FREERUN_A>;
140#[doc = "Enable freerun mode\n\nValue on reset: 0"]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum FREERUN_A {
143 #[doc = "1: Enable freerun mode"]
144 ENABLE = 1,
145 #[doc = "0: Disable freerun mode"]
146 DISABLE = 0,
147}
148impl From<FREERUN_A> for bool {
149 #[inline(always)]
150 fn from(variant: FREERUN_A) -> Self {
151 variant as u8 != 0
152 }
153}
154impl FREERUN_R {
155 #[doc = "Get enumerated values variant"]
156 #[inline(always)]
157 pub fn variant(&self) -> FREERUN_A {
158 match self.bits {
159 true => FREERUN_A::ENABLE,
160 false => FREERUN_A::DISABLE,
161 }
162 }
163 #[doc = "Checks if the value of the field is `ENABLE`"]
164 #[inline(always)]
165 pub fn is_enable(&self) -> bool {
166 *self == FREERUN_A::ENABLE
167 }
168 #[doc = "Checks if the value of the field is `DISABLE`"]
169 #[inline(always)]
170 pub fn is_disable(&self) -> bool {
171 *self == FREERUN_A::DISABLE
172 }
173}
174#[doc = "Field `freerun` writer - Enable freerun mode"]
175pub type FREERUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, FREERUN_A, O>;
176impl<'a, const O: u8> FREERUN_W<'a, O> {
177 #[doc = "Enable freerun mode"]
178 #[inline(always)]
179 pub fn enable(self) -> &'a mut W {
180 self.variant(FREERUN_A::ENABLE)
181 }
182 #[doc = "Disable freerun mode"]
183 #[inline(always)]
184 pub fn disable(self) -> &'a mut W {
185 self.variant(FREERUN_A::DISABLE)
186 }
187}
188#[doc = "Field `lin_transmit` reader - Local Interconnect Network protocol enable"]
189pub type LIN_TRANSMIT_R = crate::BitReader<LIN_TRANSMIT_A>;
190#[doc = "Local Interconnect Network protocol enable\n\nValue on reset: 0"]
191#[derive(Clone, Copy, Debug, PartialEq, Eq)]
192pub enum LIN_TRANSMIT_A {
193 #[doc = "1: Enable Local Interconnect Network protocol"]
194 ENABLE = 1,
195 #[doc = "0: Disable Local Interconnect Network protocol"]
196 DISABLE = 0,
197}
198impl From<LIN_TRANSMIT_A> for bool {
199 #[inline(always)]
200 fn from(variant: LIN_TRANSMIT_A) -> Self {
201 variant as u8 != 0
202 }
203}
204impl LIN_TRANSMIT_R {
205 #[doc = "Get enumerated values variant"]
206 #[inline(always)]
207 pub fn variant(&self) -> LIN_TRANSMIT_A {
208 match self.bits {
209 true => LIN_TRANSMIT_A::ENABLE,
210 false => LIN_TRANSMIT_A::DISABLE,
211 }
212 }
213 #[doc = "Checks if the value of the field is `ENABLE`"]
214 #[inline(always)]
215 pub fn is_enable(&self) -> bool {
216 *self == LIN_TRANSMIT_A::ENABLE
217 }
218 #[doc = "Checks if the value of the field is `DISABLE`"]
219 #[inline(always)]
220 pub fn is_disable(&self) -> bool {
221 *self == LIN_TRANSMIT_A::DISABLE
222 }
223}
224#[doc = "Field `lin_transmit` writer - Local Interconnect Network protocol enable"]
225pub type LIN_TRANSMIT_W<'a, const O: u8> =
226 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, LIN_TRANSMIT_A, O>;
227impl<'a, const O: u8> LIN_TRANSMIT_W<'a, O> {
228 #[doc = "Enable Local Interconnect Network protocol"]
229 #[inline(always)]
230 pub fn enable(self) -> &'a mut W {
231 self.variant(LIN_TRANSMIT_A::ENABLE)
232 }
233 #[doc = "Disable Local Interconnect Network protocol"]
234 #[inline(always)]
235 pub fn disable(self) -> &'a mut W {
236 self.variant(LIN_TRANSMIT_A::DISABLE)
237 }
238}
239#[doc = "Field `parity_enable` reader - Enable transmit parity check"]
240pub type PARITY_ENABLE_R = crate::BitReader<PARITY_ENABLE_A>;
241#[doc = "Enable transmit parity check\n\nValue on reset: 0"]
242#[derive(Clone, Copy, Debug, PartialEq, Eq)]
243pub enum PARITY_ENABLE_A {
244 #[doc = "1: Enable transmit parity check"]
245 ENABLE = 1,
246 #[doc = "0: Disable transmit parity check"]
247 DISABLE = 0,
248}
249impl From<PARITY_ENABLE_A> for bool {
250 #[inline(always)]
251 fn from(variant: PARITY_ENABLE_A) -> Self {
252 variant as u8 != 0
253 }
254}
255impl PARITY_ENABLE_R {
256 #[doc = "Get enumerated values variant"]
257 #[inline(always)]
258 pub fn variant(&self) -> PARITY_ENABLE_A {
259 match self.bits {
260 true => PARITY_ENABLE_A::ENABLE,
261 false => PARITY_ENABLE_A::DISABLE,
262 }
263 }
264 #[doc = "Checks if the value of the field is `ENABLE`"]
265 #[inline(always)]
266 pub fn is_enable(&self) -> bool {
267 *self == PARITY_ENABLE_A::ENABLE
268 }
269 #[doc = "Checks if the value of the field is `DISABLE`"]
270 #[inline(always)]
271 pub fn is_disable(&self) -> bool {
272 *self == PARITY_ENABLE_A::DISABLE
273 }
274}
275#[doc = "Field `parity_enable` writer - Enable transmit parity check"]
276pub type PARITY_ENABLE_W<'a, const O: u8> =
277 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, PARITY_ENABLE_A, O>;
278impl<'a, const O: u8> PARITY_ENABLE_W<'a, O> {
279 #[doc = "Enable transmit parity check"]
280 #[inline(always)]
281 pub fn enable(self) -> &'a mut W {
282 self.variant(PARITY_ENABLE_A::ENABLE)
283 }
284 #[doc = "Disable transmit parity check"]
285 #[inline(always)]
286 pub fn disable(self) -> &'a mut W {
287 self.variant(PARITY_ENABLE_A::DISABLE)
288 }
289}
290#[doc = "Field `parity_mode` reader - Select transmit parity mode if enabled"]
291pub type PARITY_MODE_R = crate::BitReader<PARITY_MODE_A>;
292#[doc = "Select transmit parity mode if enabled\n\nValue on reset: 0"]
293#[derive(Clone, Copy, Debug, PartialEq, Eq)]
294pub enum PARITY_MODE_A {
295 #[doc = "1: Odd parity if `parity_enable` is set"]
296 ODD = 1,
297 #[doc = "0: Even parity if `parity_enable` is set"]
298 EVEN = 0,
299}
300impl From<PARITY_MODE_A> for bool {
301 #[inline(always)]
302 fn from(variant: PARITY_MODE_A) -> Self {
303 variant as u8 != 0
304 }
305}
306impl PARITY_MODE_R {
307 #[doc = "Get enumerated values variant"]
308 #[inline(always)]
309 pub fn variant(&self) -> PARITY_MODE_A {
310 match self.bits {
311 true => PARITY_MODE_A::ODD,
312 false => PARITY_MODE_A::EVEN,
313 }
314 }
315 #[doc = "Checks if the value of the field is `ODD`"]
316 #[inline(always)]
317 pub fn is_odd(&self) -> bool {
318 *self == PARITY_MODE_A::ODD
319 }
320 #[doc = "Checks if the value of the field is `EVEN`"]
321 #[inline(always)]
322 pub fn is_even(&self) -> bool {
323 *self == PARITY_MODE_A::EVEN
324 }
325}
326#[doc = "Field `parity_mode` writer - Select transmit parity mode if enabled"]
327pub type PARITY_MODE_W<'a, const O: u8> =
328 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, PARITY_MODE_A, O>;
329impl<'a, const O: u8> PARITY_MODE_W<'a, O> {
330 #[doc = "Odd parity if `parity_enable` is set"]
331 #[inline(always)]
332 pub fn odd(self) -> &'a mut W {
333 self.variant(PARITY_MODE_A::ODD)
334 }
335 #[doc = "Even parity if `parity_enable` is set"]
336 #[inline(always)]
337 pub fn even(self) -> &'a mut W {
338 self.variant(PARITY_MODE_A::EVEN)
339 }
340}
341#[doc = "Field `ir_transmit` reader - Enable IR transmit mode"]
342pub type IR_TRANSMIT_R = crate::BitReader<IR_TRANSMIT_A>;
343#[doc = "Enable IR transmit mode\n\nValue on reset: 0"]
344#[derive(Clone, Copy, Debug, PartialEq, Eq)]
345pub enum IR_TRANSMIT_A {
346 #[doc = "1: Enable IR transmit mode"]
347 ENABLE = 1,
348 #[doc = "0: Disable IR transmit mode"]
349 DISABLE = 0,
350}
351impl From<IR_TRANSMIT_A> for bool {
352 #[inline(always)]
353 fn from(variant: IR_TRANSMIT_A) -> Self {
354 variant as u8 != 0
355 }
356}
357impl IR_TRANSMIT_R {
358 #[doc = "Get enumerated values variant"]
359 #[inline(always)]
360 pub fn variant(&self) -> IR_TRANSMIT_A {
361 match self.bits {
362 true => IR_TRANSMIT_A::ENABLE,
363 false => IR_TRANSMIT_A::DISABLE,
364 }
365 }
366 #[doc = "Checks if the value of the field is `ENABLE`"]
367 #[inline(always)]
368 pub fn is_enable(&self) -> bool {
369 *self == IR_TRANSMIT_A::ENABLE
370 }
371 #[doc = "Checks if the value of the field is `DISABLE`"]
372 #[inline(always)]
373 pub fn is_disable(&self) -> bool {
374 *self == IR_TRANSMIT_A::DISABLE
375 }
376}
377#[doc = "Field `ir_transmit` writer - Enable IR transmit mode"]
378pub type IR_TRANSMIT_W<'a, const O: u8> =
379 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, IR_TRANSMIT_A, O>;
380impl<'a, const O: u8> IR_TRANSMIT_W<'a, O> {
381 #[doc = "Enable IR transmit mode"]
382 #[inline(always)]
383 pub fn enable(self) -> &'a mut W {
384 self.variant(IR_TRANSMIT_A::ENABLE)
385 }
386 #[doc = "Disable IR transmit mode"]
387 #[inline(always)]
388 pub fn disable(self) -> &'a mut W {
389 self.variant(IR_TRANSMIT_A::DISABLE)
390 }
391}
392#[doc = "Field `ir_inverse` reader - Inverse transmit signal output in IR mode"]
393pub type IR_INVERSE_R = crate::BitReader<IR_INVERSE_A>;
394#[doc = "Inverse transmit signal output in IR mode\n\nValue on reset: 0"]
395#[derive(Clone, Copy, Debug, PartialEq, Eq)]
396pub enum IR_INVERSE_A {
397 #[doc = "1: Inverse transmit input in IR mode"]
398 INVERSE = 1,
399 #[doc = "0: Don't inverse transmit input in IR mode"]
400 NO_INVERSE = 0,
401}
402impl From<IR_INVERSE_A> for bool {
403 #[inline(always)]
404 fn from(variant: IR_INVERSE_A) -> Self {
405 variant as u8 != 0
406 }
407}
408impl IR_INVERSE_R {
409 #[doc = "Get enumerated values variant"]
410 #[inline(always)]
411 pub fn variant(&self) -> IR_INVERSE_A {
412 match self.bits {
413 true => IR_INVERSE_A::INVERSE,
414 false => IR_INVERSE_A::NO_INVERSE,
415 }
416 }
417 #[doc = "Checks if the value of the field is `INVERSE`"]
418 #[inline(always)]
419 pub fn is_inverse(&self) -> bool {
420 *self == IR_INVERSE_A::INVERSE
421 }
422 #[doc = "Checks if the value of the field is `NO_INVERSE`"]
423 #[inline(always)]
424 pub fn is_no_inverse(&self) -> bool {
425 *self == IR_INVERSE_A::NO_INVERSE
426 }
427}
428#[doc = "Field `ir_inverse` writer - Inverse transmit signal output in IR mode"]
429pub type IR_INVERSE_W<'a, const O: u8> =
430 crate::BitWriter<'a, u32, TRANSMIT_CONFIG_SPEC, IR_INVERSE_A, O>;
431impl<'a, const O: u8> IR_INVERSE_W<'a, O> {
432 #[doc = "Inverse transmit input in IR mode"]
433 #[inline(always)]
434 pub fn inverse(self) -> &'a mut W {
435 self.variant(IR_INVERSE_A::INVERSE)
436 }
437 #[doc = "Don't inverse transmit input in IR mode"]
438 #[inline(always)]
439 pub fn no_inverse(self) -> &'a mut W {
440 self.variant(IR_INVERSE_A::NO_INVERSE)
441 }
442}
443#[doc = "Field `word_length` reader - Bit count for each transmit data word"]
444pub type WORD_LENGTH_R = crate::FieldReader<u8, WORD_LENGTH_A>;
445#[doc = "Bit count for each transmit data word\n\nValue on reset: 7"]
446#[derive(Clone, Copy, Debug, PartialEq, Eq)]
447#[repr(u8)]
448pub enum WORD_LENGTH_A {
449 #[doc = "4: Each word includes 5 bits"]
450 FIVE = 4,
451 #[doc = "5: Each word includes 6 bits"]
452 SIX = 5,
453 #[doc = "6: Each word includes 7 bits"]
454 SEVEN = 6,
455 #[doc = "7: Each word includes 8 bits"]
456 EIGHT = 7,
457}
458impl From<WORD_LENGTH_A> for u8 {
459 #[inline(always)]
460 fn from(variant: WORD_LENGTH_A) -> Self {
461 variant as _
462 }
463}
464impl WORD_LENGTH_R {
465 #[doc = "Get enumerated values variant"]
466 #[inline(always)]
467 pub fn variant(&self) -> Option<WORD_LENGTH_A> {
468 match self.bits {
469 4 => Some(WORD_LENGTH_A::FIVE),
470 5 => Some(WORD_LENGTH_A::SIX),
471 6 => Some(WORD_LENGTH_A::SEVEN),
472 7 => Some(WORD_LENGTH_A::EIGHT),
473 _ => None,
474 }
475 }
476 #[doc = "Checks if the value of the field is `FIVE`"]
477 #[inline(always)]
478 pub fn is_five(&self) -> bool {
479 *self == WORD_LENGTH_A::FIVE
480 }
481 #[doc = "Checks if the value of the field is `SIX`"]
482 #[inline(always)]
483 pub fn is_six(&self) -> bool {
484 *self == WORD_LENGTH_A::SIX
485 }
486 #[doc = "Checks if the value of the field is `SEVEN`"]
487 #[inline(always)]
488 pub fn is_seven(&self) -> bool {
489 *self == WORD_LENGTH_A::SEVEN
490 }
491 #[doc = "Checks if the value of the field is `EIGHT`"]
492 #[inline(always)]
493 pub fn is_eight(&self) -> bool {
494 *self == WORD_LENGTH_A::EIGHT
495 }
496}
497#[doc = "Field `word_length` writer - Bit count for each transmit data word"]
498pub type WORD_LENGTH_W<'a, const O: u8> =
499 crate::FieldWriter<'a, u32, TRANSMIT_CONFIG_SPEC, u8, WORD_LENGTH_A, 3, O>;
500impl<'a, const O: u8> WORD_LENGTH_W<'a, O> {
501 #[doc = "Each word includes 5 bits"]
502 #[inline(always)]
503 pub fn five(self) -> &'a mut W {
504 self.variant(WORD_LENGTH_A::FIVE)
505 }
506 #[doc = "Each word includes 6 bits"]
507 #[inline(always)]
508 pub fn six(self) -> &'a mut W {
509 self.variant(WORD_LENGTH_A::SIX)
510 }
511 #[doc = "Each word includes 7 bits"]
512 #[inline(always)]
513 pub fn seven(self) -> &'a mut W {
514 self.variant(WORD_LENGTH_A::SEVEN)
515 }
516 #[doc = "Each word includes 8 bits"]
517 #[inline(always)]
518 pub fn eight(self) -> &'a mut W {
519 self.variant(WORD_LENGTH_A::EIGHT)
520 }
521}
522#[doc = "Field `stop_bits` reader - Number of stop bits"]
523pub type STOP_BITS_R = crate::FieldReader<u8, STOP_BITS_A>;
524#[doc = "Number of stop bits\n\nValue on reset: 1"]
525#[derive(Clone, Copy, Debug, PartialEq, Eq)]
526#[repr(u8)]
527pub enum STOP_BITS_A {
528 #[doc = "0: 0.5 stop bits"]
529 ZERO_P_FIVE = 0,
530 #[doc = "1: 1 stop bit"]
531 ONE = 1,
532 #[doc = "2: 1.5 stop bits"]
533 ONE_P_FIVE = 2,
534 #[doc = "3: 2 stop bits"]
535 TWO = 3,
536}
537impl From<STOP_BITS_A> for u8 {
538 #[inline(always)]
539 fn from(variant: STOP_BITS_A) -> Self {
540 variant as _
541 }
542}
543impl STOP_BITS_R {
544 #[doc = "Get enumerated values variant"]
545 #[inline(always)]
546 pub fn variant(&self) -> STOP_BITS_A {
547 match self.bits {
548 0 => STOP_BITS_A::ZERO_P_FIVE,
549 1 => STOP_BITS_A::ONE,
550 2 => STOP_BITS_A::ONE_P_FIVE,
551 3 => STOP_BITS_A::TWO,
552 _ => unreachable!(),
553 }
554 }
555 #[doc = "Checks if the value of the field is `ZERO_P_FIVE`"]
556 #[inline(always)]
557 pub fn is_zero_p_five(&self) -> bool {
558 *self == STOP_BITS_A::ZERO_P_FIVE
559 }
560 #[doc = "Checks if the value of the field is `ONE`"]
561 #[inline(always)]
562 pub fn is_one(&self) -> bool {
563 *self == STOP_BITS_A::ONE
564 }
565 #[doc = "Checks if the value of the field is `ONE_P_FIVE`"]
566 #[inline(always)]
567 pub fn is_one_p_five(&self) -> bool {
568 *self == STOP_BITS_A::ONE_P_FIVE
569 }
570 #[doc = "Checks if the value of the field is `TWO`"]
571 #[inline(always)]
572 pub fn is_two(&self) -> bool {
573 *self == STOP_BITS_A::TWO
574 }
575}
576#[doc = "Field `stop_bits` writer - Number of stop bits"]
577pub type STOP_BITS_W<'a, const O: u8> =
578 crate::FieldWriterSafe<'a, u32, TRANSMIT_CONFIG_SPEC, u8, STOP_BITS_A, 2, O>;
579impl<'a, const O: u8> STOP_BITS_W<'a, O> {
580 #[doc = "0.5 stop bits"]
581 #[inline(always)]
582 pub fn zero_p_five(self) -> &'a mut W {
583 self.variant(STOP_BITS_A::ZERO_P_FIVE)
584 }
585 #[doc = "1 stop bit"]
586 #[inline(always)]
587 pub fn one(self) -> &'a mut W {
588 self.variant(STOP_BITS_A::ONE)
589 }
590 #[doc = "1.5 stop bits"]
591 #[inline(always)]
592 pub fn one_p_five(self) -> &'a mut W {
593 self.variant(STOP_BITS_A::ONE_P_FIVE)
594 }
595 #[doc = "2 stop bits"]
596 #[inline(always)]
597 pub fn two(self) -> &'a mut W {
598 self.variant(STOP_BITS_A::TWO)
599 }
600}
601#[doc = "Field `break_bits` reader - Number of break bits for LIN protocol"]
602pub type BREAK_BITS_R = crate::FieldReader<u8, u8>;
603#[doc = "Field `break_bits` writer - Number of break bits for LIN protocol"]
604pub type BREAK_BITS_W<'a, const O: u8> =
605 crate::FieldWriter<'a, u32, TRANSMIT_CONFIG_SPEC, u8, u8, 3, O>;
606#[doc = "Field `transfer_length` reader - Length of words per UART transmit transfer\n\n This field is ignored when `freerun` mode is enabled."]
607pub type TRANSFER_LENGTH_R = crate::FieldReader<u16, u16>;
608#[doc = "Field `transfer_length` writer - Length of words per UART transmit transfer\n\n This field is ignored when `freerun` mode is enabled."]
609pub type TRANSFER_LENGTH_W<'a, const O: u8> =
610 crate::FieldWriter<'a, u32, TRANSMIT_CONFIG_SPEC, u16, u16, 16, O>;
611impl R {
612 #[doc = "Bit 0 - Enable transmit function"]
613 #[inline(always)]
614 pub fn function(&self) -> FUNCTION_R {
615 FUNCTION_R::new((self.bits & 1) != 0)
616 }
617 #[doc = "Bit 1 - Enable Clear-to-Send flow control signal"]
618 #[inline(always)]
619 pub fn cts(&self) -> CTS_R {
620 CTS_R::new(((self.bits >> 1) & 1) != 0)
621 }
622 #[doc = "Bit 2 - Enable freerun mode"]
623 #[inline(always)]
624 pub fn freerun(&self) -> FREERUN_R {
625 FREERUN_R::new(((self.bits >> 2) & 1) != 0)
626 }
627 #[doc = "Bit 3 - Local Interconnect Network protocol enable"]
628 #[inline(always)]
629 pub fn lin_transmit(&self) -> LIN_TRANSMIT_R {
630 LIN_TRANSMIT_R::new(((self.bits >> 3) & 1) != 0)
631 }
632 #[doc = "Bit 4 - Enable transmit parity check"]
633 #[inline(always)]
634 pub fn parity_enable(&self) -> PARITY_ENABLE_R {
635 PARITY_ENABLE_R::new(((self.bits >> 4) & 1) != 0)
636 }
637 #[doc = "Bit 5 - Select transmit parity mode if enabled"]
638 #[inline(always)]
639 pub fn parity_mode(&self) -> PARITY_MODE_R {
640 PARITY_MODE_R::new(((self.bits >> 5) & 1) != 0)
641 }
642 #[doc = "Bit 6 - Enable IR transmit mode"]
643 #[inline(always)]
644 pub fn ir_transmit(&self) -> IR_TRANSMIT_R {
645 IR_TRANSMIT_R::new(((self.bits >> 6) & 1) != 0)
646 }
647 #[doc = "Bit 7 - Inverse transmit signal output in IR mode"]
648 #[inline(always)]
649 pub fn ir_inverse(&self) -> IR_INVERSE_R {
650 IR_INVERSE_R::new(((self.bits >> 7) & 1) != 0)
651 }
652 #[doc = "Bits 8:10 - Bit count for each transmit data word"]
653 #[inline(always)]
654 pub fn word_length(&self) -> WORD_LENGTH_R {
655 WORD_LENGTH_R::new(((self.bits >> 8) & 7) as u8)
656 }
657 #[doc = "Bits 11:12 - Number of stop bits"]
658 #[inline(always)]
659 pub fn stop_bits(&self) -> STOP_BITS_R {
660 STOP_BITS_R::new(((self.bits >> 11) & 3) as u8)
661 }
662 #[doc = "Bits 13:15 - Number of break bits for LIN protocol"]
663 #[inline(always)]
664 pub fn break_bits(&self) -> BREAK_BITS_R {
665 BREAK_BITS_R::new(((self.bits >> 13) & 7) as u8)
666 }
667 #[doc = "Bits 16:31 - Length of words per UART transmit transfer\n\n This field is ignored when `freerun` mode is enabled."]
668 #[inline(always)]
669 pub fn transfer_length(&self) -> TRANSFER_LENGTH_R {
670 TRANSFER_LENGTH_R::new(((self.bits >> 16) & 0xffff) as u16)
671 }
672}
673impl W {
674 #[doc = "Bit 0 - Enable transmit function"]
675 #[inline(always)]
676 pub fn function(&mut self) -> FUNCTION_W<0> {
677 FUNCTION_W::new(self)
678 }
679 #[doc = "Bit 1 - Enable Clear-to-Send flow control signal"]
680 #[inline(always)]
681 pub fn cts(&mut self) -> CTS_W<1> {
682 CTS_W::new(self)
683 }
684 #[doc = "Bit 2 - Enable freerun mode"]
685 #[inline(always)]
686 pub fn freerun(&mut self) -> FREERUN_W<2> {
687 FREERUN_W::new(self)
688 }
689 #[doc = "Bit 3 - Local Interconnect Network protocol enable"]
690 #[inline(always)]
691 pub fn lin_transmit(&mut self) -> LIN_TRANSMIT_W<3> {
692 LIN_TRANSMIT_W::new(self)
693 }
694 #[doc = "Bit 4 - Enable transmit parity check"]
695 #[inline(always)]
696 pub fn parity_enable(&mut self) -> PARITY_ENABLE_W<4> {
697 PARITY_ENABLE_W::new(self)
698 }
699 #[doc = "Bit 5 - Select transmit parity mode if enabled"]
700 #[inline(always)]
701 pub fn parity_mode(&mut self) -> PARITY_MODE_W<5> {
702 PARITY_MODE_W::new(self)
703 }
704 #[doc = "Bit 6 - Enable IR transmit mode"]
705 #[inline(always)]
706 pub fn ir_transmit(&mut self) -> IR_TRANSMIT_W<6> {
707 IR_TRANSMIT_W::new(self)
708 }
709 #[doc = "Bit 7 - Inverse transmit signal output in IR mode"]
710 #[inline(always)]
711 pub fn ir_inverse(&mut self) -> IR_INVERSE_W<7> {
712 IR_INVERSE_W::new(self)
713 }
714 #[doc = "Bits 8:10 - Bit count for each transmit data word"]
715 #[inline(always)]
716 pub fn word_length(&mut self) -> WORD_LENGTH_W<8> {
717 WORD_LENGTH_W::new(self)
718 }
719 #[doc = "Bits 11:12 - Number of stop bits"]
720 #[inline(always)]
721 pub fn stop_bits(&mut self) -> STOP_BITS_W<11> {
722 STOP_BITS_W::new(self)
723 }
724 #[doc = "Bits 13:15 - Number of break bits for LIN protocol"]
725 #[inline(always)]
726 pub fn break_bits(&mut self) -> BREAK_BITS_W<13> {
727 BREAK_BITS_W::new(self)
728 }
729 #[doc = "Bits 16:31 - Length of words per UART transmit transfer\n\n This field is ignored when `freerun` mode is enabled."]
730 #[inline(always)]
731 pub fn transfer_length(&mut self) -> TRANSFER_LENGTH_W<16> {
732 TRANSFER_LENGTH_W::new(self)
733 }
734 #[doc = "Writes raw bits to the register."]
735 #[inline(always)]
736 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
737 self.0.bits(bits);
738 self
739 }
740}
741#[doc = "Transmit configuration 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 [transmit_config](index.html) module"]
742pub struct TRANSMIT_CONFIG_SPEC;
743impl crate::RegisterSpec for TRANSMIT_CONFIG_SPEC {
744 type Ux = u32;
745}
746#[doc = "`read()` method returns [transmit_config::R](R) reader structure"]
747impl crate::Readable for TRANSMIT_CONFIG_SPEC {
748 type Reader = R;
749}
750#[doc = "`write(|w| ..)` method takes [transmit_config::W](W) writer structure"]
751impl crate::Writable for TRANSMIT_CONFIG_SPEC {
752 type Writer = W;
753}
754#[doc = "`reset()` method sets transmit_config to value 0x8f00"]
755impl crate::Resettable for TRANSMIT_CONFIG_SPEC {
756 #[inline(always)]
757 fn reset_value() -> Self::Ux {
758 0x8f00
759 }
760}