1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
#[doc = "Register `USR` reader"]
pub struct R(crate::R<USR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<USR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<USR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<USR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "RX FIFO Full\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RFF_A {
#[doc = "0: `0`"]
NOT_FULL = 0,
#[doc = "1: `1`"]
FULL = 1,
}
impl From<RFF_A> for bool {
#[inline(always)]
fn from(variant: RFF_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `rff` reader - RX FIFO Full"]
pub struct RFF_R(crate::FieldReader<bool, RFF_A>);
impl RFF_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
RFF_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RFF_A {
match self.bits {
false => RFF_A::NOT_FULL,
true => RFF_A::FULL,
}
}
#[doc = "Checks if the value of the field is `NOT_FULL`"]
#[inline(always)]
pub fn is_not_full(&self) -> bool {
**self == RFF_A::NOT_FULL
}
#[doc = "Checks if the value of the field is `FULL`"]
#[inline(always)]
pub fn is_full(&self) -> bool {
**self == RFF_A::FULL
}
}
impl core::ops::Deref for RFF_R {
type Target = crate::FieldReader<bool, RFF_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "RX FIFO Not Empty\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RFNE_A {
#[doc = "0: `0`"]
EMPTY = 0,
#[doc = "1: `1`"]
NOT_EMPTY = 1,
}
impl From<RFNE_A> for bool {
#[inline(always)]
fn from(variant: RFNE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `rfne` reader - RX FIFO Not Empty"]
pub struct RFNE_R(crate::FieldReader<bool, RFNE_A>);
impl RFNE_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
RFNE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RFNE_A {
match self.bits {
false => RFNE_A::EMPTY,
true => RFNE_A::NOT_EMPTY,
}
}
#[doc = "Checks if the value of the field is `EMPTY`"]
#[inline(always)]
pub fn is_empty(&self) -> bool {
**self == RFNE_A::EMPTY
}
#[doc = "Checks if the value of the field is `NOT_EMPTY`"]
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
**self == RFNE_A::NOT_EMPTY
}
}
impl core::ops::Deref for RFNE_R {
type Target = crate::FieldReader<bool, RFNE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "TX FIFO Empty\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TFE_A {
#[doc = "0: `0`"]
NOT_EMPTY = 0,
#[doc = "1: `1`"]
EMPTY = 1,
}
impl From<TFE_A> for bool {
#[inline(always)]
fn from(variant: TFE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `tfe` reader - TX FIFO Empty"]
pub struct TFE_R(crate::FieldReader<bool, TFE_A>);
impl TFE_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
TFE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TFE_A {
match self.bits {
false => TFE_A::NOT_EMPTY,
true => TFE_A::EMPTY,
}
}
#[doc = "Checks if the value of the field is `NOT_EMPTY`"]
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
**self == TFE_A::NOT_EMPTY
}
#[doc = "Checks if the value of the field is `EMPTY`"]
#[inline(always)]
pub fn is_empty(&self) -> bool {
**self == TFE_A::EMPTY
}
}
impl core::ops::Deref for TFE_R {
type Target = crate::FieldReader<bool, TFE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "TX FIFO Not Full\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TFNF_A {
#[doc = "0: `0`"]
FULL = 0,
#[doc = "1: `1`"]
NOT_FULL = 1,
}
impl From<TFNF_A> for bool {
#[inline(always)]
fn from(variant: TFNF_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `tfnf` reader - TX FIFO Not Full"]
pub struct TFNF_R(crate::FieldReader<bool, TFNF_A>);
impl TFNF_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
TFNF_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TFNF_A {
match self.bits {
false => TFNF_A::FULL,
true => TFNF_A::NOT_FULL,
}
}
#[doc = "Checks if the value of the field is `FULL`"]
#[inline(always)]
pub fn is_full(&self) -> bool {
**self == TFNF_A::FULL
}
#[doc = "Checks if the value of the field is `NOT_FULL`"]
#[inline(always)]
pub fn is_not_full(&self) -> bool {
**self == TFNF_A::NOT_FULL
}
}
impl core::ops::Deref for TFNF_R {
type Target = crate::FieldReader<bool, TFNF_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "UART Busy Bit\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BUSY_A {
#[doc = "0: `0`"]
IDLE = 0,
#[doc = "1: `1`"]
BUSY = 1,
}
impl From<BUSY_A> for bool {
#[inline(always)]
fn from(variant: BUSY_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `busy` reader - UART Busy Bit"]
pub struct BUSY_R(crate::FieldReader<bool, BUSY_A>);
impl BUSY_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
BUSY_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> BUSY_A {
match self.bits {
false => BUSY_A::IDLE,
true => BUSY_A::BUSY,
}
}
#[doc = "Checks if the value of the field is `IDLE`"]
#[inline(always)]
pub fn is_idle(&self) -> bool {
**self == BUSY_A::IDLE
}
#[doc = "Checks if the value of the field is `BUSY`"]
#[inline(always)]
pub fn is_busy(&self) -> bool {
**self == BUSY_A::BUSY
}
}
impl core::ops::Deref for BUSY_R {
type Target = crate::FieldReader<bool, BUSY_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl R {
#[doc = "Bit 4 - RX FIFO Full"]
#[inline(always)]
pub fn rff(&self) -> RFF_R {
RFF_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - RX FIFO Not Empty"]
#[inline(always)]
pub fn rfne(&self) -> RFNE_R {
RFNE_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - TX FIFO Empty"]
#[inline(always)]
pub fn tfe(&self) -> TFE_R {
TFE_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - TX FIFO Not Full"]
#[inline(always)]
pub fn tfnf(&self) -> TFNF_R {
TFNF_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - UART Busy Bit"]
#[inline(always)]
pub fn busy(&self) -> BUSY_R {
BUSY_R::new((self.bits & 0x01) != 0)
}
}
#[doc = "UART 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 [usr](index.html) module"]
pub struct USR_SPEC;
impl crate::RegisterSpec for USR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [usr::R](R) reader structure"]
impl crate::Readable for USR_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets USR to value 0"]
impl crate::Resettable for USR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}