atsamv71q21/uart0/
uart_sr.rs1#[doc = "Register `UART_SR` reader"]
2pub struct R(crate::R<UART_SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<UART_SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<UART_SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<UART_SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `RXRDY` reader - Receiver Ready"]
17pub struct RXRDY_R(crate::FieldReader<bool, bool>);
18impl RXRDY_R {
19 #[inline(always)]
20 pub(crate) fn new(bits: bool) -> Self {
21 RXRDY_R(crate::FieldReader::new(bits))
22 }
23}
24impl core::ops::Deref for RXRDY_R {
25 type Target = crate::FieldReader<bool, bool>;
26 #[inline(always)]
27 fn deref(&self) -> &Self::Target {
28 &self.0
29 }
30}
31#[doc = "Field `TXRDY` reader - Transmitter Ready"]
32pub struct TXRDY_R(crate::FieldReader<bool, bool>);
33impl TXRDY_R {
34 #[inline(always)]
35 pub(crate) fn new(bits: bool) -> Self {
36 TXRDY_R(crate::FieldReader::new(bits))
37 }
38}
39impl core::ops::Deref for TXRDY_R {
40 type Target = crate::FieldReader<bool, bool>;
41 #[inline(always)]
42 fn deref(&self) -> &Self::Target {
43 &self.0
44 }
45}
46#[doc = "Field `OVRE` reader - Overrun Error"]
47pub struct OVRE_R(crate::FieldReader<bool, bool>);
48impl OVRE_R {
49 #[inline(always)]
50 pub(crate) fn new(bits: bool) -> Self {
51 OVRE_R(crate::FieldReader::new(bits))
52 }
53}
54impl core::ops::Deref for OVRE_R {
55 type Target = crate::FieldReader<bool, bool>;
56 #[inline(always)]
57 fn deref(&self) -> &Self::Target {
58 &self.0
59 }
60}
61#[doc = "Field `FRAME` reader - Framing Error"]
62pub struct FRAME_R(crate::FieldReader<bool, bool>);
63impl FRAME_R {
64 #[inline(always)]
65 pub(crate) fn new(bits: bool) -> Self {
66 FRAME_R(crate::FieldReader::new(bits))
67 }
68}
69impl core::ops::Deref for FRAME_R {
70 type Target = crate::FieldReader<bool, bool>;
71 #[inline(always)]
72 fn deref(&self) -> &Self::Target {
73 &self.0
74 }
75}
76#[doc = "Field `PARE` reader - Parity Error"]
77pub struct PARE_R(crate::FieldReader<bool, bool>);
78impl PARE_R {
79 #[inline(always)]
80 pub(crate) fn new(bits: bool) -> Self {
81 PARE_R(crate::FieldReader::new(bits))
82 }
83}
84impl core::ops::Deref for PARE_R {
85 type Target = crate::FieldReader<bool, bool>;
86 #[inline(always)]
87 fn deref(&self) -> &Self::Target {
88 &self.0
89 }
90}
91#[doc = "Field `TXEMPTY` reader - Transmitter Empty"]
92pub struct TXEMPTY_R(crate::FieldReader<bool, bool>);
93impl TXEMPTY_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: bool) -> Self {
96 TXEMPTY_R(crate::FieldReader::new(bits))
97 }
98}
99impl core::ops::Deref for TXEMPTY_R {
100 type Target = crate::FieldReader<bool, bool>;
101 #[inline(always)]
102 fn deref(&self) -> &Self::Target {
103 &self.0
104 }
105}
106#[doc = "Field `CMP` reader - Comparison Match"]
107pub struct CMP_R(crate::FieldReader<bool, bool>);
108impl CMP_R {
109 #[inline(always)]
110 pub(crate) fn new(bits: bool) -> Self {
111 CMP_R(crate::FieldReader::new(bits))
112 }
113}
114impl core::ops::Deref for CMP_R {
115 type Target = crate::FieldReader<bool, bool>;
116 #[inline(always)]
117 fn deref(&self) -> &Self::Target {
118 &self.0
119 }
120}
121#[doc = "Field `SWES` reader - SleepWalking Enable Status"]
122pub struct SWES_R(crate::FieldReader<bool, bool>);
123impl SWES_R {
124 #[inline(always)]
125 pub(crate) fn new(bits: bool) -> Self {
126 SWES_R(crate::FieldReader::new(bits))
127 }
128}
129impl core::ops::Deref for SWES_R {
130 type Target = crate::FieldReader<bool, bool>;
131 #[inline(always)]
132 fn deref(&self) -> &Self::Target {
133 &self.0
134 }
135}
136#[doc = "Field `CLKREQ` reader - Clock Request"]
137pub struct CLKREQ_R(crate::FieldReader<bool, bool>);
138impl CLKREQ_R {
139 #[inline(always)]
140 pub(crate) fn new(bits: bool) -> Self {
141 CLKREQ_R(crate::FieldReader::new(bits))
142 }
143}
144impl core::ops::Deref for CLKREQ_R {
145 type Target = crate::FieldReader<bool, bool>;
146 #[inline(always)]
147 fn deref(&self) -> &Self::Target {
148 &self.0
149 }
150}
151#[doc = "Field `WKUPREQ` reader - Wake-Up Request"]
152pub struct WKUPREQ_R(crate::FieldReader<bool, bool>);
153impl WKUPREQ_R {
154 #[inline(always)]
155 pub(crate) fn new(bits: bool) -> Self {
156 WKUPREQ_R(crate::FieldReader::new(bits))
157 }
158}
159impl core::ops::Deref for WKUPREQ_R {
160 type Target = crate::FieldReader<bool, bool>;
161 #[inline(always)]
162 fn deref(&self) -> &Self::Target {
163 &self.0
164 }
165}
166impl R {
167 #[doc = "Bit 0 - Receiver Ready"]
168 #[inline(always)]
169 pub fn rxrdy(&self) -> RXRDY_R {
170 RXRDY_R::new((self.bits & 0x01) != 0)
171 }
172 #[doc = "Bit 1 - Transmitter Ready"]
173 #[inline(always)]
174 pub fn txrdy(&self) -> TXRDY_R {
175 TXRDY_R::new(((self.bits >> 1) & 0x01) != 0)
176 }
177 #[doc = "Bit 5 - Overrun Error"]
178 #[inline(always)]
179 pub fn ovre(&self) -> OVRE_R {
180 OVRE_R::new(((self.bits >> 5) & 0x01) != 0)
181 }
182 #[doc = "Bit 6 - Framing Error"]
183 #[inline(always)]
184 pub fn frame(&self) -> FRAME_R {
185 FRAME_R::new(((self.bits >> 6) & 0x01) != 0)
186 }
187 #[doc = "Bit 7 - Parity Error"]
188 #[inline(always)]
189 pub fn pare(&self) -> PARE_R {
190 PARE_R::new(((self.bits >> 7) & 0x01) != 0)
191 }
192 #[doc = "Bit 9 - Transmitter Empty"]
193 #[inline(always)]
194 pub fn txempty(&self) -> TXEMPTY_R {
195 TXEMPTY_R::new(((self.bits >> 9) & 0x01) != 0)
196 }
197 #[doc = "Bit 15 - Comparison Match"]
198 #[inline(always)]
199 pub fn cmp(&self) -> CMP_R {
200 CMP_R::new(((self.bits >> 15) & 0x01) != 0)
201 }
202 #[doc = "Bit 21 - SleepWalking Enable Status"]
203 #[inline(always)]
204 pub fn swes(&self) -> SWES_R {
205 SWES_R::new(((self.bits >> 21) & 0x01) != 0)
206 }
207 #[doc = "Bit 22 - Clock Request"]
208 #[inline(always)]
209 pub fn clkreq(&self) -> CLKREQ_R {
210 CLKREQ_R::new(((self.bits >> 22) & 0x01) != 0)
211 }
212 #[doc = "Bit 23 - Wake-Up Request"]
213 #[inline(always)]
214 pub fn wkupreq(&self) -> WKUPREQ_R {
215 WKUPREQ_R::new(((self.bits >> 23) & 0x01) != 0)
216 }
217}
218#[doc = "Status Register\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 [uart_sr](index.html) module"]
219pub struct UART_SR_SPEC;
220impl crate::RegisterSpec for UART_SR_SPEC {
221 type Ux = u32;
222}
223#[doc = "`read()` method returns [uart_sr::R](R) reader structure"]
224impl crate::Readable for UART_SR_SPEC {
225 type Reader = R;
226}
227#[doc = "`reset()` method sets UART_SR to value 0"]
228impl crate::Resettable for UART_SR_SPEC {
229 #[inline(always)]
230 fn reset_value() -> Self::Ux {
231 0
232 }
233}