ra6t2/sci_b0/
csr.rs

1#[doc = "Register `CSR` reader"]
2pub struct R(crate::R<CSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `ERS` reader - Error Signal Status Flag"]
17pub type ERS_R = crate::BitReader<ERS_A>;
18#[doc = "Error Signal Status Flag\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum ERS_A {
21    #[doc = "0: Error signal Low not responded"]
22    _0 = 0,
23    #[doc = "1: Error signal Low responded"]
24    _1 = 1,
25}
26impl From<ERS_A> for bool {
27    #[inline(always)]
28    fn from(variant: ERS_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl ERS_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> ERS_A {
36        match self.bits {
37            false => ERS_A::_0,
38            true => ERS_A::_1,
39        }
40    }
41    #[doc = "Checks if the value of the field is `_0`"]
42    #[inline(always)]
43    pub fn is_0(&self) -> bool {
44        *self == ERS_A::_0
45    }
46    #[doc = "Checks if the value of the field is `_1`"]
47    #[inline(always)]
48    pub fn is_1(&self) -> bool {
49        *self == ERS_A::_1
50    }
51}
52#[doc = "Field `RXDMON` reader - Serial input data monitor bit"]
53pub type RXDMON_R = crate::BitReader<RXDMON_A>;
54#[doc = "Serial input data monitor bit\n\nValue on reset: 1"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum RXDMON_A {
57    #[doc = "0: When RINV is 0, RXDn pin is the Low level. When RINV is 1, RXDn pin is the High level."]
58    _0 = 0,
59    #[doc = "1: When RINV is 0, RXDn pin is the High level. When RINV is 1, RXDn pin is the Low level."]
60    _1 = 1,
61}
62impl From<RXDMON_A> for bool {
63    #[inline(always)]
64    fn from(variant: RXDMON_A) -> Self {
65        variant as u8 != 0
66    }
67}
68impl RXDMON_R {
69    #[doc = "Get enumerated values variant"]
70    #[inline(always)]
71    pub fn variant(&self) -> RXDMON_A {
72        match self.bits {
73            false => RXDMON_A::_0,
74            true => RXDMON_A::_1,
75        }
76    }
77    #[doc = "Checks if the value of the field is `_0`"]
78    #[inline(always)]
79    pub fn is_0(&self) -> bool {
80        *self == RXDMON_A::_0
81    }
82    #[doc = "Checks if the value of the field is `_1`"]
83    #[inline(always)]
84    pub fn is_1(&self) -> bool {
85        *self == RXDMON_A::_1
86    }
87}
88#[doc = "Field `DCMF` reader - Data Compare Match Flag"]
89pub type DCMF_R = crate::BitReader<DCMF_A>;
90#[doc = "Data Compare Match Flag\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum DCMF_A {
93    #[doc = "0: No matched"]
94    _0 = 0,
95    #[doc = "1: Matched"]
96    _1 = 1,
97}
98impl From<DCMF_A> for bool {
99    #[inline(always)]
100    fn from(variant: DCMF_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl DCMF_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> DCMF_A {
108        match self.bits {
109            false => DCMF_A::_0,
110            true => DCMF_A::_1,
111        }
112    }
113    #[doc = "Checks if the value of the field is `_0`"]
114    #[inline(always)]
115    pub fn is_0(&self) -> bool {
116        *self == DCMF_A::_0
117    }
118    #[doc = "Checks if the value of the field is `_1`"]
119    #[inline(always)]
120    pub fn is_1(&self) -> bool {
121        *self == DCMF_A::_1
122    }
123}
124#[doc = "Field `DPER` reader - Data Compare Match Parity Error Flag"]
125pub type DPER_R = crate::BitReader<DPER_A>;
126#[doc = "Data Compare Match Parity Error Flag\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
128pub enum DPER_A {
129    #[doc = "0: No parity error occurred at address match detection"]
130    _0 = 0,
131    #[doc = "1: A parity error has occurred at address match detection"]
132    _1 = 1,
133}
134impl From<DPER_A> for bool {
135    #[inline(always)]
136    fn from(variant: DPER_A) -> Self {
137        variant as u8 != 0
138    }
139}
140impl DPER_R {
141    #[doc = "Get enumerated values variant"]
142    #[inline(always)]
143    pub fn variant(&self) -> DPER_A {
144        match self.bits {
145            false => DPER_A::_0,
146            true => DPER_A::_1,
147        }
148    }
149    #[doc = "Checks if the value of the field is `_0`"]
150    #[inline(always)]
151    pub fn is_0(&self) -> bool {
152        *self == DPER_A::_0
153    }
154    #[doc = "Checks if the value of the field is `_1`"]
155    #[inline(always)]
156    pub fn is_1(&self) -> bool {
157        *self == DPER_A::_1
158    }
159}
160#[doc = "Field `DFER` reader - Data Compare Match Framing Error Flag"]
161pub type DFER_R = crate::BitReader<DFER_A>;
162#[doc = "Data Compare Match Framing Error Flag\n\nValue on reset: 0"]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum DFER_A {
165    #[doc = "0: No framing error occurred at address match detection"]
166    _0 = 0,
167    #[doc = "1: A framing error has occurred at address match detection"]
168    _1 = 1,
169}
170impl From<DFER_A> for bool {
171    #[inline(always)]
172    fn from(variant: DFER_A) -> Self {
173        variant as u8 != 0
174    }
175}
176impl DFER_R {
177    #[doc = "Get enumerated values variant"]
178    #[inline(always)]
179    pub fn variant(&self) -> DFER_A {
180        match self.bits {
181            false => DFER_A::_0,
182            true => DFER_A::_1,
183        }
184    }
185    #[doc = "Checks if the value of the field is `_0`"]
186    #[inline(always)]
187    pub fn is_0(&self) -> bool {
188        *self == DFER_A::_0
189    }
190    #[doc = "Checks if the value of the field is `_1`"]
191    #[inline(always)]
192    pub fn is_1(&self) -> bool {
193        *self == DFER_A::_1
194    }
195}
196#[doc = "Field `ORER` reader - Overrun Error Flag"]
197pub type ORER_R = crate::BitReader<ORER_A>;
198#[doc = "Overrun Error Flag\n\nValue on reset: 0"]
199#[derive(Clone, Copy, Debug, PartialEq, Eq)]
200pub enum ORER_A {
201    #[doc = "0: No overrun error occurred"]
202    _0 = 0,
203    #[doc = "1: An overrun error has occurred"]
204    _1 = 1,
205}
206impl From<ORER_A> for bool {
207    #[inline(always)]
208    fn from(variant: ORER_A) -> Self {
209        variant as u8 != 0
210    }
211}
212impl ORER_R {
213    #[doc = "Get enumerated values variant"]
214    #[inline(always)]
215    pub fn variant(&self) -> ORER_A {
216        match self.bits {
217            false => ORER_A::_0,
218            true => ORER_A::_1,
219        }
220    }
221    #[doc = "Checks if the value of the field is `_0`"]
222    #[inline(always)]
223    pub fn is_0(&self) -> bool {
224        *self == ORER_A::_0
225    }
226    #[doc = "Checks if the value of the field is `_1`"]
227    #[inline(always)]
228    pub fn is_1(&self) -> bool {
229        *self == ORER_A::_1
230    }
231}
232#[doc = "Field `MFF` reader - Mode Fault Flag"]
233pub type MFF_R = crate::BitReader<MFF_A>;
234#[doc = "Mode Fault Flag\n\nValue on reset: 0"]
235#[derive(Clone, Copy, Debug, PartialEq, Eq)]
236pub enum MFF_A {
237    #[doc = "0: No mode fault error"]
238    _0 = 0,
239    #[doc = "1: Mode fault error"]
240    _1 = 1,
241}
242impl From<MFF_A> for bool {
243    #[inline(always)]
244    fn from(variant: MFF_A) -> Self {
245        variant as u8 != 0
246    }
247}
248impl MFF_R {
249    #[doc = "Get enumerated values variant"]
250    #[inline(always)]
251    pub fn variant(&self) -> MFF_A {
252        match self.bits {
253            false => MFF_A::_0,
254            true => MFF_A::_1,
255        }
256    }
257    #[doc = "Checks if the value of the field is `_0`"]
258    #[inline(always)]
259    pub fn is_0(&self) -> bool {
260        *self == MFF_A::_0
261    }
262    #[doc = "Checks if the value of the field is `_1`"]
263    #[inline(always)]
264    pub fn is_1(&self) -> bool {
265        *self == MFF_A::_1
266    }
267}
268#[doc = "Field `PER` reader - Parity Error Flag"]
269pub type PER_R = crate::BitReader<PER_A>;
270#[doc = "Parity Error Flag\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq, Eq)]
272pub enum PER_A {
273    #[doc = "0: Non-FIFO selected (CCR3.FM = 0): No parity error occurred FIFO selected (CCR3.FM = 1): No parity error in all received data in receive-FIFO"]
274    _0 = 0,
275    #[doc = "1: Non-FIFO selected (CCR3.FM = 0): A parity error has occurred FIFO selected (CCR3.FM = 1): One or more parity errors occurred in received data in receive-FIFO"]
276    _1 = 1,
277}
278impl From<PER_A> for bool {
279    #[inline(always)]
280    fn from(variant: PER_A) -> Self {
281        variant as u8 != 0
282    }
283}
284impl PER_R {
285    #[doc = "Get enumerated values variant"]
286    #[inline(always)]
287    pub fn variant(&self) -> PER_A {
288        match self.bits {
289            false => PER_A::_0,
290            true => PER_A::_1,
291        }
292    }
293    #[doc = "Checks if the value of the field is `_0`"]
294    #[inline(always)]
295    pub fn is_0(&self) -> bool {
296        *self == PER_A::_0
297    }
298    #[doc = "Checks if the value of the field is `_1`"]
299    #[inline(always)]
300    pub fn is_1(&self) -> bool {
301        *self == PER_A::_1
302    }
303}
304#[doc = "Field `FER` reader - Framing Error Flag"]
305pub type FER_R = crate::BitReader<FER_A>;
306#[doc = "Framing Error Flag\n\nValue on reset: 0"]
307#[derive(Clone, Copy, Debug, PartialEq, Eq)]
308pub enum FER_A {
309    #[doc = "0: Non-FIFO selected (CCR3.FM = 0): No framing error occurred FIFO selected (CCR3.FM = 1): No framing error in all received data in receive-FIFO"]
310    _0 = 0,
311    #[doc = "1: Non-FIFO selected (CCR3.FM = 0): A framing error has occurred FIFO selected (CCR3.FM = 1): One or more framing errors occurred in received data in receive-FIFO"]
312    _1 = 1,
313}
314impl From<FER_A> for bool {
315    #[inline(always)]
316    fn from(variant: FER_A) -> Self {
317        variant as u8 != 0
318    }
319}
320impl FER_R {
321    #[doc = "Get enumerated values variant"]
322    #[inline(always)]
323    pub fn variant(&self) -> FER_A {
324        match self.bits {
325            false => FER_A::_0,
326            true => FER_A::_1,
327        }
328    }
329    #[doc = "Checks if the value of the field is `_0`"]
330    #[inline(always)]
331    pub fn is_0(&self) -> bool {
332        *self == FER_A::_0
333    }
334    #[doc = "Checks if the value of the field is `_1`"]
335    #[inline(always)]
336    pub fn is_1(&self) -> bool {
337        *self == FER_A::_1
338    }
339}
340#[doc = "Field `TDRE` reader - Transmit Data Empty Flag"]
341pub type TDRE_R = crate::BitReader<TDRE_A>;
342#[doc = "Transmit Data Empty Flag\n\nValue on reset: 1"]
343#[derive(Clone, Copy, Debug, PartialEq, Eq)]
344pub enum TDRE_A {
345    #[doc = "0: Non-FIFO selected (CCR3.FM = 0): Transmit data is in TDR register FIFO selected (CCR3.FM = 1): The quantity of transmit data written in transmit-FIFO exceeds the specified transmit triggering number."]
346    _0 = 0,
347    #[doc = "1: Non-FIFO selected (CCR3.FM = 0): No transmit data is in TDR register FIFO selected (CCR3.FM = 1): The quantity of transmit data written in transmit-FIFO is equal to or less than the specified transmit triggering number."]
348    _1 = 1,
349}
350impl From<TDRE_A> for bool {
351    #[inline(always)]
352    fn from(variant: TDRE_A) -> Self {
353        variant as u8 != 0
354    }
355}
356impl TDRE_R {
357    #[doc = "Get enumerated values variant"]
358    #[inline(always)]
359    pub fn variant(&self) -> TDRE_A {
360        match self.bits {
361            false => TDRE_A::_0,
362            true => TDRE_A::_1,
363        }
364    }
365    #[doc = "Checks if the value of the field is `_0`"]
366    #[inline(always)]
367    pub fn is_0(&self) -> bool {
368        *self == TDRE_A::_0
369    }
370    #[doc = "Checks if the value of the field is `_1`"]
371    #[inline(always)]
372    pub fn is_1(&self) -> bool {
373        *self == TDRE_A::_1
374    }
375}
376#[doc = "Field `TEND` reader - Transmit End Flag"]
377pub type TEND_R = crate::BitReader<TEND_A>;
378#[doc = "Transmit End Flag\n\nValue on reset: 1"]
379#[derive(Clone, Copy, Debug, PartialEq, Eq)]
380pub enum TEND_A {
381    #[doc = "0: A character is being transmitted or standing by for transmission."]
382    _0 = 0,
383    #[doc = "1: Character transfer has been completed, or sending Break Field."]
384    _1 = 1,
385}
386impl From<TEND_A> for bool {
387    #[inline(always)]
388    fn from(variant: TEND_A) -> Self {
389        variant as u8 != 0
390    }
391}
392impl TEND_R {
393    #[doc = "Get enumerated values variant"]
394    #[inline(always)]
395    pub fn variant(&self) -> TEND_A {
396        match self.bits {
397            false => TEND_A::_0,
398            true => TEND_A::_1,
399        }
400    }
401    #[doc = "Checks if the value of the field is `_0`"]
402    #[inline(always)]
403    pub fn is_0(&self) -> bool {
404        *self == TEND_A::_0
405    }
406    #[doc = "Checks if the value of the field is `_1`"]
407    #[inline(always)]
408    pub fn is_1(&self) -> bool {
409        *self == TEND_A::_1
410    }
411}
412#[doc = "Field `RDRF` reader - Receive Data Full Flag"]
413pub type RDRF_R = crate::BitReader<RDRF_A>;
414#[doc = "Receive Data Full Flag\n\nValue on reset: 0"]
415#[derive(Clone, Copy, Debug, PartialEq, Eq)]
416pub enum RDRF_A {
417    #[doc = "0: Non-FIFO selected (CCR3.FM = 0): No received data is in RDR register FIFO selected (CCR3.FM = 1): The quantity of receive data written in receive-FIFO falls below the specified receive triggering number."]
418    _0 = 0,
419    #[doc = "1: Non-FIFO selected (CCR3.FM = 0): Received data is in RDR register FIFO selected (CCR3.FM = 1): The quantity of receive data written in receive-FIFO is equal to or greater than the specified receive triggering number."]
420    _1 = 1,
421}
422impl From<RDRF_A> for bool {
423    #[inline(always)]
424    fn from(variant: RDRF_A) -> Self {
425        variant as u8 != 0
426    }
427}
428impl RDRF_R {
429    #[doc = "Get enumerated values variant"]
430    #[inline(always)]
431    pub fn variant(&self) -> RDRF_A {
432        match self.bits {
433            false => RDRF_A::_0,
434            true => RDRF_A::_1,
435        }
436    }
437    #[doc = "Checks if the value of the field is `_0`"]
438    #[inline(always)]
439    pub fn is_0(&self) -> bool {
440        *self == RDRF_A::_0
441    }
442    #[doc = "Checks if the value of the field is `_1`"]
443    #[inline(always)]
444    pub fn is_1(&self) -> bool {
445        *self == RDRF_A::_1
446    }
447}
448impl R {
449    #[doc = "Bit 4 - Error Signal Status Flag"]
450    #[inline(always)]
451    pub fn ers(&self) -> ERS_R {
452        ERS_R::new(((self.bits >> 4) & 1) != 0)
453    }
454    #[doc = "Bit 15 - Serial input data monitor bit"]
455    #[inline(always)]
456    pub fn rxdmon(&self) -> RXDMON_R {
457        RXDMON_R::new(((self.bits >> 15) & 1) != 0)
458    }
459    #[doc = "Bit 16 - Data Compare Match Flag"]
460    #[inline(always)]
461    pub fn dcmf(&self) -> DCMF_R {
462        DCMF_R::new(((self.bits >> 16) & 1) != 0)
463    }
464    #[doc = "Bit 17 - Data Compare Match Parity Error Flag"]
465    #[inline(always)]
466    pub fn dper(&self) -> DPER_R {
467        DPER_R::new(((self.bits >> 17) & 1) != 0)
468    }
469    #[doc = "Bit 18 - Data Compare Match Framing Error Flag"]
470    #[inline(always)]
471    pub fn dfer(&self) -> DFER_R {
472        DFER_R::new(((self.bits >> 18) & 1) != 0)
473    }
474    #[doc = "Bit 24 - Overrun Error Flag"]
475    #[inline(always)]
476    pub fn orer(&self) -> ORER_R {
477        ORER_R::new(((self.bits >> 24) & 1) != 0)
478    }
479    #[doc = "Bit 26 - Mode Fault Flag"]
480    #[inline(always)]
481    pub fn mff(&self) -> MFF_R {
482        MFF_R::new(((self.bits >> 26) & 1) != 0)
483    }
484    #[doc = "Bit 27 - Parity Error Flag"]
485    #[inline(always)]
486    pub fn per(&self) -> PER_R {
487        PER_R::new(((self.bits >> 27) & 1) != 0)
488    }
489    #[doc = "Bit 28 - Framing Error Flag"]
490    #[inline(always)]
491    pub fn fer(&self) -> FER_R {
492        FER_R::new(((self.bits >> 28) & 1) != 0)
493    }
494    #[doc = "Bit 29 - Transmit Data Empty Flag"]
495    #[inline(always)]
496    pub fn tdre(&self) -> TDRE_R {
497        TDRE_R::new(((self.bits >> 29) & 1) != 0)
498    }
499    #[doc = "Bit 30 - Transmit End Flag"]
500    #[inline(always)]
501    pub fn tend(&self) -> TEND_R {
502        TEND_R::new(((self.bits >> 30) & 1) != 0)
503    }
504    #[doc = "Bit 31 - Receive Data Full Flag"]
505    #[inline(always)]
506    pub fn rdrf(&self) -> RDRF_R {
507        RDRF_R::new(((self.bits >> 31) & 1) != 0)
508    }
509}
510#[doc = "Common 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 [csr](index.html) module"]
511pub struct CSR_SPEC;
512impl crate::RegisterSpec for CSR_SPEC {
513    type Ux = u32;
514}
515#[doc = "`read()` method returns [csr::R](R) reader structure"]
516impl crate::Readable for CSR_SPEC {
517    type Reader = R;
518}
519#[doc = "`reset()` method sets CSR to value 0x6000_8000"]
520impl crate::Resettable for CSR_SPEC {
521    const RESET_VALUE: Self::Ux = 0x6000_8000;
522}