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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#[doc = "Register `TRBSCR` writer"]
pub type W = crate::W<TrbscrSpec>;
#[doc = "Clear Standard Receive Buffer Event\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Csrbi {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear TRBSR.SRBI."]
    Value2 = 1,
}
impl From<Csrbi> for bool {
    #[inline(always)]
    fn from(variant: Csrbi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CSRBI` writer - Clear Standard Receive Buffer Event"]
pub type CsrbiW<'a, REG> = crate::BitWriter<'a, REG, Csrbi>;
impl<'a, REG> CsrbiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Csrbi::Value1)
    }
    #[doc = "Clear TRBSR.SRBI."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Csrbi::Value2)
    }
}
#[doc = "Clear Receive Buffer Error Event\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Crberi {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear TRBSR.RBERI."]
    Value2 = 1,
}
impl From<Crberi> for bool {
    #[inline(always)]
    fn from(variant: Crberi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CRBERI` writer - Clear Receive Buffer Error Event"]
pub type CrberiW<'a, REG> = crate::BitWriter<'a, REG, Crberi>;
impl<'a, REG> CrberiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Crberi::Value1)
    }
    #[doc = "Clear TRBSR.RBERI."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Crberi::Value2)
    }
}
#[doc = "Clear Alternative Receive Buffer Event\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Carbi {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear TRBSR.ARBI."]
    Value2 = 1,
}
impl From<Carbi> for bool {
    #[inline(always)]
    fn from(variant: Carbi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CARBI` writer - Clear Alternative Receive Buffer Event"]
pub type CarbiW<'a, REG> = crate::BitWriter<'a, REG, Carbi>;
impl<'a, REG> CarbiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Carbi::Value1)
    }
    #[doc = "Clear TRBSR.ARBI."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Carbi::Value2)
    }
}
#[doc = "Clear Standard Transmit Buffer Event\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cstbi {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear TRBSR.STBI."]
    Value2 = 1,
}
impl From<Cstbi> for bool {
    #[inline(always)]
    fn from(variant: Cstbi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CSTBI` writer - Clear Standard Transmit Buffer Event"]
pub type CstbiW<'a, REG> = crate::BitWriter<'a, REG, Cstbi>;
impl<'a, REG> CstbiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Cstbi::Value1)
    }
    #[doc = "Clear TRBSR.STBI."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Cstbi::Value2)
    }
}
#[doc = "Clear Transmit Buffer Error Event\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ctberi {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear TRBSR.TBERI."]
    Value2 = 1,
}
impl From<Ctberi> for bool {
    #[inline(always)]
    fn from(variant: Ctberi) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CTBERI` writer - Clear Transmit Buffer Error Event"]
pub type CtberiW<'a, REG> = crate::BitWriter<'a, REG, Ctberi>;
impl<'a, REG> CtberiW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ctberi::Value1)
    }
    #[doc = "Clear TRBSR.TBERI."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ctberi::Value2)
    }
}
#[doc = "Clear Bypass Data Valid\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cbdv {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: Clear BYPCR.BDV."]
    Value2 = 1,
}
impl From<Cbdv> for bool {
    #[inline(always)]
    fn from(variant: Cbdv) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CBDV` writer - Clear Bypass Data Valid"]
pub type CbdvW<'a, REG> = crate::BitWriter<'a, REG, Cbdv>;
impl<'a, REG> CbdvW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Cbdv::Value1)
    }
    #[doc = "Clear BYPCR.BDV."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Cbdv::Value2)
    }
}
#[doc = "Flush Receive Buffer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Flushrb {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: The receive FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."]
    Value2 = 1,
}
impl From<Flushrb> for bool {
    #[inline(always)]
    fn from(variant: Flushrb) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FLUSHRB` writer - Flush Receive Buffer"]
pub type FlushrbW<'a, REG> = crate::BitWriter<'a, REG, Flushrb>;
impl<'a, REG> FlushrbW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Flushrb::Value1)
    }
    #[doc = "The receive FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Flushrb::Value2)
    }
}
#[doc = "Flush Transmit Buffer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Flushtb {
    #[doc = "0: No effect."]
    Value1 = 0,
    #[doc = "1: The transmit FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."]
    Value2 = 1,
}
impl From<Flushtb> for bool {
    #[inline(always)]
    fn from(variant: Flushtb) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FLUSHTB` writer - Flush Transmit Buffer"]
pub type FlushtbW<'a, REG> = crate::BitWriter<'a, REG, Flushtb>;
impl<'a, REG> FlushtbW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Flushtb::Value1)
    }
    #[doc = "The transmit FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Flushtb::Value2)
    }
}
impl W {
    #[doc = "Bit 0 - Clear Standard Receive Buffer Event"]
    #[inline(always)]
    #[must_use]
    pub fn csrbi(&mut self) -> CsrbiW<TrbscrSpec> {
        CsrbiW::new(self, 0)
    }
    #[doc = "Bit 1 - Clear Receive Buffer Error Event"]
    #[inline(always)]
    #[must_use]
    pub fn crberi(&mut self) -> CrberiW<TrbscrSpec> {
        CrberiW::new(self, 1)
    }
    #[doc = "Bit 2 - Clear Alternative Receive Buffer Event"]
    #[inline(always)]
    #[must_use]
    pub fn carbi(&mut self) -> CarbiW<TrbscrSpec> {
        CarbiW::new(self, 2)
    }
    #[doc = "Bit 8 - Clear Standard Transmit Buffer Event"]
    #[inline(always)]
    #[must_use]
    pub fn cstbi(&mut self) -> CstbiW<TrbscrSpec> {
        CstbiW::new(self, 8)
    }
    #[doc = "Bit 9 - Clear Transmit Buffer Error Event"]
    #[inline(always)]
    #[must_use]
    pub fn ctberi(&mut self) -> CtberiW<TrbscrSpec> {
        CtberiW::new(self, 9)
    }
    #[doc = "Bit 10 - Clear Bypass Data Valid"]
    #[inline(always)]
    #[must_use]
    pub fn cbdv(&mut self) -> CbdvW<TrbscrSpec> {
        CbdvW::new(self, 10)
    }
    #[doc = "Bit 14 - Flush Receive Buffer"]
    #[inline(always)]
    #[must_use]
    pub fn flushrb(&mut self) -> FlushrbW<TrbscrSpec> {
        FlushrbW::new(self, 14)
    }
    #[doc = "Bit 15 - Flush Transmit Buffer"]
    #[inline(always)]
    #[must_use]
    pub fn flushtb(&mut self) -> FlushtbW<TrbscrSpec> {
        FlushtbW::new(self, 15)
    }
}
#[doc = "Transmit/Receive Buffer Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trbscr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct TrbscrSpec;
impl crate::RegisterSpec for TrbscrSpec {
    type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [`trbscr::W`](W) writer structure"]
impl crate::Writable for TrbscrSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets TRBSCR to value 0"]
impl crate::Resettable for TrbscrSpec {
    const RESET_VALUE: u32 = 0;
}