xmc4500/usic0_ch0/
tbctr.rs

1#[doc = "Register `TBCTR` reader"]
2pub type R = crate::R<TBCTR_SPEC>;
3#[doc = "Register `TBCTR` writer"]
4pub type W = crate::W<TBCTR_SPEC>;
5#[doc = "Field `DPTR` writer - Data Pointer"]
6pub type DPTR_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
7#[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"]
8pub type LIMIT_R = crate::FieldReader;
9#[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"]
10pub type LIMIT_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
11#[doc = "Standard Transmit Buffer Trigger Mode\n\nValue on reset: 0"]
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub enum STBTM_A {
14    #[doc = "0: Trigger mode 0: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.LIMIT."]
15    VALUE1 = 0,
16    #[doc = "1: Trigger mode 1: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.SIZE."]
17    VALUE2 = 1,
18}
19impl From<STBTM_A> for bool {
20    #[inline(always)]
21    fn from(variant: STBTM_A) -> Self {
22        variant as u8 != 0
23    }
24}
25#[doc = "Field `STBTM` reader - Standard Transmit Buffer Trigger Mode"]
26pub type STBTM_R = crate::BitReader<STBTM_A>;
27impl STBTM_R {
28    #[doc = "Get enumerated values variant"]
29    #[inline(always)]
30    pub const fn variant(&self) -> STBTM_A {
31        match self.bits {
32            false => STBTM_A::VALUE1,
33            true => STBTM_A::VALUE2,
34        }
35    }
36    #[doc = "Trigger mode 0: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.LIMIT."]
37    #[inline(always)]
38    pub fn is_value1(&self) -> bool {
39        *self == STBTM_A::VALUE1
40    }
41    #[doc = "Trigger mode 1: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.SIZE."]
42    #[inline(always)]
43    pub fn is_value2(&self) -> bool {
44        *self == STBTM_A::VALUE2
45    }
46}
47#[doc = "Field `STBTM` writer - Standard Transmit Buffer Trigger Mode"]
48pub type STBTM_W<'a, REG> = crate::BitWriter<'a, REG, STBTM_A>;
49impl<'a, REG> STBTM_W<'a, REG>
50where
51    REG: crate::Writable + crate::RegisterSpec,
52{
53    #[doc = "Trigger mode 0: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.LIMIT."]
54    #[inline(always)]
55    pub fn value1(self) -> &'a mut crate::W<REG> {
56        self.variant(STBTM_A::VALUE1)
57    }
58    #[doc = "Trigger mode 1: While TRBSR.STBT=1, a standard buffer event will be generated whenever there is a data transfer to TBUF or data write to INx (depending on TBCTR.LOF setting). STBT is cleared when TRBSR.TBFLVL=TBCTR.SIZE."]
59    #[inline(always)]
60    pub fn value2(self) -> &'a mut crate::W<REG> {
61        self.variant(STBTM_A::VALUE2)
62    }
63}
64#[doc = "Standard Transmit Buffer Trigger Enable\n\nValue on reset: 0"]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum STBTEN_A {
67    #[doc = "0: The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."]
68    VALUE1 = 0,
69    #[doc = "1: The standard transmit buffer event trigger through bit TRBSR.STBT is enabled."]
70    VALUE2 = 1,
71}
72impl From<STBTEN_A> for bool {
73    #[inline(always)]
74    fn from(variant: STBTEN_A) -> Self {
75        variant as u8 != 0
76    }
77}
78#[doc = "Field `STBTEN` reader - Standard Transmit Buffer Trigger Enable"]
79pub type STBTEN_R = crate::BitReader<STBTEN_A>;
80impl STBTEN_R {
81    #[doc = "Get enumerated values variant"]
82    #[inline(always)]
83    pub const fn variant(&self) -> STBTEN_A {
84        match self.bits {
85            false => STBTEN_A::VALUE1,
86            true => STBTEN_A::VALUE2,
87        }
88    }
89    #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."]
90    #[inline(always)]
91    pub fn is_value1(&self) -> bool {
92        *self == STBTEN_A::VALUE1
93    }
94    #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is enabled."]
95    #[inline(always)]
96    pub fn is_value2(&self) -> bool {
97        *self == STBTEN_A::VALUE2
98    }
99}
100#[doc = "Field `STBTEN` writer - Standard Transmit Buffer Trigger Enable"]
101pub type STBTEN_W<'a, REG> = crate::BitWriter<'a, REG, STBTEN_A>;
102impl<'a, REG> STBTEN_W<'a, REG>
103where
104    REG: crate::Writable + crate::RegisterSpec,
105{
106    #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."]
107    #[inline(always)]
108    pub fn value1(self) -> &'a mut crate::W<REG> {
109        self.variant(STBTEN_A::VALUE1)
110    }
111    #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is enabled."]
112    #[inline(always)]
113    pub fn value2(self) -> &'a mut crate::W<REG> {
114        self.variant(STBTEN_A::VALUE2)
115    }
116}
117#[doc = "Standard Transmit Buffer Interrupt Node Pointer\n\nValue on reset: 0"]
118#[derive(Clone, Copy, Debug, PartialEq, Eq)]
119#[repr(u8)]
120pub enum STBINP_A {
121    #[doc = "0: Output SR0 becomes activated."]
122    VALUE1 = 0,
123    #[doc = "1: Output SR1 becomes activated."]
124    VALUE2 = 1,
125    #[doc = "2: Output SR2 becomes activated."]
126    VALUE3 = 2,
127    #[doc = "3: Output SR3 becomes activated."]
128    VALUE4 = 3,
129    #[doc = "4: Output SR4 becomes activated."]
130    VALUE5 = 4,
131    #[doc = "5: Output SR5 becomes activated."]
132    VALUE6 = 5,
133}
134impl From<STBINP_A> for u8 {
135    #[inline(always)]
136    fn from(variant: STBINP_A) -> Self {
137        variant as _
138    }
139}
140impl crate::FieldSpec for STBINP_A {
141    type Ux = u8;
142}
143impl crate::IsEnum for STBINP_A {}
144#[doc = "Field `STBINP` reader - Standard Transmit Buffer Interrupt Node Pointer"]
145pub type STBINP_R = crate::FieldReader<STBINP_A>;
146impl STBINP_R {
147    #[doc = "Get enumerated values variant"]
148    #[inline(always)]
149    pub const fn variant(&self) -> Option<STBINP_A> {
150        match self.bits {
151            0 => Some(STBINP_A::VALUE1),
152            1 => Some(STBINP_A::VALUE2),
153            2 => Some(STBINP_A::VALUE3),
154            3 => Some(STBINP_A::VALUE4),
155            4 => Some(STBINP_A::VALUE5),
156            5 => Some(STBINP_A::VALUE6),
157            _ => None,
158        }
159    }
160    #[doc = "Output SR0 becomes activated."]
161    #[inline(always)]
162    pub fn is_value1(&self) -> bool {
163        *self == STBINP_A::VALUE1
164    }
165    #[doc = "Output SR1 becomes activated."]
166    #[inline(always)]
167    pub fn is_value2(&self) -> bool {
168        *self == STBINP_A::VALUE2
169    }
170    #[doc = "Output SR2 becomes activated."]
171    #[inline(always)]
172    pub fn is_value3(&self) -> bool {
173        *self == STBINP_A::VALUE3
174    }
175    #[doc = "Output SR3 becomes activated."]
176    #[inline(always)]
177    pub fn is_value4(&self) -> bool {
178        *self == STBINP_A::VALUE4
179    }
180    #[doc = "Output SR4 becomes activated."]
181    #[inline(always)]
182    pub fn is_value5(&self) -> bool {
183        *self == STBINP_A::VALUE5
184    }
185    #[doc = "Output SR5 becomes activated."]
186    #[inline(always)]
187    pub fn is_value6(&self) -> bool {
188        *self == STBINP_A::VALUE6
189    }
190}
191#[doc = "Field `STBINP` writer - Standard Transmit Buffer Interrupt Node Pointer"]
192pub type STBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, STBINP_A>;
193impl<'a, REG> STBINP_W<'a, REG>
194where
195    REG: crate::Writable + crate::RegisterSpec,
196    REG::Ux: From<u8>,
197{
198    #[doc = "Output SR0 becomes activated."]
199    #[inline(always)]
200    pub fn value1(self) -> &'a mut crate::W<REG> {
201        self.variant(STBINP_A::VALUE1)
202    }
203    #[doc = "Output SR1 becomes activated."]
204    #[inline(always)]
205    pub fn value2(self) -> &'a mut crate::W<REG> {
206        self.variant(STBINP_A::VALUE2)
207    }
208    #[doc = "Output SR2 becomes activated."]
209    #[inline(always)]
210    pub fn value3(self) -> &'a mut crate::W<REG> {
211        self.variant(STBINP_A::VALUE3)
212    }
213    #[doc = "Output SR3 becomes activated."]
214    #[inline(always)]
215    pub fn value4(self) -> &'a mut crate::W<REG> {
216        self.variant(STBINP_A::VALUE4)
217    }
218    #[doc = "Output SR4 becomes activated."]
219    #[inline(always)]
220    pub fn value5(self) -> &'a mut crate::W<REG> {
221        self.variant(STBINP_A::VALUE5)
222    }
223    #[doc = "Output SR5 becomes activated."]
224    #[inline(always)]
225    pub fn value6(self) -> &'a mut crate::W<REG> {
226        self.variant(STBINP_A::VALUE6)
227    }
228}
229#[doc = "Alternative Transmit Buffer Interrupt Node Pointer\n\nValue on reset: 0"]
230#[derive(Clone, Copy, Debug, PartialEq, Eq)]
231#[repr(u8)]
232pub enum ATBINP_A {
233    #[doc = "0: Output SR0 becomes activated."]
234    VALUE1 = 0,
235    #[doc = "1: Output SR1 becomes activated."]
236    VALUE2 = 1,
237    #[doc = "2: Output SR2 becomes activated."]
238    VALUE3 = 2,
239    #[doc = "3: Output SR3 becomes activated."]
240    VALUE4 = 3,
241    #[doc = "4: Output SR4 becomes activated."]
242    VALUE5 = 4,
243    #[doc = "5: Output SR5 becomes activated."]
244    VALUE6 = 5,
245}
246impl From<ATBINP_A> for u8 {
247    #[inline(always)]
248    fn from(variant: ATBINP_A) -> Self {
249        variant as _
250    }
251}
252impl crate::FieldSpec for ATBINP_A {
253    type Ux = u8;
254}
255impl crate::IsEnum for ATBINP_A {}
256#[doc = "Field `ATBINP` reader - Alternative Transmit Buffer Interrupt Node Pointer"]
257pub type ATBINP_R = crate::FieldReader<ATBINP_A>;
258impl ATBINP_R {
259    #[doc = "Get enumerated values variant"]
260    #[inline(always)]
261    pub const fn variant(&self) -> Option<ATBINP_A> {
262        match self.bits {
263            0 => Some(ATBINP_A::VALUE1),
264            1 => Some(ATBINP_A::VALUE2),
265            2 => Some(ATBINP_A::VALUE3),
266            3 => Some(ATBINP_A::VALUE4),
267            4 => Some(ATBINP_A::VALUE5),
268            5 => Some(ATBINP_A::VALUE6),
269            _ => None,
270        }
271    }
272    #[doc = "Output SR0 becomes activated."]
273    #[inline(always)]
274    pub fn is_value1(&self) -> bool {
275        *self == ATBINP_A::VALUE1
276    }
277    #[doc = "Output SR1 becomes activated."]
278    #[inline(always)]
279    pub fn is_value2(&self) -> bool {
280        *self == ATBINP_A::VALUE2
281    }
282    #[doc = "Output SR2 becomes activated."]
283    #[inline(always)]
284    pub fn is_value3(&self) -> bool {
285        *self == ATBINP_A::VALUE3
286    }
287    #[doc = "Output SR3 becomes activated."]
288    #[inline(always)]
289    pub fn is_value4(&self) -> bool {
290        *self == ATBINP_A::VALUE4
291    }
292    #[doc = "Output SR4 becomes activated."]
293    #[inline(always)]
294    pub fn is_value5(&self) -> bool {
295        *self == ATBINP_A::VALUE5
296    }
297    #[doc = "Output SR5 becomes activated."]
298    #[inline(always)]
299    pub fn is_value6(&self) -> bool {
300        *self == ATBINP_A::VALUE6
301    }
302}
303#[doc = "Field `ATBINP` writer - Alternative Transmit Buffer Interrupt Node Pointer"]
304pub type ATBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ATBINP_A>;
305impl<'a, REG> ATBINP_W<'a, REG>
306where
307    REG: crate::Writable + crate::RegisterSpec,
308    REG::Ux: From<u8>,
309{
310    #[doc = "Output SR0 becomes activated."]
311    #[inline(always)]
312    pub fn value1(self) -> &'a mut crate::W<REG> {
313        self.variant(ATBINP_A::VALUE1)
314    }
315    #[doc = "Output SR1 becomes activated."]
316    #[inline(always)]
317    pub fn value2(self) -> &'a mut crate::W<REG> {
318        self.variant(ATBINP_A::VALUE2)
319    }
320    #[doc = "Output SR2 becomes activated."]
321    #[inline(always)]
322    pub fn value3(self) -> &'a mut crate::W<REG> {
323        self.variant(ATBINP_A::VALUE3)
324    }
325    #[doc = "Output SR3 becomes activated."]
326    #[inline(always)]
327    pub fn value4(self) -> &'a mut crate::W<REG> {
328        self.variant(ATBINP_A::VALUE4)
329    }
330    #[doc = "Output SR4 becomes activated."]
331    #[inline(always)]
332    pub fn value5(self) -> &'a mut crate::W<REG> {
333        self.variant(ATBINP_A::VALUE5)
334    }
335    #[doc = "Output SR5 becomes activated."]
336    #[inline(always)]
337    pub fn value6(self) -> &'a mut crate::W<REG> {
338        self.variant(ATBINP_A::VALUE6)
339    }
340}
341#[doc = "Buffer Size\n\nValue on reset: 0"]
342#[derive(Clone, Copy, Debug, PartialEq, Eq)]
343#[repr(u8)]
344pub enum SIZE_A {
345    #[doc = "0: The FIFO mechanism is disabled. The buffer does not accept any request for data."]
346    VALUE1 = 0,
347    #[doc = "1: The FIFO buffer contains 2 entries."]
348    VALUE2 = 1,
349    #[doc = "2: The FIFO buffer contains 4 entries."]
350    VALUE3 = 2,
351    #[doc = "3: The FIFO buffer contains 8 entries."]
352    VALUE4 = 3,
353    #[doc = "4: The FIFO buffer contains 16 entries."]
354    VALUE5 = 4,
355    #[doc = "5: The FIFO buffer contains 32 entries."]
356    VALUE6 = 5,
357    #[doc = "6: The FIFO buffer contains 64 entries."]
358    VALUE7 = 6,
359}
360impl From<SIZE_A> for u8 {
361    #[inline(always)]
362    fn from(variant: SIZE_A) -> Self {
363        variant as _
364    }
365}
366impl crate::FieldSpec for SIZE_A {
367    type Ux = u8;
368}
369impl crate::IsEnum for SIZE_A {}
370#[doc = "Field `SIZE` reader - Buffer Size"]
371pub type SIZE_R = crate::FieldReader<SIZE_A>;
372impl SIZE_R {
373    #[doc = "Get enumerated values variant"]
374    #[inline(always)]
375    pub const fn variant(&self) -> Option<SIZE_A> {
376        match self.bits {
377            0 => Some(SIZE_A::VALUE1),
378            1 => Some(SIZE_A::VALUE2),
379            2 => Some(SIZE_A::VALUE3),
380            3 => Some(SIZE_A::VALUE4),
381            4 => Some(SIZE_A::VALUE5),
382            5 => Some(SIZE_A::VALUE6),
383            6 => Some(SIZE_A::VALUE7),
384            _ => None,
385        }
386    }
387    #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."]
388    #[inline(always)]
389    pub fn is_value1(&self) -> bool {
390        *self == SIZE_A::VALUE1
391    }
392    #[doc = "The FIFO buffer contains 2 entries."]
393    #[inline(always)]
394    pub fn is_value2(&self) -> bool {
395        *self == SIZE_A::VALUE2
396    }
397    #[doc = "The FIFO buffer contains 4 entries."]
398    #[inline(always)]
399    pub fn is_value3(&self) -> bool {
400        *self == SIZE_A::VALUE3
401    }
402    #[doc = "The FIFO buffer contains 8 entries."]
403    #[inline(always)]
404    pub fn is_value4(&self) -> bool {
405        *self == SIZE_A::VALUE4
406    }
407    #[doc = "The FIFO buffer contains 16 entries."]
408    #[inline(always)]
409    pub fn is_value5(&self) -> bool {
410        *self == SIZE_A::VALUE5
411    }
412    #[doc = "The FIFO buffer contains 32 entries."]
413    #[inline(always)]
414    pub fn is_value6(&self) -> bool {
415        *self == SIZE_A::VALUE6
416    }
417    #[doc = "The FIFO buffer contains 64 entries."]
418    #[inline(always)]
419    pub fn is_value7(&self) -> bool {
420        *self == SIZE_A::VALUE7
421    }
422}
423#[doc = "Field `SIZE` writer - Buffer Size"]
424pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SIZE_A>;
425impl<'a, REG> SIZE_W<'a, REG>
426where
427    REG: crate::Writable + crate::RegisterSpec,
428    REG::Ux: From<u8>,
429{
430    #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."]
431    #[inline(always)]
432    pub fn value1(self) -> &'a mut crate::W<REG> {
433        self.variant(SIZE_A::VALUE1)
434    }
435    #[doc = "The FIFO buffer contains 2 entries."]
436    #[inline(always)]
437    pub fn value2(self) -> &'a mut crate::W<REG> {
438        self.variant(SIZE_A::VALUE2)
439    }
440    #[doc = "The FIFO buffer contains 4 entries."]
441    #[inline(always)]
442    pub fn value3(self) -> &'a mut crate::W<REG> {
443        self.variant(SIZE_A::VALUE3)
444    }
445    #[doc = "The FIFO buffer contains 8 entries."]
446    #[inline(always)]
447    pub fn value4(self) -> &'a mut crate::W<REG> {
448        self.variant(SIZE_A::VALUE4)
449    }
450    #[doc = "The FIFO buffer contains 16 entries."]
451    #[inline(always)]
452    pub fn value5(self) -> &'a mut crate::W<REG> {
453        self.variant(SIZE_A::VALUE5)
454    }
455    #[doc = "The FIFO buffer contains 32 entries."]
456    #[inline(always)]
457    pub fn value6(self) -> &'a mut crate::W<REG> {
458        self.variant(SIZE_A::VALUE6)
459    }
460    #[doc = "The FIFO buffer contains 64 entries."]
461    #[inline(always)]
462    pub fn value7(self) -> &'a mut crate::W<REG> {
463        self.variant(SIZE_A::VALUE7)
464    }
465}
466#[doc = "Buffer Event on Limit Overflow\n\nValue on reset: 0"]
467#[derive(Clone, Copy, Debug, PartialEq, Eq)]
468pub enum LOF_A {
469    #[doc = "0: A standard transmit buffer event occurs when the filling level equals the limit value and gets lower due to transmission of a data word."]
470    VALUE1 = 0,
471    #[doc = "1: A standard transmit buffer interrupt event occurs when the filling level equals the limit value and gets bigger due to a write access to a data input location INx."]
472    VALUE2 = 1,
473}
474impl From<LOF_A> for bool {
475    #[inline(always)]
476    fn from(variant: LOF_A) -> Self {
477        variant as u8 != 0
478    }
479}
480#[doc = "Field `LOF` reader - Buffer Event on Limit Overflow"]
481pub type LOF_R = crate::BitReader<LOF_A>;
482impl LOF_R {
483    #[doc = "Get enumerated values variant"]
484    #[inline(always)]
485    pub const fn variant(&self) -> LOF_A {
486        match self.bits {
487            false => LOF_A::VALUE1,
488            true => LOF_A::VALUE2,
489        }
490    }
491    #[doc = "A standard transmit buffer event occurs when the filling level equals the limit value and gets lower due to transmission of a data word."]
492    #[inline(always)]
493    pub fn is_value1(&self) -> bool {
494        *self == LOF_A::VALUE1
495    }
496    #[doc = "A standard transmit buffer interrupt event occurs when the filling level equals the limit value and gets bigger due to a write access to a data input location INx."]
497    #[inline(always)]
498    pub fn is_value2(&self) -> bool {
499        *self == LOF_A::VALUE2
500    }
501}
502#[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"]
503pub type LOF_W<'a, REG> = crate::BitWriter<'a, REG, LOF_A>;
504impl<'a, REG> LOF_W<'a, REG>
505where
506    REG: crate::Writable + crate::RegisterSpec,
507{
508    #[doc = "A standard transmit buffer event occurs when the filling level equals the limit value and gets lower due to transmission of a data word."]
509    #[inline(always)]
510    pub fn value1(self) -> &'a mut crate::W<REG> {
511        self.variant(LOF_A::VALUE1)
512    }
513    #[doc = "A standard transmit buffer interrupt event occurs when the filling level equals the limit value and gets bigger due to a write access to a data input location INx."]
514    #[inline(always)]
515    pub fn value2(self) -> &'a mut crate::W<REG> {
516        self.variant(LOF_A::VALUE2)
517    }
518}
519#[doc = "Standard Transmit Buffer Interrupt Enable\n\nValue on reset: 0"]
520#[derive(Clone, Copy, Debug, PartialEq, Eq)]
521pub enum STBIEN_A {
522    #[doc = "0: The standard transmit buffer interrupt generation is disabled."]
523    VALUE1 = 0,
524    #[doc = "1: The standard transmit buffer interrupt generation is enabled."]
525    VALUE2 = 1,
526}
527impl From<STBIEN_A> for bool {
528    #[inline(always)]
529    fn from(variant: STBIEN_A) -> Self {
530        variant as u8 != 0
531    }
532}
533#[doc = "Field `STBIEN` reader - Standard Transmit Buffer Interrupt Enable"]
534pub type STBIEN_R = crate::BitReader<STBIEN_A>;
535impl STBIEN_R {
536    #[doc = "Get enumerated values variant"]
537    #[inline(always)]
538    pub const fn variant(&self) -> STBIEN_A {
539        match self.bits {
540            false => STBIEN_A::VALUE1,
541            true => STBIEN_A::VALUE2,
542        }
543    }
544    #[doc = "The standard transmit buffer interrupt generation is disabled."]
545    #[inline(always)]
546    pub fn is_value1(&self) -> bool {
547        *self == STBIEN_A::VALUE1
548    }
549    #[doc = "The standard transmit buffer interrupt generation is enabled."]
550    #[inline(always)]
551    pub fn is_value2(&self) -> bool {
552        *self == STBIEN_A::VALUE2
553    }
554}
555#[doc = "Field `STBIEN` writer - Standard Transmit Buffer Interrupt Enable"]
556pub type STBIEN_W<'a, REG> = crate::BitWriter<'a, REG, STBIEN_A>;
557impl<'a, REG> STBIEN_W<'a, REG>
558where
559    REG: crate::Writable + crate::RegisterSpec,
560{
561    #[doc = "The standard transmit buffer interrupt generation is disabled."]
562    #[inline(always)]
563    pub fn value1(self) -> &'a mut crate::W<REG> {
564        self.variant(STBIEN_A::VALUE1)
565    }
566    #[doc = "The standard transmit buffer interrupt generation is enabled."]
567    #[inline(always)]
568    pub fn value2(self) -> &'a mut crate::W<REG> {
569        self.variant(STBIEN_A::VALUE2)
570    }
571}
572#[doc = "Transmit Buffer Error Interrupt Enable\n\nValue on reset: 0"]
573#[derive(Clone, Copy, Debug, PartialEq, Eq)]
574pub enum TBERIEN_A {
575    #[doc = "0: The transmit buffer error interrupt generation is disabled."]
576    VALUE1 = 0,
577    #[doc = "1: The transmit buffer error interrupt generation is enabled."]
578    VALUE2 = 1,
579}
580impl From<TBERIEN_A> for bool {
581    #[inline(always)]
582    fn from(variant: TBERIEN_A) -> Self {
583        variant as u8 != 0
584    }
585}
586#[doc = "Field `TBERIEN` reader - Transmit Buffer Error Interrupt Enable"]
587pub type TBERIEN_R = crate::BitReader<TBERIEN_A>;
588impl TBERIEN_R {
589    #[doc = "Get enumerated values variant"]
590    #[inline(always)]
591    pub const fn variant(&self) -> TBERIEN_A {
592        match self.bits {
593            false => TBERIEN_A::VALUE1,
594            true => TBERIEN_A::VALUE2,
595        }
596    }
597    #[doc = "The transmit buffer error interrupt generation is disabled."]
598    #[inline(always)]
599    pub fn is_value1(&self) -> bool {
600        *self == TBERIEN_A::VALUE1
601    }
602    #[doc = "The transmit buffer error interrupt generation is enabled."]
603    #[inline(always)]
604    pub fn is_value2(&self) -> bool {
605        *self == TBERIEN_A::VALUE2
606    }
607}
608#[doc = "Field `TBERIEN` writer - Transmit Buffer Error Interrupt Enable"]
609pub type TBERIEN_W<'a, REG> = crate::BitWriter<'a, REG, TBERIEN_A>;
610impl<'a, REG> TBERIEN_W<'a, REG>
611where
612    REG: crate::Writable + crate::RegisterSpec,
613{
614    #[doc = "The transmit buffer error interrupt generation is disabled."]
615    #[inline(always)]
616    pub fn value1(self) -> &'a mut crate::W<REG> {
617        self.variant(TBERIEN_A::VALUE1)
618    }
619    #[doc = "The transmit buffer error interrupt generation is enabled."]
620    #[inline(always)]
621    pub fn value2(self) -> &'a mut crate::W<REG> {
622        self.variant(TBERIEN_A::VALUE2)
623    }
624}
625impl R {
626    #[doc = "Bits 8:13 - Limit For Interrupt Generation"]
627    #[inline(always)]
628    pub fn limit(&self) -> LIMIT_R {
629        LIMIT_R::new(((self.bits >> 8) & 0x3f) as u8)
630    }
631    #[doc = "Bit 14 - Standard Transmit Buffer Trigger Mode"]
632    #[inline(always)]
633    pub fn stbtm(&self) -> STBTM_R {
634        STBTM_R::new(((self.bits >> 14) & 1) != 0)
635    }
636    #[doc = "Bit 15 - Standard Transmit Buffer Trigger Enable"]
637    #[inline(always)]
638    pub fn stbten(&self) -> STBTEN_R {
639        STBTEN_R::new(((self.bits >> 15) & 1) != 0)
640    }
641    #[doc = "Bits 16:18 - Standard Transmit Buffer Interrupt Node Pointer"]
642    #[inline(always)]
643    pub fn stbinp(&self) -> STBINP_R {
644        STBINP_R::new(((self.bits >> 16) & 7) as u8)
645    }
646    #[doc = "Bits 19:21 - Alternative Transmit Buffer Interrupt Node Pointer"]
647    #[inline(always)]
648    pub fn atbinp(&self) -> ATBINP_R {
649        ATBINP_R::new(((self.bits >> 19) & 7) as u8)
650    }
651    #[doc = "Bits 24:26 - Buffer Size"]
652    #[inline(always)]
653    pub fn size(&self) -> SIZE_R {
654        SIZE_R::new(((self.bits >> 24) & 7) as u8)
655    }
656    #[doc = "Bit 28 - Buffer Event on Limit Overflow"]
657    #[inline(always)]
658    pub fn lof(&self) -> LOF_R {
659        LOF_R::new(((self.bits >> 28) & 1) != 0)
660    }
661    #[doc = "Bit 30 - Standard Transmit Buffer Interrupt Enable"]
662    #[inline(always)]
663    pub fn stbien(&self) -> STBIEN_R {
664        STBIEN_R::new(((self.bits >> 30) & 1) != 0)
665    }
666    #[doc = "Bit 31 - Transmit Buffer Error Interrupt Enable"]
667    #[inline(always)]
668    pub fn tberien(&self) -> TBERIEN_R {
669        TBERIEN_R::new(((self.bits >> 31) & 1) != 0)
670    }
671}
672impl W {
673    #[doc = "Bits 0:5 - Data Pointer"]
674    #[inline(always)]
675    pub fn dptr(&mut self) -> DPTR_W<TBCTR_SPEC> {
676        DPTR_W::new(self, 0)
677    }
678    #[doc = "Bits 8:13 - Limit For Interrupt Generation"]
679    #[inline(always)]
680    pub fn limit(&mut self) -> LIMIT_W<TBCTR_SPEC> {
681        LIMIT_W::new(self, 8)
682    }
683    #[doc = "Bit 14 - Standard Transmit Buffer Trigger Mode"]
684    #[inline(always)]
685    pub fn stbtm(&mut self) -> STBTM_W<TBCTR_SPEC> {
686        STBTM_W::new(self, 14)
687    }
688    #[doc = "Bit 15 - Standard Transmit Buffer Trigger Enable"]
689    #[inline(always)]
690    pub fn stbten(&mut self) -> STBTEN_W<TBCTR_SPEC> {
691        STBTEN_W::new(self, 15)
692    }
693    #[doc = "Bits 16:18 - Standard Transmit Buffer Interrupt Node Pointer"]
694    #[inline(always)]
695    pub fn stbinp(&mut self) -> STBINP_W<TBCTR_SPEC> {
696        STBINP_W::new(self, 16)
697    }
698    #[doc = "Bits 19:21 - Alternative Transmit Buffer Interrupt Node Pointer"]
699    #[inline(always)]
700    pub fn atbinp(&mut self) -> ATBINP_W<TBCTR_SPEC> {
701        ATBINP_W::new(self, 19)
702    }
703    #[doc = "Bits 24:26 - Buffer Size"]
704    #[inline(always)]
705    pub fn size(&mut self) -> SIZE_W<TBCTR_SPEC> {
706        SIZE_W::new(self, 24)
707    }
708    #[doc = "Bit 28 - Buffer Event on Limit Overflow"]
709    #[inline(always)]
710    pub fn lof(&mut self) -> LOF_W<TBCTR_SPEC> {
711        LOF_W::new(self, 28)
712    }
713    #[doc = "Bit 30 - Standard Transmit Buffer Interrupt Enable"]
714    #[inline(always)]
715    pub fn stbien(&mut self) -> STBIEN_W<TBCTR_SPEC> {
716        STBIEN_W::new(self, 30)
717    }
718    #[doc = "Bit 31 - Transmit Buffer Error Interrupt Enable"]
719    #[inline(always)]
720    pub fn tberien(&mut self) -> TBERIEN_W<TBCTR_SPEC> {
721        TBERIEN_W::new(self, 31)
722    }
723}
724#[doc = "Transmitter Buffer Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`tbctr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tbctr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
725pub struct TBCTR_SPEC;
726impl crate::RegisterSpec for TBCTR_SPEC {
727    type Ux = u32;
728}
729#[doc = "`read()` method returns [`tbctr::R`](R) reader structure"]
730impl crate::Readable for TBCTR_SPEC {}
731#[doc = "`write(|w| ..)` method takes [`tbctr::W`](W) writer structure"]
732impl crate::Writable for TBCTR_SPEC {
733    type Safety = crate::Unsafe;
734    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
735    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
736}
737#[doc = "`reset()` method sets TBCTR to value 0"]
738impl crate::Resettable for TBCTR_SPEC {
739    const RESET_VALUE: u32 = 0;
740}