ra4m2/sci3/
frdrhl.rs

1#[doc = "Register `FRDRHL` reader"]
2pub struct R(crate::R<FRDRHL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FRDRHL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FRDRHL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FRDRHL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `RDAT` reader - Serial receive data"]
17pub type RDAT_R = crate::FieldReader<u16, u16>;
18#[doc = "Field `MPB` reader - Multi-Processor Bit Flag"]
19pub type MPB_R = crate::BitReader<MPB_A>;
20#[doc = "Multi-Processor Bit Flag\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum MPB_A {
23    #[doc = "0: Data transmission cycle"]
24    _0 = 0,
25    #[doc = "1: ID transmission cycle"]
26    _1 = 1,
27}
28impl From<MPB_A> for bool {
29    #[inline(always)]
30    fn from(variant: MPB_A) -> Self {
31        variant as u8 != 0
32    }
33}
34impl MPB_R {
35    #[doc = "Get enumerated values variant"]
36    #[inline(always)]
37    pub fn variant(&self) -> MPB_A {
38        match self.bits {
39            false => MPB_A::_0,
40            true => MPB_A::_1,
41        }
42    }
43    #[doc = "Checks if the value of the field is `_0`"]
44    #[inline(always)]
45    pub fn is_0(&self) -> bool {
46        *self == MPB_A::_0
47    }
48    #[doc = "Checks if the value of the field is `_1`"]
49    #[inline(always)]
50    pub fn is_1(&self) -> bool {
51        *self == MPB_A::_1
52    }
53}
54#[doc = "Field `DR` reader - Receive Data Ready Flag"]
55pub type DR_R = crate::BitReader<DR_A>;
56#[doc = "Receive Data Ready Flag\n\nValue on reset: 0"]
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub enum DR_A {
59    #[doc = "0: Receiving is in progress, or no received data remains in the FRDRH and FRDRL registers after successfully completed reception"]
60    _0 = 0,
61    #[doc = "1: Next receive data is not received for a period after successfully completed reception"]
62    _1 = 1,
63}
64impl From<DR_A> for bool {
65    #[inline(always)]
66    fn from(variant: DR_A) -> Self {
67        variant as u8 != 0
68    }
69}
70impl DR_R {
71    #[doc = "Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> DR_A {
74        match self.bits {
75            false => DR_A::_0,
76            true => DR_A::_1,
77        }
78    }
79    #[doc = "Checks if the value of the field is `_0`"]
80    #[inline(always)]
81    pub fn is_0(&self) -> bool {
82        *self == DR_A::_0
83    }
84    #[doc = "Checks if the value of the field is `_1`"]
85    #[inline(always)]
86    pub fn is_1(&self) -> bool {
87        *self == DR_A::_1
88    }
89}
90#[doc = "Field `PER` reader - Parity Error Flag"]
91pub type PER_R = crate::BitReader<PER_A>;
92#[doc = "Parity Error Flag\n\nValue on reset: 0"]
93#[derive(Clone, Copy, Debug, PartialEq, Eq)]
94pub enum PER_A {
95    #[doc = "0: No parity error occurred in the first data of FRDRH and FRDRL"]
96    _0 = 0,
97    #[doc = "1: Parity error occurred in the first data of FRDRH and FRDRL"]
98    _1 = 1,
99}
100impl From<PER_A> for bool {
101    #[inline(always)]
102    fn from(variant: PER_A) -> Self {
103        variant as u8 != 0
104    }
105}
106impl PER_R {
107    #[doc = "Get enumerated values variant"]
108    #[inline(always)]
109    pub fn variant(&self) -> PER_A {
110        match self.bits {
111            false => PER_A::_0,
112            true => PER_A::_1,
113        }
114    }
115    #[doc = "Checks if the value of the field is `_0`"]
116    #[inline(always)]
117    pub fn is_0(&self) -> bool {
118        *self == PER_A::_0
119    }
120    #[doc = "Checks if the value of the field is `_1`"]
121    #[inline(always)]
122    pub fn is_1(&self) -> bool {
123        *self == PER_A::_1
124    }
125}
126#[doc = "Field `FER` reader - Framing Error Flag"]
127pub type FER_R = crate::BitReader<FER_A>;
128#[doc = "Framing Error Flag\n\nValue on reset: 0"]
129#[derive(Clone, Copy, Debug, PartialEq, Eq)]
130pub enum FER_A {
131    #[doc = "0: No framing error occurred in the first data of FRDRH and FRDRL"]
132    _0 = 0,
133    #[doc = "1: Framing error occurred in the first data of FRDRH and FRDRL"]
134    _1 = 1,
135}
136impl From<FER_A> for bool {
137    #[inline(always)]
138    fn from(variant: FER_A) -> Self {
139        variant as u8 != 0
140    }
141}
142impl FER_R {
143    #[doc = "Get enumerated values variant"]
144    #[inline(always)]
145    pub fn variant(&self) -> FER_A {
146        match self.bits {
147            false => FER_A::_0,
148            true => FER_A::_1,
149        }
150    }
151    #[doc = "Checks if the value of the field is `_0`"]
152    #[inline(always)]
153    pub fn is_0(&self) -> bool {
154        *self == FER_A::_0
155    }
156    #[doc = "Checks if the value of the field is `_1`"]
157    #[inline(always)]
158    pub fn is_1(&self) -> bool {
159        *self == FER_A::_1
160    }
161}
162#[doc = "Field `ORER` reader - Overrun Error Flag"]
163pub type ORER_R = crate::BitReader<ORER_A>;
164#[doc = "Overrun Error Flag\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum ORER_A {
167    #[doc = "0: No overrun error occurred"]
168    _0 = 0,
169    #[doc = "1: Overrun error occurred"]
170    _1 = 1,
171}
172impl From<ORER_A> for bool {
173    #[inline(always)]
174    fn from(variant: ORER_A) -> Self {
175        variant as u8 != 0
176    }
177}
178impl ORER_R {
179    #[doc = "Get enumerated values variant"]
180    #[inline(always)]
181    pub fn variant(&self) -> ORER_A {
182        match self.bits {
183            false => ORER_A::_0,
184            true => ORER_A::_1,
185        }
186    }
187    #[doc = "Checks if the value of the field is `_0`"]
188    #[inline(always)]
189    pub fn is_0(&self) -> bool {
190        *self == ORER_A::_0
191    }
192    #[doc = "Checks if the value of the field is `_1`"]
193    #[inline(always)]
194    pub fn is_1(&self) -> bool {
195        *self == ORER_A::_1
196    }
197}
198#[doc = "Field `RDF` reader - Receive FIFO Data Full Flag"]
199pub type RDF_R = crate::BitReader<RDF_A>;
200#[doc = "Receive FIFO Data Full Flag\n\nValue on reset: 0"]
201#[derive(Clone, Copy, Debug, PartialEq, Eq)]
202pub enum RDF_A {
203    #[doc = "0: The amount of receive data written in FRDRH and FRDRL is less than the specified receive triggering number"]
204    _0 = 0,
205    #[doc = "1: The amount of receive data written in FRDRH and FRDRL is equal to or greater than the specified receive triggering number"]
206    _1 = 1,
207}
208impl From<RDF_A> for bool {
209    #[inline(always)]
210    fn from(variant: RDF_A) -> Self {
211        variant as u8 != 0
212    }
213}
214impl RDF_R {
215    #[doc = "Get enumerated values variant"]
216    #[inline(always)]
217    pub fn variant(&self) -> RDF_A {
218        match self.bits {
219            false => RDF_A::_0,
220            true => RDF_A::_1,
221        }
222    }
223    #[doc = "Checks if the value of the field is `_0`"]
224    #[inline(always)]
225    pub fn is_0(&self) -> bool {
226        *self == RDF_A::_0
227    }
228    #[doc = "Checks if the value of the field is `_1`"]
229    #[inline(always)]
230    pub fn is_1(&self) -> bool {
231        *self == RDF_A::_1
232    }
233}
234impl R {
235    #[doc = "Bits 0:8 - Serial receive data"]
236    #[inline(always)]
237    pub fn rdat(&self) -> RDAT_R {
238        RDAT_R::new(self.bits & 0x01ff)
239    }
240    #[doc = "Bit 9 - Multi-Processor Bit Flag"]
241    #[inline(always)]
242    pub fn mpb(&self) -> MPB_R {
243        MPB_R::new(((self.bits >> 9) & 1) != 0)
244    }
245    #[doc = "Bit 10 - Receive Data Ready Flag"]
246    #[inline(always)]
247    pub fn dr(&self) -> DR_R {
248        DR_R::new(((self.bits >> 10) & 1) != 0)
249    }
250    #[doc = "Bit 11 - Parity Error Flag"]
251    #[inline(always)]
252    pub fn per(&self) -> PER_R {
253        PER_R::new(((self.bits >> 11) & 1) != 0)
254    }
255    #[doc = "Bit 12 - Framing Error Flag"]
256    #[inline(always)]
257    pub fn fer(&self) -> FER_R {
258        FER_R::new(((self.bits >> 12) & 1) != 0)
259    }
260    #[doc = "Bit 13 - Overrun Error Flag"]
261    #[inline(always)]
262    pub fn orer(&self) -> ORER_R {
263        ORER_R::new(((self.bits >> 13) & 1) != 0)
264    }
265    #[doc = "Bit 14 - Receive FIFO Data Full Flag"]
266    #[inline(always)]
267    pub fn rdf(&self) -> RDF_R {
268        RDF_R::new(((self.bits >> 14) & 1) != 0)
269    }
270}
271#[doc = "Receive FIFO Data 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 [frdrhl](index.html) module"]
272pub struct FRDRHL_SPEC;
273impl crate::RegisterSpec for FRDRHL_SPEC {
274    type Ux = u16;
275}
276#[doc = "`read()` method returns [frdrhl::R](R) reader structure"]
277impl crate::Readable for FRDRHL_SPEC {
278    type Reader = R;
279}
280#[doc = "`reset()` method sets FRDRHL to value 0"]
281impl crate::Resettable for FRDRHL_SPEC {
282    const RESET_VALUE: Self::Ux = 0;
283}