ra6m1/src/
srcstat.rs

1#[doc = "Register `SRCSTAT` reader"]
2pub struct R(crate::R<SRCSTAT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SRCSTAT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SRCSTAT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SRCSTAT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SRCSTAT` writer"]
17pub struct W(crate::W<SRCSTAT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SRCSTAT_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<SRCSTAT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SRCSTAT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `OINT` reader - Output Data FIFO Full Interrupt Request Flag\n\nThe field is **modified** in some way after a read operation."]
38pub type OINT_R = crate::BitReader<OINT_A>;
39#[doc = "Output Data FIFO Full Interrupt Request Flag\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum OINT_A {
42    #[doc = "0: Number of data units in the output FIFO has not become equal to or greater than the specified triggering number."]
43    _0 = 0,
44    #[doc = "1: Number of data units in the output FIFO has become equal to or greater than the specified triggering number."]
45    _1 = 1,
46}
47impl From<OINT_A> for bool {
48    #[inline(always)]
49    fn from(variant: OINT_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl OINT_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> OINT_A {
57        match self.bits {
58            false => OINT_A::_0,
59            true => OINT_A::_1,
60        }
61    }
62    #[doc = "Checks if the value of the field is `_0`"]
63    #[inline(always)]
64    pub fn is_0(&self) -> bool {
65        *self == OINT_A::_0
66    }
67    #[doc = "Checks if the value of the field is `_1`"]
68    #[inline(always)]
69    pub fn is_1(&self) -> bool {
70        *self == OINT_A::_1
71    }
72}
73#[doc = "Field `OINT` writer - Output Data FIFO Full Interrupt Request Flag"]
74pub type OINT_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, SRCSTAT_SPEC, OINT_A, O>;
75impl<'a, const O: u8> OINT_W<'a, O> {
76    #[doc = "Number of data units in the output FIFO has not become equal to or greater than the specified triggering number."]
77    #[inline(always)]
78    pub fn _0(self) -> &'a mut W {
79        self.variant(OINT_A::_0)
80    }
81    #[doc = "Number of data units in the output FIFO has become equal to or greater than the specified triggering number."]
82    #[inline(always)]
83    pub fn _1(self) -> &'a mut W {
84        self.variant(OINT_A::_1)
85    }
86}
87#[doc = "Field `IINT` reader - Input Data FIFO Empty Interrupt Request Flag\n\nThe field is **modified** in some way after a read operation."]
88pub type IINT_R = crate::BitReader<IINT_A>;
89#[doc = "Input Data FIFO Empty Interrupt Request Flag\n\nValue on reset: 1"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum IINT_A {
92    #[doc = "0: Number of data units in the input FIFO has not become equal to or smaller than the specified triggering number."]
93    _0 = 0,
94    #[doc = "1: Number of data units in the input FIFO has become equal to or smaller than the specified triggering number."]
95    _1 = 1,
96}
97impl From<IINT_A> for bool {
98    #[inline(always)]
99    fn from(variant: IINT_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl IINT_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> IINT_A {
107        match self.bits {
108            false => IINT_A::_0,
109            true => IINT_A::_1,
110        }
111    }
112    #[doc = "Checks if the value of the field is `_0`"]
113    #[inline(always)]
114    pub fn is_0(&self) -> bool {
115        *self == IINT_A::_0
116    }
117    #[doc = "Checks if the value of the field is `_1`"]
118    #[inline(always)]
119    pub fn is_1(&self) -> bool {
120        *self == IINT_A::_1
121    }
122}
123#[doc = "Field `IINT` writer - Input Data FIFO Empty Interrupt Request Flag"]
124pub type IINT_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, SRCSTAT_SPEC, IINT_A, O>;
125impl<'a, const O: u8> IINT_W<'a, O> {
126    #[doc = "Number of data units in the input FIFO has not become equal to or smaller than the specified triggering number."]
127    #[inline(always)]
128    pub fn _0(self) -> &'a mut W {
129        self.variant(IINT_A::_0)
130    }
131    #[doc = "Number of data units in the input FIFO has become equal to or smaller than the specified triggering number."]
132    #[inline(always)]
133    pub fn _1(self) -> &'a mut W {
134        self.variant(IINT_A::_1)
135    }
136}
137#[doc = "Field `OVF` reader - Output Data FIFO Overwrite Interrupt Request Flag\n\nThe field is **modified** in some way after a read operation."]
138pub type OVF_R = crate::BitReader<OVF_A>;
139#[doc = "Output Data FIFO Overwrite Interrupt Request Flag\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum OVF_A {
142    #[doc = "0: Next data conversion processing is not completed."]
143    _0 = 0,
144    #[doc = "1: Next data conversion processing is completed."]
145    _1 = 1,
146}
147impl From<OVF_A> for bool {
148    #[inline(always)]
149    fn from(variant: OVF_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl OVF_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> OVF_A {
157        match self.bits {
158            false => OVF_A::_0,
159            true => OVF_A::_1,
160        }
161    }
162    #[doc = "Checks if the value of the field is `_0`"]
163    #[inline(always)]
164    pub fn is_0(&self) -> bool {
165        *self == OVF_A::_0
166    }
167    #[doc = "Checks if the value of the field is `_1`"]
168    #[inline(always)]
169    pub fn is_1(&self) -> bool {
170        *self == OVF_A::_1
171    }
172}
173#[doc = "Field `OVF` writer - Output Data FIFO Overwrite Interrupt Request Flag"]
174pub type OVF_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, SRCSTAT_SPEC, OVF_A, O>;
175impl<'a, const O: u8> OVF_W<'a, O> {
176    #[doc = "Next data conversion processing is not completed."]
177    #[inline(always)]
178    pub fn _0(self) -> &'a mut W {
179        self.variant(OVF_A::_0)
180    }
181    #[doc = "Next data conversion processing is completed."]
182    #[inline(always)]
183    pub fn _1(self) -> &'a mut W {
184        self.variant(OVF_A::_1)
185    }
186}
187#[doc = "Field `UDF` reader - Output FIFO Underflow Interrupt Request Flag\n\nThe field is **modified** in some way after a read operation."]
188pub type UDF_R = crate::BitReader<UDF_A>;
189#[doc = "Output FIFO Underflow Interrupt Request Flag\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum UDF_A {
192    #[doc = "0: Output data FIFO has not been read out."]
193    _0 = 0,
194    #[doc = "1: Output data FIFO has been read out."]
195    _1 = 1,
196}
197impl From<UDF_A> for bool {
198    #[inline(always)]
199    fn from(variant: UDF_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl UDF_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> UDF_A {
207        match self.bits {
208            false => UDF_A::_0,
209            true => UDF_A::_1,
210        }
211    }
212    #[doc = "Checks if the value of the field is `_0`"]
213    #[inline(always)]
214    pub fn is_0(&self) -> bool {
215        *self == UDF_A::_0
216    }
217    #[doc = "Checks if the value of the field is `_1`"]
218    #[inline(always)]
219    pub fn is_1(&self) -> bool {
220        *self == UDF_A::_1
221    }
222}
223#[doc = "Field `UDF` writer - Output FIFO Underflow Interrupt Request Flag"]
224pub type UDF_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, SRCSTAT_SPEC, UDF_A, O>;
225impl<'a, const O: u8> UDF_W<'a, O> {
226    #[doc = "Output data FIFO has not been read out."]
227    #[inline(always)]
228    pub fn _0(self) -> &'a mut W {
229        self.variant(UDF_A::_0)
230    }
231    #[doc = "Output data FIFO has been read out."]
232    #[inline(always)]
233    pub fn _1(self) -> &'a mut W {
234        self.variant(UDF_A::_1)
235    }
236}
237#[doc = "Field `FLF` reader - Flush Processing Status Flag"]
238pub type FLF_R = crate::BitReader<FLF_A>;
239#[doc = "Flush Processing Status Flag\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
241pub enum FLF_A {
242    #[doc = "0: Flash processing is completed."]
243    _0 = 0,
244    #[doc = "1: Flash processing is in progress."]
245    _1 = 1,
246}
247impl From<FLF_A> for bool {
248    #[inline(always)]
249    fn from(variant: FLF_A) -> Self {
250        variant as u8 != 0
251    }
252}
253impl FLF_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> FLF_A {
257        match self.bits {
258            false => FLF_A::_0,
259            true => FLF_A::_1,
260        }
261    }
262    #[doc = "Checks if the value of the field is `_0`"]
263    #[inline(always)]
264    pub fn is_0(&self) -> bool {
265        *self == FLF_A::_0
266    }
267    #[doc = "Checks if the value of the field is `_1`"]
268    #[inline(always)]
269    pub fn is_1(&self) -> bool {
270        *self == FLF_A::_1
271    }
272}
273#[doc = "Field `CEF` reader - Conversion End Flag\n\nThe field is **modified** in some way after a read operation."]
274pub type CEF_R = crate::BitReader<CEF_A>;
275#[doc = "Conversion End Flag\n\nValue on reset: 0"]
276#[derive(Clone, Copy, Debug, PartialEq, Eq)]
277pub enum CEF_A {
278    #[doc = "0: All of the output data has not been read out."]
279    _0 = 0,
280    #[doc = "1: All of the output data has been read out."]
281    _1 = 1,
282}
283impl From<CEF_A> for bool {
284    #[inline(always)]
285    fn from(variant: CEF_A) -> Self {
286        variant as u8 != 0
287    }
288}
289impl CEF_R {
290    #[doc = "Get enumerated values variant"]
291    #[inline(always)]
292    pub fn variant(&self) -> CEF_A {
293        match self.bits {
294            false => CEF_A::_0,
295            true => CEF_A::_1,
296        }
297    }
298    #[doc = "Checks if the value of the field is `_0`"]
299    #[inline(always)]
300    pub fn is_0(&self) -> bool {
301        *self == CEF_A::_0
302    }
303    #[doc = "Checks if the value of the field is `_1`"]
304    #[inline(always)]
305    pub fn is_1(&self) -> bool {
306        *self == CEF_A::_1
307    }
308}
309#[doc = "Field `CEF` writer - Conversion End Flag"]
310pub type CEF_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, SRCSTAT_SPEC, CEF_A, O>;
311impl<'a, const O: u8> CEF_W<'a, O> {
312    #[doc = "All of the output data has not been read out."]
313    #[inline(always)]
314    pub fn _0(self) -> &'a mut W {
315        self.variant(CEF_A::_0)
316    }
317    #[doc = "All of the output data has been read out."]
318    #[inline(always)]
319    pub fn _1(self) -> &'a mut W {
320        self.variant(CEF_A::_1)
321    }
322}
323#[doc = "Field `IFDN` reader - Input FIFO Data Count"]
324pub type IFDN_R = crate::FieldReader<u8, IFDN_A>;
325#[doc = "Input FIFO Data Count\n\nValue on reset: 0"]
326#[derive(Clone, Copy, Debug, PartialEq, Eq)]
327pub struct IFDN_A(u8);
328impl From<IFDN_A> for u8 {
329    #[inline(always)]
330    fn from(val: IFDN_A) -> Self {
331        val.0 as _
332    }
333}
334#[doc = "Field `OFDN` reader - Output FIFO Data Count"]
335pub type OFDN_R = crate::FieldReader<u8, OFDN_A>;
336#[doc = "Output FIFO Data Count\n\nValue on reset: 0"]
337#[derive(Clone, Copy, Debug, PartialEq, Eq)]
338pub struct OFDN_A(u8);
339impl From<OFDN_A> for u8 {
340    #[inline(always)]
341    fn from(val: OFDN_A) -> Self {
342        val.0 as _
343    }
344}
345impl R {
346    #[doc = "Bit 0 - Output Data FIFO Full Interrupt Request Flag"]
347    #[inline(always)]
348    pub fn oint(&self) -> OINT_R {
349        OINT_R::new((self.bits & 1) != 0)
350    }
351    #[doc = "Bit 1 - Input Data FIFO Empty Interrupt Request Flag"]
352    #[inline(always)]
353    pub fn iint(&self) -> IINT_R {
354        IINT_R::new(((self.bits >> 1) & 1) != 0)
355    }
356    #[doc = "Bit 2 - Output Data FIFO Overwrite Interrupt Request Flag"]
357    #[inline(always)]
358    pub fn ovf(&self) -> OVF_R {
359        OVF_R::new(((self.bits >> 2) & 1) != 0)
360    }
361    #[doc = "Bit 3 - Output FIFO Underflow Interrupt Request Flag"]
362    #[inline(always)]
363    pub fn udf(&self) -> UDF_R {
364        UDF_R::new(((self.bits >> 3) & 1) != 0)
365    }
366    #[doc = "Bit 4 - Flush Processing Status Flag"]
367    #[inline(always)]
368    pub fn flf(&self) -> FLF_R {
369        FLF_R::new(((self.bits >> 4) & 1) != 0)
370    }
371    #[doc = "Bit 5 - Conversion End Flag"]
372    #[inline(always)]
373    pub fn cef(&self) -> CEF_R {
374        CEF_R::new(((self.bits >> 5) & 1) != 0)
375    }
376    #[doc = "Bits 7:10 - Input FIFO Data Count"]
377    #[inline(always)]
378    pub fn ifdn(&self) -> IFDN_R {
379        IFDN_R::new(((self.bits >> 7) & 0x0f) as u8)
380    }
381    #[doc = "Bits 11:15 - Output FIFO Data Count"]
382    #[inline(always)]
383    pub fn ofdn(&self) -> OFDN_R {
384        OFDN_R::new(((self.bits >> 11) & 0x1f) as u8)
385    }
386}
387impl W {
388    #[doc = "Bit 0 - Output Data FIFO Full Interrupt Request Flag"]
389    #[inline(always)]
390    #[must_use]
391    pub fn oint(&mut self) -> OINT_W<0> {
392        OINT_W::new(self)
393    }
394    #[doc = "Bit 1 - Input Data FIFO Empty Interrupt Request Flag"]
395    #[inline(always)]
396    #[must_use]
397    pub fn iint(&mut self) -> IINT_W<1> {
398        IINT_W::new(self)
399    }
400    #[doc = "Bit 2 - Output Data FIFO Overwrite Interrupt Request Flag"]
401    #[inline(always)]
402    #[must_use]
403    pub fn ovf(&mut self) -> OVF_W<2> {
404        OVF_W::new(self)
405    }
406    #[doc = "Bit 3 - Output FIFO Underflow Interrupt Request Flag"]
407    #[inline(always)]
408    #[must_use]
409    pub fn udf(&mut self) -> UDF_W<3> {
410        UDF_W::new(self)
411    }
412    #[doc = "Bit 5 - Conversion End Flag"]
413    #[inline(always)]
414    #[must_use]
415    pub fn cef(&mut self) -> CEF_W<5> {
416        CEF_W::new(self)
417    }
418    #[doc = "Writes raw bits to the register."]
419    #[inline(always)]
420    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
421        self.0.bits(bits);
422        self
423    }
424}
425#[doc = "Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srcstat](index.html) module"]
426pub struct SRCSTAT_SPEC;
427impl crate::RegisterSpec for SRCSTAT_SPEC {
428    type Ux = u16;
429}
430#[doc = "`read()` method returns [srcstat::R](R) reader structure"]
431impl crate::Readable for SRCSTAT_SPEC {
432    type Reader = R;
433}
434#[doc = "`write(|w| ..)` method takes [srcstat::W](W) writer structure"]
435impl crate::Writable for SRCSTAT_SPEC {
436    type Writer = W;
437    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x2f;
438    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
439}
440#[doc = "`reset()` method sets SRCSTAT to value 0x02"]
441impl crate::Resettable for SRCSTAT_SPEC {
442    const RESET_VALUE: Self::Ux = 0x02;
443}