lpc845_pac/usart0/
rxdatstat.rs

1#[doc = "Register `RXDATSTAT` reader"]
2pub struct R(crate::R<RXDATSTAT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RXDATSTAT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RXDATSTAT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RXDATSTAT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `RXDAT` reader - The USART Receiver Data register contains the next received character. The number of bits that are relevant depends on the USART configuration settings."]
17pub struct RXDAT_R(crate::FieldReader<u16, u16>);
18impl RXDAT_R {
19    pub(crate) fn new(bits: u16) -> Self {
20        RXDAT_R(crate::FieldReader::new(bits))
21    }
22}
23impl core::ops::Deref for RXDAT_R {
24    type Target = crate::FieldReader<u16, u16>;
25    #[inline(always)]
26    fn deref(&self) -> &Self::Target {
27        &self.0
28    }
29}
30#[doc = "Field `FRAMERR` reader - Framing Error status flag. This bit is valid when there is a character to be read in the RXDAT register and reflects the status of that character. This bit will set when the character in RXDAT was received with a missing stop bit at the expected location. This could be an indication of a baud rate or configuration mismatch with the transmitting source."]
31pub struct FRAMERR_R(crate::FieldReader<bool, bool>);
32impl FRAMERR_R {
33    pub(crate) fn new(bits: bool) -> Self {
34        FRAMERR_R(crate::FieldReader::new(bits))
35    }
36}
37impl core::ops::Deref for FRAMERR_R {
38    type Target = crate::FieldReader<bool, bool>;
39    #[inline(always)]
40    fn deref(&self) -> &Self::Target {
41        &self.0
42    }
43}
44#[doc = "Field `PARITYERR` reader - Parity Error status flag. This bit is valid when there is a character to be read in the RXDAT register and reflects the status of that character. This bit will be set when a parity error is detected in a received character."]
45pub struct PARITYERR_R(crate::FieldReader<bool, bool>);
46impl PARITYERR_R {
47    pub(crate) fn new(bits: bool) -> Self {
48        PARITYERR_R(crate::FieldReader::new(bits))
49    }
50}
51impl core::ops::Deref for PARITYERR_R {
52    type Target = crate::FieldReader<bool, bool>;
53    #[inline(always)]
54    fn deref(&self) -> &Self::Target {
55        &self.0
56    }
57}
58#[doc = "Field `RXNOISE` reader - Received Noise flag."]
59pub struct RXNOISE_R(crate::FieldReader<bool, bool>);
60impl RXNOISE_R {
61    pub(crate) fn new(bits: bool) -> Self {
62        RXNOISE_R(crate::FieldReader::new(bits))
63    }
64}
65impl core::ops::Deref for RXNOISE_R {
66    type Target = crate::FieldReader<bool, bool>;
67    #[inline(always)]
68    fn deref(&self) -> &Self::Target {
69        &self.0
70    }
71}
72impl R {
73    #[doc = "Bits 0:8 - The USART Receiver Data register contains the next received character. The number of bits that are relevant depends on the USART configuration settings."]
74    #[inline(always)]
75    pub fn rxdat(&self) -> RXDAT_R {
76        RXDAT_R::new((self.bits & 0x01ff) as u16)
77    }
78    #[doc = "Bit 13 - Framing Error status flag. This bit is valid when there is a character to be read in the RXDAT register and reflects the status of that character. This bit will set when the character in RXDAT was received with a missing stop bit at the expected location. This could be an indication of a baud rate or configuration mismatch with the transmitting source."]
79    #[inline(always)]
80    pub fn framerr(&self) -> FRAMERR_R {
81        FRAMERR_R::new(((self.bits >> 13) & 0x01) != 0)
82    }
83    #[doc = "Bit 14 - Parity Error status flag. This bit is valid when there is a character to be read in the RXDAT register and reflects the status of that character. This bit will be set when a parity error is detected in a received character."]
84    #[inline(always)]
85    pub fn parityerr(&self) -> PARITYERR_R {
86        PARITYERR_R::new(((self.bits >> 14) & 0x01) != 0)
87    }
88    #[doc = "Bit 15 - Received Noise flag."]
89    #[inline(always)]
90    pub fn rxnoise(&self) -> RXNOISE_R {
91        RXNOISE_R::new(((self.bits >> 15) & 0x01) != 0)
92    }
93}
94#[doc = "Receiver Data with Status register. Combines the last character received with the current USART receive status. Allows DMA or software to recover incoming data and status together.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rxdatstat](index.html) module"]
95pub struct RXDATSTAT_SPEC;
96impl crate::RegisterSpec for RXDATSTAT_SPEC {
97    type Ux = u32;
98}
99#[doc = "`read()` method returns [rxdatstat::R](R) reader structure"]
100impl crate::Readable for RXDATSTAT_SPEC {
101    type Reader = R;
102}
103#[doc = "`reset()` method sets RXDATSTAT to value 0"]
104impl crate::Resettable for RXDATSTAT_SPEC {
105    #[inline(always)]
106    fn reset_value() -> Self::Ux {
107        0
108    }
109}