eos_s3/pkfb/
pkfb_pf2cnt.rs

1#[doc = "Register `PKFB_PF2CNT` reader"]
2pub struct R(crate::R<PKFB_PF2CNT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PKFB_PF2CNT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PKFB_PF2CNT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PKFB_PF2CNT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `pf2_pop_cnt` reader - FIFO 2 Pop Count (x32 count) Number of available entries for pop"]
17pub struct PF2_POP_CNT_R(crate::FieldReader<u8, u8>);
18impl PF2_POP_CNT_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: u8) -> Self {
21        PF2_POP_CNT_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for PF2_POP_CNT_R {
25    type Target = crate::FieldReader<u8, u8>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `pf2_empty` reader - FIFO 2 Empty"]
32pub struct PF2_EMPTY_R(crate::FieldReader<bool, bool>);
33impl PF2_EMPTY_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        PF2_EMPTY_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for PF2_EMPTY_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `pf2_push_cnt` reader - FIFO 2 Push Count (x32 count) Number of available entries for push"]
47pub struct PF2_PUSH_CNT_R(crate::FieldReader<u8, u8>);
48impl PF2_PUSH_CNT_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: u8) -> Self {
51        PF2_PUSH_CNT_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for PF2_PUSH_CNT_R {
55    type Target = crate::FieldReader<u8, u8>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `pf2_full` reader - FIFO 2 Full"]
62pub struct PF2_FULL_R(crate::FieldReader<bool, bool>);
63impl PF2_FULL_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        PF2_FULL_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for PF2_FULL_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76impl R {
77    #[doc = "Bits 0:7 - FIFO 2 Pop Count (x32 count) Number of available entries for pop"]
78    #[inline(always)]
79    pub fn pf2_pop_cnt(&self) -> PF2_POP_CNT_R {
80        PF2_POP_CNT_R::new((self.bits & 0xff) as u8)
81    }
82    #[doc = "Bit 15 - FIFO 2 Empty"]
83    #[inline(always)]
84    pub fn pf2_empty(&self) -> PF2_EMPTY_R {
85        PF2_EMPTY_R::new(((self.bits >> 15) & 0x01) != 0)
86    }
87    #[doc = "Bits 16:23 - FIFO 2 Push Count (x32 count) Number of available entries for push"]
88    #[inline(always)]
89    pub fn pf2_push_cnt(&self) -> PF2_PUSH_CNT_R {
90        PF2_PUSH_CNT_R::new(((self.bits >> 16) & 0xff) as u8)
91    }
92    #[doc = "Bit 31 - FIFO 2 Full"]
93    #[inline(always)]
94    pub fn pf2_full(&self) -> PF2_FULL_R {
95        PF2_FULL_R::new(((self.bits >> 31) & 0x01) != 0)
96    }
97}
98#[doc = "FIFO 2 Count\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 [pkfb_pf2cnt](index.html) module"]
99pub struct PKFB_PF2CNT_SPEC;
100impl crate::RegisterSpec for PKFB_PF2CNT_SPEC {
101    type Ux = u32;
102}
103#[doc = "`read()` method returns [pkfb_pf2cnt::R](R) reader structure"]
104impl crate::Readable for PKFB_PF2CNT_SPEC {
105    type Reader = R;
106}
107#[doc = "`reset()` method sets PKFB_PF2CNT to value 0x0080_8000"]
108impl crate::Resettable for PKFB_PF2CNT_SPEC {
109    #[inline(always)]
110    fn reset_value() -> Self::Ux {
111        0x0080_8000
112    }
113}