atsam4n16c_pac/usart2/
mr.rs

1#[doc = "Register `MR` reader"]
2pub struct R(crate::R<MR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MR` writer"]
17pub struct W(crate::W<MR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MR_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<MR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `USART_MODE` reader - USART Mode of Operation"]
38pub type USART_MODE_R = crate::FieldReader<u8, USART_MODE_A>;
39#[doc = "USART Mode of Operation"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum USART_MODE_A {
43    #[doc = "0: Normal mode"]
44    NORMAL = 0,
45    #[doc = "1: RS485"]
46    RS485 = 1,
47    #[doc = "2: Hardware Handshaking"]
48    HW_HANDSHAKING = 2,
49    #[doc = "4: IS07816 Protocol: T = 0"]
50    IS07816_T_0 = 4,
51    #[doc = "6: IS07816 Protocol: T = 1"]
52    IS07816_T_1 = 6,
53    #[doc = "8: IrDA"]
54    IRDA = 8,
55    #[doc = "14: SPI Master"]
56    SPI_MASTER = 14,
57    #[doc = "15: SPI Slave"]
58    SPI_SLAVE = 15,
59}
60impl From<USART_MODE_A> for u8 {
61    #[inline(always)]
62    fn from(variant: USART_MODE_A) -> Self {
63        variant as _
64    }
65}
66impl USART_MODE_R {
67    #[doc = "Get enumerated values variant"]
68    #[inline(always)]
69    pub fn variant(&self) -> Option<USART_MODE_A> {
70        match self.bits {
71            0 => Some(USART_MODE_A::NORMAL),
72            1 => Some(USART_MODE_A::RS485),
73            2 => Some(USART_MODE_A::HW_HANDSHAKING),
74            4 => Some(USART_MODE_A::IS07816_T_0),
75            6 => Some(USART_MODE_A::IS07816_T_1),
76            8 => Some(USART_MODE_A::IRDA),
77            14 => Some(USART_MODE_A::SPI_MASTER),
78            15 => Some(USART_MODE_A::SPI_SLAVE),
79            _ => None,
80        }
81    }
82    #[doc = "Checks if the value of the field is `NORMAL`"]
83    #[inline(always)]
84    pub fn is_normal(&self) -> bool {
85        *self == USART_MODE_A::NORMAL
86    }
87    #[doc = "Checks if the value of the field is `RS485`"]
88    #[inline(always)]
89    pub fn is_rs485(&self) -> bool {
90        *self == USART_MODE_A::RS485
91    }
92    #[doc = "Checks if the value of the field is `HW_HANDSHAKING`"]
93    #[inline(always)]
94    pub fn is_hw_handshaking(&self) -> bool {
95        *self == USART_MODE_A::HW_HANDSHAKING
96    }
97    #[doc = "Checks if the value of the field is `IS07816_T_0`"]
98    #[inline(always)]
99    pub fn is_is07816_t_0(&self) -> bool {
100        *self == USART_MODE_A::IS07816_T_0
101    }
102    #[doc = "Checks if the value of the field is `IS07816_T_1`"]
103    #[inline(always)]
104    pub fn is_is07816_t_1(&self) -> bool {
105        *self == USART_MODE_A::IS07816_T_1
106    }
107    #[doc = "Checks if the value of the field is `IRDA`"]
108    #[inline(always)]
109    pub fn is_irda(&self) -> bool {
110        *self == USART_MODE_A::IRDA
111    }
112    #[doc = "Checks if the value of the field is `SPI_MASTER`"]
113    #[inline(always)]
114    pub fn is_spi_master(&self) -> bool {
115        *self == USART_MODE_A::SPI_MASTER
116    }
117    #[doc = "Checks if the value of the field is `SPI_SLAVE`"]
118    #[inline(always)]
119    pub fn is_spi_slave(&self) -> bool {
120        *self == USART_MODE_A::SPI_SLAVE
121    }
122}
123#[doc = "Field `USART_MODE` writer - USART Mode of Operation"]
124pub type USART_MODE_W<'a, const O: u8> =
125    crate::FieldWriter<'a, u32, MR_SPEC, u8, USART_MODE_A, 4, O>;
126impl<'a, const O: u8> USART_MODE_W<'a, O> {
127    #[doc = "Normal mode"]
128    #[inline(always)]
129    pub fn normal(self) -> &'a mut W {
130        self.variant(USART_MODE_A::NORMAL)
131    }
132    #[doc = "RS485"]
133    #[inline(always)]
134    pub fn rs485(self) -> &'a mut W {
135        self.variant(USART_MODE_A::RS485)
136    }
137    #[doc = "Hardware Handshaking"]
138    #[inline(always)]
139    pub fn hw_handshaking(self) -> &'a mut W {
140        self.variant(USART_MODE_A::HW_HANDSHAKING)
141    }
142    #[doc = "IS07816 Protocol: T = 0"]
143    #[inline(always)]
144    pub fn is07816_t_0(self) -> &'a mut W {
145        self.variant(USART_MODE_A::IS07816_T_0)
146    }
147    #[doc = "IS07816 Protocol: T = 1"]
148    #[inline(always)]
149    pub fn is07816_t_1(self) -> &'a mut W {
150        self.variant(USART_MODE_A::IS07816_T_1)
151    }
152    #[doc = "IrDA"]
153    #[inline(always)]
154    pub fn irda(self) -> &'a mut W {
155        self.variant(USART_MODE_A::IRDA)
156    }
157    #[doc = "SPI Master"]
158    #[inline(always)]
159    pub fn spi_master(self) -> &'a mut W {
160        self.variant(USART_MODE_A::SPI_MASTER)
161    }
162    #[doc = "SPI Slave"]
163    #[inline(always)]
164    pub fn spi_slave(self) -> &'a mut W {
165        self.variant(USART_MODE_A::SPI_SLAVE)
166    }
167}
168#[doc = "Field `USCLKS` reader - Clock Selection"]
169pub type USCLKS_R = crate::FieldReader<u8, USCLKS_A>;
170#[doc = "Clock Selection"]
171#[derive(Clone, Copy, Debug, PartialEq, Eq)]
172#[repr(u8)]
173pub enum USCLKS_A {
174    #[doc = "0: Master Clock MCK is selected"]
175    MCK = 0,
176    #[doc = "1: Internal Clock Divided MCK/DIV (DIV=8) is selected"]
177    DIV = 1,
178    #[doc = "3: Serial Clock SLK is selected"]
179    SCK = 3,
180}
181impl From<USCLKS_A> for u8 {
182    #[inline(always)]
183    fn from(variant: USCLKS_A) -> Self {
184        variant as _
185    }
186}
187impl USCLKS_R {
188    #[doc = "Get enumerated values variant"]
189    #[inline(always)]
190    pub fn variant(&self) -> Option<USCLKS_A> {
191        match self.bits {
192            0 => Some(USCLKS_A::MCK),
193            1 => Some(USCLKS_A::DIV),
194            3 => Some(USCLKS_A::SCK),
195            _ => None,
196        }
197    }
198    #[doc = "Checks if the value of the field is `MCK`"]
199    #[inline(always)]
200    pub fn is_mck(&self) -> bool {
201        *self == USCLKS_A::MCK
202    }
203    #[doc = "Checks if the value of the field is `DIV`"]
204    #[inline(always)]
205    pub fn is_div(&self) -> bool {
206        *self == USCLKS_A::DIV
207    }
208    #[doc = "Checks if the value of the field is `SCK`"]
209    #[inline(always)]
210    pub fn is_sck(&self) -> bool {
211        *self == USCLKS_A::SCK
212    }
213}
214#[doc = "Field `USCLKS` writer - Clock Selection"]
215pub type USCLKS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, USCLKS_A, 2, O>;
216impl<'a, const O: u8> USCLKS_W<'a, O> {
217    #[doc = "Master Clock MCK is selected"]
218    #[inline(always)]
219    pub fn mck(self) -> &'a mut W {
220        self.variant(USCLKS_A::MCK)
221    }
222    #[doc = "Internal Clock Divided MCK/DIV (DIV=8) is selected"]
223    #[inline(always)]
224    pub fn div(self) -> &'a mut W {
225        self.variant(USCLKS_A::DIV)
226    }
227    #[doc = "Serial Clock SLK is selected"]
228    #[inline(always)]
229    pub fn sck(self) -> &'a mut W {
230        self.variant(USCLKS_A::SCK)
231    }
232}
233#[doc = "Field `CHRL` reader - Character Length."]
234pub type CHRL_R = crate::FieldReader<u8, CHRL_A>;
235#[doc = "Character Length."]
236#[derive(Clone, Copy, Debug, PartialEq, Eq)]
237#[repr(u8)]
238pub enum CHRL_A {
239    #[doc = "0: Character length is 5 bits"]
240    _5_BIT = 0,
241    #[doc = "1: Character length is 6 bits"]
242    _6_BIT = 1,
243    #[doc = "2: Character length is 7 bits"]
244    _7_BIT = 2,
245    #[doc = "3: Character length is 8 bits"]
246    _8_BIT = 3,
247}
248impl From<CHRL_A> for u8 {
249    #[inline(always)]
250    fn from(variant: CHRL_A) -> Self {
251        variant as _
252    }
253}
254impl CHRL_R {
255    #[doc = "Get enumerated values variant"]
256    #[inline(always)]
257    pub fn variant(&self) -> CHRL_A {
258        match self.bits {
259            0 => CHRL_A::_5_BIT,
260            1 => CHRL_A::_6_BIT,
261            2 => CHRL_A::_7_BIT,
262            3 => CHRL_A::_8_BIT,
263            _ => unreachable!(),
264        }
265    }
266    #[doc = "Checks if the value of the field is `_5_BIT`"]
267    #[inline(always)]
268    pub fn is_5_bit(&self) -> bool {
269        *self == CHRL_A::_5_BIT
270    }
271    #[doc = "Checks if the value of the field is `_6_BIT`"]
272    #[inline(always)]
273    pub fn is_6_bit(&self) -> bool {
274        *self == CHRL_A::_6_BIT
275    }
276    #[doc = "Checks if the value of the field is `_7_BIT`"]
277    #[inline(always)]
278    pub fn is_7_bit(&self) -> bool {
279        *self == CHRL_A::_7_BIT
280    }
281    #[doc = "Checks if the value of the field is `_8_BIT`"]
282    #[inline(always)]
283    pub fn is_8_bit(&self) -> bool {
284        *self == CHRL_A::_8_BIT
285    }
286}
287#[doc = "Field `CHRL` writer - Character Length."]
288pub type CHRL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, MR_SPEC, u8, CHRL_A, 2, O>;
289impl<'a, const O: u8> CHRL_W<'a, O> {
290    #[doc = "Character length is 5 bits"]
291    #[inline(always)]
292    pub fn _5_bit(self) -> &'a mut W {
293        self.variant(CHRL_A::_5_BIT)
294    }
295    #[doc = "Character length is 6 bits"]
296    #[inline(always)]
297    pub fn _6_bit(self) -> &'a mut W {
298        self.variant(CHRL_A::_6_BIT)
299    }
300    #[doc = "Character length is 7 bits"]
301    #[inline(always)]
302    pub fn _7_bit(self) -> &'a mut W {
303        self.variant(CHRL_A::_7_BIT)
304    }
305    #[doc = "Character length is 8 bits"]
306    #[inline(always)]
307    pub fn _8_bit(self) -> &'a mut W {
308        self.variant(CHRL_A::_8_BIT)
309    }
310}
311#[doc = "Field `SYNC` reader - Synchronous Mode Select"]
312pub type SYNC_R = crate::BitReader<bool>;
313#[doc = "Field `SYNC` writer - Synchronous Mode Select"]
314pub type SYNC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
315#[doc = "Field `PAR` reader - Parity Type"]
316pub type PAR_R = crate::FieldReader<u8, PAR_A>;
317#[doc = "Parity Type"]
318#[derive(Clone, Copy, Debug, PartialEq, Eq)]
319#[repr(u8)]
320pub enum PAR_A {
321    #[doc = "0: Even parity"]
322    EVEN = 0,
323    #[doc = "1: Odd parity"]
324    ODD = 1,
325    #[doc = "2: Parity forced to 0 (Space)"]
326    SPACE = 2,
327    #[doc = "3: Parity forced to 1 (Mark)"]
328    MARK = 3,
329    #[doc = "4: No parity"]
330    NO = 4,
331    #[doc = "6: Multidrop mode"]
332    MULTIDROP = 6,
333}
334impl From<PAR_A> for u8 {
335    #[inline(always)]
336    fn from(variant: PAR_A) -> Self {
337        variant as _
338    }
339}
340impl PAR_R {
341    #[doc = "Get enumerated values variant"]
342    #[inline(always)]
343    pub fn variant(&self) -> Option<PAR_A> {
344        match self.bits {
345            0 => Some(PAR_A::EVEN),
346            1 => Some(PAR_A::ODD),
347            2 => Some(PAR_A::SPACE),
348            3 => Some(PAR_A::MARK),
349            4 => Some(PAR_A::NO),
350            6 => Some(PAR_A::MULTIDROP),
351            _ => None,
352        }
353    }
354    #[doc = "Checks if the value of the field is `EVEN`"]
355    #[inline(always)]
356    pub fn is_even(&self) -> bool {
357        *self == PAR_A::EVEN
358    }
359    #[doc = "Checks if the value of the field is `ODD`"]
360    #[inline(always)]
361    pub fn is_odd(&self) -> bool {
362        *self == PAR_A::ODD
363    }
364    #[doc = "Checks if the value of the field is `SPACE`"]
365    #[inline(always)]
366    pub fn is_space(&self) -> bool {
367        *self == PAR_A::SPACE
368    }
369    #[doc = "Checks if the value of the field is `MARK`"]
370    #[inline(always)]
371    pub fn is_mark(&self) -> bool {
372        *self == PAR_A::MARK
373    }
374    #[doc = "Checks if the value of the field is `NO`"]
375    #[inline(always)]
376    pub fn is_no(&self) -> bool {
377        *self == PAR_A::NO
378    }
379    #[doc = "Checks if the value of the field is `MULTIDROP`"]
380    #[inline(always)]
381    pub fn is_multidrop(&self) -> bool {
382        *self == PAR_A::MULTIDROP
383    }
384}
385#[doc = "Field `PAR` writer - Parity Type"]
386pub type PAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, PAR_A, 3, O>;
387impl<'a, const O: u8> PAR_W<'a, O> {
388    #[doc = "Even parity"]
389    #[inline(always)]
390    pub fn even(self) -> &'a mut W {
391        self.variant(PAR_A::EVEN)
392    }
393    #[doc = "Odd parity"]
394    #[inline(always)]
395    pub fn odd(self) -> &'a mut W {
396        self.variant(PAR_A::ODD)
397    }
398    #[doc = "Parity forced to 0 (Space)"]
399    #[inline(always)]
400    pub fn space(self) -> &'a mut W {
401        self.variant(PAR_A::SPACE)
402    }
403    #[doc = "Parity forced to 1 (Mark)"]
404    #[inline(always)]
405    pub fn mark(self) -> &'a mut W {
406        self.variant(PAR_A::MARK)
407    }
408    #[doc = "No parity"]
409    #[inline(always)]
410    pub fn no(self) -> &'a mut W {
411        self.variant(PAR_A::NO)
412    }
413    #[doc = "Multidrop mode"]
414    #[inline(always)]
415    pub fn multidrop(self) -> &'a mut W {
416        self.variant(PAR_A::MULTIDROP)
417    }
418}
419#[doc = "Field `NBSTOP` reader - Number of Stop Bits"]
420pub type NBSTOP_R = crate::FieldReader<u8, NBSTOP_A>;
421#[doc = "Number of Stop Bits"]
422#[derive(Clone, Copy, Debug, PartialEq, Eq)]
423#[repr(u8)]
424pub enum NBSTOP_A {
425    #[doc = "0: 1 stop bit"]
426    _1_BIT = 0,
427    #[doc = "1: 1.5 stop bit (SYNC = 0) or reserved (SYNC = 1)"]
428    _1_5_BIT = 1,
429    #[doc = "2: 2 stop bits"]
430    _2_BIT = 2,
431}
432impl From<NBSTOP_A> for u8 {
433    #[inline(always)]
434    fn from(variant: NBSTOP_A) -> Self {
435        variant as _
436    }
437}
438impl NBSTOP_R {
439    #[doc = "Get enumerated values variant"]
440    #[inline(always)]
441    pub fn variant(&self) -> Option<NBSTOP_A> {
442        match self.bits {
443            0 => Some(NBSTOP_A::_1_BIT),
444            1 => Some(NBSTOP_A::_1_5_BIT),
445            2 => Some(NBSTOP_A::_2_BIT),
446            _ => None,
447        }
448    }
449    #[doc = "Checks if the value of the field is `_1_BIT`"]
450    #[inline(always)]
451    pub fn is_1_bit(&self) -> bool {
452        *self == NBSTOP_A::_1_BIT
453    }
454    #[doc = "Checks if the value of the field is `_1_5_BIT`"]
455    #[inline(always)]
456    pub fn is_1_5_bit(&self) -> bool {
457        *self == NBSTOP_A::_1_5_BIT
458    }
459    #[doc = "Checks if the value of the field is `_2_BIT`"]
460    #[inline(always)]
461    pub fn is_2_bit(&self) -> bool {
462        *self == NBSTOP_A::_2_BIT
463    }
464}
465#[doc = "Field `NBSTOP` writer - Number of Stop Bits"]
466pub type NBSTOP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, NBSTOP_A, 2, O>;
467impl<'a, const O: u8> NBSTOP_W<'a, O> {
468    #[doc = "1 stop bit"]
469    #[inline(always)]
470    pub fn _1_bit(self) -> &'a mut W {
471        self.variant(NBSTOP_A::_1_BIT)
472    }
473    #[doc = "1.5 stop bit (SYNC = 0) or reserved (SYNC = 1)"]
474    #[inline(always)]
475    pub fn _1_5_bit(self) -> &'a mut W {
476        self.variant(NBSTOP_A::_1_5_BIT)
477    }
478    #[doc = "2 stop bits"]
479    #[inline(always)]
480    pub fn _2_bit(self) -> &'a mut W {
481        self.variant(NBSTOP_A::_2_BIT)
482    }
483}
484#[doc = "Field `CHMODE` reader - Channel Mode"]
485pub type CHMODE_R = crate::FieldReader<u8, CHMODE_A>;
486#[doc = "Channel Mode"]
487#[derive(Clone, Copy, Debug, PartialEq, Eq)]
488#[repr(u8)]
489pub enum CHMODE_A {
490    #[doc = "0: Normal Mode"]
491    NORMAL = 0,
492    #[doc = "1: Automatic Echo. Receiver input is connected to the TXD pin."]
493    AUTOMATIC = 1,
494    #[doc = "2: Local Loopback. Transmitter output is connected to the Receiver Input."]
495    LOCAL_LOOPBACK = 2,
496    #[doc = "3: Remote Loopback. RXD pin is internally connected to the TXD pin."]
497    REMOTE_LOOPBACK = 3,
498}
499impl From<CHMODE_A> for u8 {
500    #[inline(always)]
501    fn from(variant: CHMODE_A) -> Self {
502        variant as _
503    }
504}
505impl CHMODE_R {
506    #[doc = "Get enumerated values variant"]
507    #[inline(always)]
508    pub fn variant(&self) -> CHMODE_A {
509        match self.bits {
510            0 => CHMODE_A::NORMAL,
511            1 => CHMODE_A::AUTOMATIC,
512            2 => CHMODE_A::LOCAL_LOOPBACK,
513            3 => CHMODE_A::REMOTE_LOOPBACK,
514            _ => unreachable!(),
515        }
516    }
517    #[doc = "Checks if the value of the field is `NORMAL`"]
518    #[inline(always)]
519    pub fn is_normal(&self) -> bool {
520        *self == CHMODE_A::NORMAL
521    }
522    #[doc = "Checks if the value of the field is `AUTOMATIC`"]
523    #[inline(always)]
524    pub fn is_automatic(&self) -> bool {
525        *self == CHMODE_A::AUTOMATIC
526    }
527    #[doc = "Checks if the value of the field is `LOCAL_LOOPBACK`"]
528    #[inline(always)]
529    pub fn is_local_loopback(&self) -> bool {
530        *self == CHMODE_A::LOCAL_LOOPBACK
531    }
532    #[doc = "Checks if the value of the field is `REMOTE_LOOPBACK`"]
533    #[inline(always)]
534    pub fn is_remote_loopback(&self) -> bool {
535        *self == CHMODE_A::REMOTE_LOOPBACK
536    }
537}
538#[doc = "Field `CHMODE` writer - Channel Mode"]
539pub type CHMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, MR_SPEC, u8, CHMODE_A, 2, O>;
540impl<'a, const O: u8> CHMODE_W<'a, O> {
541    #[doc = "Normal Mode"]
542    #[inline(always)]
543    pub fn normal(self) -> &'a mut W {
544        self.variant(CHMODE_A::NORMAL)
545    }
546    #[doc = "Automatic Echo. Receiver input is connected to the TXD pin."]
547    #[inline(always)]
548    pub fn automatic(self) -> &'a mut W {
549        self.variant(CHMODE_A::AUTOMATIC)
550    }
551    #[doc = "Local Loopback. Transmitter output is connected to the Receiver Input."]
552    #[inline(always)]
553    pub fn local_loopback(self) -> &'a mut W {
554        self.variant(CHMODE_A::LOCAL_LOOPBACK)
555    }
556    #[doc = "Remote Loopback. RXD pin is internally connected to the TXD pin."]
557    #[inline(always)]
558    pub fn remote_loopback(self) -> &'a mut W {
559        self.variant(CHMODE_A::REMOTE_LOOPBACK)
560    }
561}
562#[doc = "Field `MSBF` reader - Bit Order"]
563pub type MSBF_R = crate::BitReader<bool>;
564#[doc = "Field `MSBF` writer - Bit Order"]
565pub type MSBF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
566#[doc = "Field `MODE9` reader - 9-bit Character Length"]
567pub type MODE9_R = crate::BitReader<bool>;
568#[doc = "Field `MODE9` writer - 9-bit Character Length"]
569pub type MODE9_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
570#[doc = "Field `CLKO` reader - Clock Output Select"]
571pub type CLKO_R = crate::BitReader<bool>;
572#[doc = "Field `CLKO` writer - Clock Output Select"]
573pub type CLKO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
574#[doc = "Field `OVER` reader - Oversampling Mode"]
575pub type OVER_R = crate::BitReader<bool>;
576#[doc = "Field `OVER` writer - Oversampling Mode"]
577pub type OVER_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
578#[doc = "Field `INACK` reader - Inhibit Non Acknowledge"]
579pub type INACK_R = crate::BitReader<bool>;
580#[doc = "Field `INACK` writer - Inhibit Non Acknowledge"]
581pub type INACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
582#[doc = "Field `DSNACK` reader - Disable Successive NACK"]
583pub type DSNACK_R = crate::BitReader<bool>;
584#[doc = "Field `DSNACK` writer - Disable Successive NACK"]
585pub type DSNACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
586#[doc = "Field `INVDATA` reader - Inverted Data"]
587pub type INVDATA_R = crate::BitReader<bool>;
588#[doc = "Field `INVDATA` writer - Inverted Data"]
589pub type INVDATA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
590#[doc = "Field `MAX_ITERATION` reader - Maximum Number of Automatic Iteration"]
591pub type MAX_ITERATION_R = crate::FieldReader<u8, u8>;
592#[doc = "Field `MAX_ITERATION` writer - Maximum Number of Automatic Iteration"]
593pub type MAX_ITERATION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, u8, 3, O>;
594#[doc = "Field `FILTER` reader - Infrared Receive Line Filter"]
595pub type FILTER_R = crate::BitReader<bool>;
596#[doc = "Field `FILTER` writer - Infrared Receive Line Filter"]
597pub type FILTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
598impl R {
599    #[doc = "Bits 0:3 - USART Mode of Operation"]
600    #[inline(always)]
601    pub fn usart_mode(&self) -> USART_MODE_R {
602        USART_MODE_R::new((self.bits & 0x0f) as u8)
603    }
604    #[doc = "Bits 4:5 - Clock Selection"]
605    #[inline(always)]
606    pub fn usclks(&self) -> USCLKS_R {
607        USCLKS_R::new(((self.bits >> 4) & 3) as u8)
608    }
609    #[doc = "Bits 6:7 - Character Length."]
610    #[inline(always)]
611    pub fn chrl(&self) -> CHRL_R {
612        CHRL_R::new(((self.bits >> 6) & 3) as u8)
613    }
614    #[doc = "Bit 8 - Synchronous Mode Select"]
615    #[inline(always)]
616    pub fn sync(&self) -> SYNC_R {
617        SYNC_R::new(((self.bits >> 8) & 1) != 0)
618    }
619    #[doc = "Bits 9:11 - Parity Type"]
620    #[inline(always)]
621    pub fn par(&self) -> PAR_R {
622        PAR_R::new(((self.bits >> 9) & 7) as u8)
623    }
624    #[doc = "Bits 12:13 - Number of Stop Bits"]
625    #[inline(always)]
626    pub fn nbstop(&self) -> NBSTOP_R {
627        NBSTOP_R::new(((self.bits >> 12) & 3) as u8)
628    }
629    #[doc = "Bits 14:15 - Channel Mode"]
630    #[inline(always)]
631    pub fn chmode(&self) -> CHMODE_R {
632        CHMODE_R::new(((self.bits >> 14) & 3) as u8)
633    }
634    #[doc = "Bit 16 - Bit Order"]
635    #[inline(always)]
636    pub fn msbf(&self) -> MSBF_R {
637        MSBF_R::new(((self.bits >> 16) & 1) != 0)
638    }
639    #[doc = "Bit 17 - 9-bit Character Length"]
640    #[inline(always)]
641    pub fn mode9(&self) -> MODE9_R {
642        MODE9_R::new(((self.bits >> 17) & 1) != 0)
643    }
644    #[doc = "Bit 18 - Clock Output Select"]
645    #[inline(always)]
646    pub fn clko(&self) -> CLKO_R {
647        CLKO_R::new(((self.bits >> 18) & 1) != 0)
648    }
649    #[doc = "Bit 19 - Oversampling Mode"]
650    #[inline(always)]
651    pub fn over(&self) -> OVER_R {
652        OVER_R::new(((self.bits >> 19) & 1) != 0)
653    }
654    #[doc = "Bit 20 - Inhibit Non Acknowledge"]
655    #[inline(always)]
656    pub fn inack(&self) -> INACK_R {
657        INACK_R::new(((self.bits >> 20) & 1) != 0)
658    }
659    #[doc = "Bit 21 - Disable Successive NACK"]
660    #[inline(always)]
661    pub fn dsnack(&self) -> DSNACK_R {
662        DSNACK_R::new(((self.bits >> 21) & 1) != 0)
663    }
664    #[doc = "Bit 23 - Inverted Data"]
665    #[inline(always)]
666    pub fn invdata(&self) -> INVDATA_R {
667        INVDATA_R::new(((self.bits >> 23) & 1) != 0)
668    }
669    #[doc = "Bits 24:26 - Maximum Number of Automatic Iteration"]
670    #[inline(always)]
671    pub fn max_iteration(&self) -> MAX_ITERATION_R {
672        MAX_ITERATION_R::new(((self.bits >> 24) & 7) as u8)
673    }
674    #[doc = "Bit 28 - Infrared Receive Line Filter"]
675    #[inline(always)]
676    pub fn filter(&self) -> FILTER_R {
677        FILTER_R::new(((self.bits >> 28) & 1) != 0)
678    }
679}
680impl W {
681    #[doc = "Bits 0:3 - USART Mode of Operation"]
682    #[inline(always)]
683    #[must_use]
684    pub fn usart_mode(&mut self) -> USART_MODE_W<0> {
685        USART_MODE_W::new(self)
686    }
687    #[doc = "Bits 4:5 - Clock Selection"]
688    #[inline(always)]
689    #[must_use]
690    pub fn usclks(&mut self) -> USCLKS_W<4> {
691        USCLKS_W::new(self)
692    }
693    #[doc = "Bits 6:7 - Character Length."]
694    #[inline(always)]
695    #[must_use]
696    pub fn chrl(&mut self) -> CHRL_W<6> {
697        CHRL_W::new(self)
698    }
699    #[doc = "Bit 8 - Synchronous Mode Select"]
700    #[inline(always)]
701    #[must_use]
702    pub fn sync(&mut self) -> SYNC_W<8> {
703        SYNC_W::new(self)
704    }
705    #[doc = "Bits 9:11 - Parity Type"]
706    #[inline(always)]
707    #[must_use]
708    pub fn par(&mut self) -> PAR_W<9> {
709        PAR_W::new(self)
710    }
711    #[doc = "Bits 12:13 - Number of Stop Bits"]
712    #[inline(always)]
713    #[must_use]
714    pub fn nbstop(&mut self) -> NBSTOP_W<12> {
715        NBSTOP_W::new(self)
716    }
717    #[doc = "Bits 14:15 - Channel Mode"]
718    #[inline(always)]
719    #[must_use]
720    pub fn chmode(&mut self) -> CHMODE_W<14> {
721        CHMODE_W::new(self)
722    }
723    #[doc = "Bit 16 - Bit Order"]
724    #[inline(always)]
725    #[must_use]
726    pub fn msbf(&mut self) -> MSBF_W<16> {
727        MSBF_W::new(self)
728    }
729    #[doc = "Bit 17 - 9-bit Character Length"]
730    #[inline(always)]
731    #[must_use]
732    pub fn mode9(&mut self) -> MODE9_W<17> {
733        MODE9_W::new(self)
734    }
735    #[doc = "Bit 18 - Clock Output Select"]
736    #[inline(always)]
737    #[must_use]
738    pub fn clko(&mut self) -> CLKO_W<18> {
739        CLKO_W::new(self)
740    }
741    #[doc = "Bit 19 - Oversampling Mode"]
742    #[inline(always)]
743    #[must_use]
744    pub fn over(&mut self) -> OVER_W<19> {
745        OVER_W::new(self)
746    }
747    #[doc = "Bit 20 - Inhibit Non Acknowledge"]
748    #[inline(always)]
749    #[must_use]
750    pub fn inack(&mut self) -> INACK_W<20> {
751        INACK_W::new(self)
752    }
753    #[doc = "Bit 21 - Disable Successive NACK"]
754    #[inline(always)]
755    #[must_use]
756    pub fn dsnack(&mut self) -> DSNACK_W<21> {
757        DSNACK_W::new(self)
758    }
759    #[doc = "Bit 23 - Inverted Data"]
760    #[inline(always)]
761    #[must_use]
762    pub fn invdata(&mut self) -> INVDATA_W<23> {
763        INVDATA_W::new(self)
764    }
765    #[doc = "Bits 24:26 - Maximum Number of Automatic Iteration"]
766    #[inline(always)]
767    #[must_use]
768    pub fn max_iteration(&mut self) -> MAX_ITERATION_W<24> {
769        MAX_ITERATION_W::new(self)
770    }
771    #[doc = "Bit 28 - Infrared Receive Line Filter"]
772    #[inline(always)]
773    #[must_use]
774    pub fn filter(&mut self) -> FILTER_W<28> {
775        FILTER_W::new(self)
776    }
777    #[doc = "Writes raw bits to the register."]
778    #[inline(always)]
779    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
780        self.0.bits(bits);
781        self
782    }
783}
784#[doc = "Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mr](index.html) module"]
785pub struct MR_SPEC;
786impl crate::RegisterSpec for MR_SPEC {
787    type Ux = u32;
788}
789#[doc = "`read()` method returns [mr::R](R) reader structure"]
790impl crate::Readable for MR_SPEC {
791    type Reader = R;
792}
793#[doc = "`write(|w| ..)` method takes [mr::W](W) writer structure"]
794impl crate::Writable for MR_SPEC {
795    type Writer = W;
796    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
797    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
798}