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
#[doc = "Register `SM_STATUS` reader"]
pub type R = crate::R<SM_STATUS_SPEC>;
#[doc = "Interrupt Write\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INT_W_A {
    #[doc = "0: Interrupt cleared after first byte of buffer was read"]
    VALUE1 = 0,
    #[doc = "1: Interrupt after buffer was completely and successfully written"]
    VALUE2 = 1,
}
impl From<INT_W_A> for bool {
    #[inline(always)]
    fn from(variant: INT_W_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INT_W` reader - Interrupt Write"]
pub type INT_W_R = crate::BitReader<INT_W_A>;
impl INT_W_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> INT_W_A {
        match self.bits {
            false => INT_W_A::VALUE1,
            true => INT_W_A::VALUE2,
        }
    }
    #[doc = "Interrupt cleared after first byte of buffer was read"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == INT_W_A::VALUE1
    }
    #[doc = "Interrupt after buffer was completely and successfully written"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == INT_W_A::VALUE2
    }
}
#[doc = "Interrupt Read\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INT_R_A {
    #[doc = "0: Interrupt cleared after first byte of buffer was written"]
    VALUE1 = 0,
    #[doc = "1: Interrupt after buffer was completely and successful read"]
    VALUE2 = 1,
}
impl From<INT_R_A> for bool {
    #[inline(always)]
    fn from(variant: INT_R_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INT_R` reader - Interrupt Read"]
pub type INT_R_R = crate::BitReader<INT_R_A>;
impl INT_R_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> INT_R_A {
        match self.bits {
            false => INT_R_A::VALUE1,
            true => INT_R_A::VALUE2,
        }
    }
    #[doc = "Interrupt cleared after first byte of buffer was written"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == INT_R_A::VALUE1
    }
    #[doc = "Interrupt after buffer was completely and successful read"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == INT_R_A::VALUE2
    }
}
#[doc = "Mailbox mode: mailbox status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MB_STATUS_A {
    #[doc = "0: Mailbox empty"]
    VALUE1 = 0,
    #[doc = "1: Mailbox full"]
    VALUE2 = 1,
}
impl From<MB_STATUS_A> for bool {
    #[inline(always)]
    fn from(variant: MB_STATUS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MB_STATUS` reader - Mailbox mode: mailbox status"]
pub type MB_STATUS_R = crate::BitReader<MB_STATUS_A>;
impl MB_STATUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> MB_STATUS_A {
        match self.bits {
            false => MB_STATUS_A::VALUE1,
            true => MB_STATUS_A::VALUE2,
        }
    }
    #[doc = "Mailbox empty"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == MB_STATUS_A::VALUE1
    }
    #[doc = "Mailbox full"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == MB_STATUS_A::VALUE2
    }
}
#[doc = "Buffered mode: buffer status (last written buffer)\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BUF_STATUS_A {
    #[doc = "0: 1. buffer"]
    VALUE1 = 0,
    #[doc = "1: 2. buffer"]
    VALUE2 = 1,
    #[doc = "2: 3. buffer"]
    VALUE3 = 2,
    #[doc = "3: (no buffer written)"]
    VALUE4 = 3,
}
impl From<BUF_STATUS_A> for u8 {
    #[inline(always)]
    fn from(variant: BUF_STATUS_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for BUF_STATUS_A {
    type Ux = u8;
}
impl crate::IsEnum for BUF_STATUS_A {}
#[doc = "Field `BUF_STATUS` reader - Buffered mode: buffer status (last written buffer)"]
pub type BUF_STATUS_R = crate::FieldReader<BUF_STATUS_A>;
impl BUF_STATUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> BUF_STATUS_A {
        match self.bits {
            0 => BUF_STATUS_A::VALUE1,
            1 => BUF_STATUS_A::VALUE2,
            2 => BUF_STATUS_A::VALUE3,
            3 => BUF_STATUS_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "1. buffer"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == BUF_STATUS_A::VALUE1
    }
    #[doc = "2. buffer"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == BUF_STATUS_A::VALUE2
    }
    #[doc = "3. buffer"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == BUF_STATUS_A::VALUE3
    }
    #[doc = "(no buffer written)"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == BUF_STATUS_A::VALUE4
    }
}
#[doc = "Read buffer in use (opened)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum R_BUF_IU_A {
    #[doc = "0: buffer not in use"]
    VALUE1 = 0,
    #[doc = "1: buffer in use"]
    VALUE2 = 1,
}
impl From<R_BUF_IU_A> for bool {
    #[inline(always)]
    fn from(variant: R_BUF_IU_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `R_BUF_IU` reader - Read buffer in use (opened)"]
pub type R_BUF_IU_R = crate::BitReader<R_BUF_IU_A>;
impl R_BUF_IU_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> R_BUF_IU_A {
        match self.bits {
            false => R_BUF_IU_A::VALUE1,
            true => R_BUF_IU_A::VALUE2,
        }
    }
    #[doc = "buffer not in use"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == R_BUF_IU_A::VALUE1
    }
    #[doc = "buffer in use"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == R_BUF_IU_A::VALUE2
    }
}
#[doc = "Write buffer in use (opened)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum W_BUF_IU_A {
    #[doc = "0: buffer not in use"]
    VALUE1 = 0,
    #[doc = "1: buffer in use"]
    VALUE2 = 1,
}
impl From<W_BUF_IU_A> for bool {
    #[inline(always)]
    fn from(variant: W_BUF_IU_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `W_BUF_IU` reader - Write buffer in use (opened)"]
pub type W_BUF_IU_R = crate::BitReader<W_BUF_IU_A>;
impl W_BUF_IU_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> W_BUF_IU_A {
        match self.bits {
            false => W_BUF_IU_A::VALUE1,
            true => W_BUF_IU_A::VALUE2,
        }
    }
    #[doc = "buffer not in use"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == W_BUF_IU_A::VALUE1
    }
    #[doc = "buffer in use"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == W_BUF_IU_A::VALUE2
    }
}
impl R {
    #[doc = "Bit 0 - Interrupt Write"]
    #[inline(always)]
    pub fn int_w(&self) -> INT_W_R {
        INT_W_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Interrupt Read"]
    #[inline(always)]
    pub fn int_r(&self) -> INT_R_R {
        INT_R_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 3 - Mailbox mode: mailbox status"]
    #[inline(always)]
    pub fn mb_status(&self) -> MB_STATUS_R {
        MB_STATUS_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bits 4:5 - Buffered mode: buffer status (last written buffer)"]
    #[inline(always)]
    pub fn buf_status(&self) -> BUF_STATUS_R {
        BUF_STATUS_R::new((self.bits >> 4) & 3)
    }
    #[doc = "Bit 6 - Read buffer in use (opened)"]
    #[inline(always)]
    pub fn r_buf_iu(&self) -> R_BUF_IU_R {
        R_BUF_IU_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Write buffer in use (opened)"]
    #[inline(always)]
    pub fn w_buf_iu(&self) -> W_BUF_IU_R {
        W_BUF_IU_R::new(((self.bits >> 7) & 1) != 0)
    }
}
#[doc = "Status Register SyncManager 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sm_status::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct SM_STATUS_SPEC;
impl crate::RegisterSpec for SM_STATUS_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [`sm_status::R`](R) reader structure"]
impl crate::Readable for SM_STATUS_SPEC {}
#[doc = "`reset()` method sets SM_STATUS to value 0x30"]
impl crate::Resettable for SM_STATUS_SPEC {
    const RESET_VALUE: u8 = 0x30;
}