efm32gg12b830_pac/pdm/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `ACT` reader - PDM is active"]
17pub type ACT_R = crate::BitReader<bool>;
18#[doc = "Field `FULL` reader - FIFO FULL Status"]
19pub type FULL_R = crate::BitReader<bool>;
20#[doc = "Field `EMPTY` reader - FIFO EMPTY Status"]
21pub type EMPTY_R = crate::BitReader<bool>;
22#[doc = "Field `FIFOCNT` reader - FIFO CNT"]
23pub type FIFOCNT_R = crate::FieldReader<u8, u8>;
24impl R {
25    #[doc = "Bit 0 - PDM is active"]
26    #[inline(always)]
27    pub fn act(&self) -> ACT_R {
28        ACT_R::new((self.bits & 1) != 0)
29    }
30    #[doc = "Bit 4 - FIFO FULL Status"]
31    #[inline(always)]
32    pub fn full(&self) -> FULL_R {
33        FULL_R::new(((self.bits >> 4) & 1) != 0)
34    }
35    #[doc = "Bit 5 - FIFO EMPTY Status"]
36    #[inline(always)]
37    pub fn empty(&self) -> EMPTY_R {
38        EMPTY_R::new(((self.bits >> 5) & 1) != 0)
39    }
40    #[doc = "Bits 8:10 - FIFO CNT"]
41    #[inline(always)]
42    pub fn fifocnt(&self) -> FIFOCNT_R {
43        FIFOCNT_R::new(((self.bits >> 8) & 7) as u8)
44    }
45}
46#[doc = "PDM 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 [status](index.html) module"]
47pub struct STATUS_SPEC;
48impl crate::RegisterSpec for STATUS_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [status::R](R) reader structure"]
52impl crate::Readable for STATUS_SPEC {
53    type Reader = R;
54}
55#[doc = "`reset()` method sets STATUS to value 0x20"]
56impl crate::Resettable for STATUS_SPEC {
57    #[inline(always)]
58    fn reset_value() -> Self::Ux {
59        0x20
60    }
61}