efm32pg12b500_pac/msc/
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 `BUSY` reader - Erase/Write Busy"]
17pub type BUSY_R = crate::BitReader<bool>;
18#[doc = "Field `LOCKED` reader - Access Locked"]
19pub type LOCKED_R = crate::BitReader<bool>;
20#[doc = "Field `INVADDR` reader - Invalid Write Address or Erase Page"]
21pub type INVADDR_R = crate::BitReader<bool>;
22#[doc = "Field `WDATAREADY` reader - WDATA Write Ready"]
23pub type WDATAREADY_R = crate::BitReader<bool>;
24#[doc = "Field `WORDTIMEOUT` reader - Flash Write Word Timeout"]
25pub type WORDTIMEOUT_R = crate::BitReader<bool>;
26#[doc = "Field `ERASEABORTED` reader - The Current Flash Erase Operation Aborted"]
27pub type ERASEABORTED_R = crate::BitReader<bool>;
28#[doc = "Field `PCRUNNING` reader - Performance Counters Running"]
29pub type PCRUNNING_R = crate::BitReader<bool>;
30#[doc = "Field `BANKSWITCHED` reader - BANK SWITCHING STATUS"]
31pub type BANKSWITCHED_R = crate::BitReader<bool>;
32#[doc = "Field `WDATAVALID` reader - Write Data Buffer Valid Flag"]
33pub type WDATAVALID_R = crate::FieldReader<u8, u8>;
34#[doc = "Field `PWRUPCKBDFAILCOUNT` reader - Flash Power Up Checkerboard Pattern Check Fail Count"]
35pub type PWRUPCKBDFAILCOUNT_R = crate::FieldReader<u8, u8>;
36impl R {
37    #[doc = "Bit 0 - Erase/Write Busy"]
38    #[inline(always)]
39    pub fn busy(&self) -> BUSY_R {
40        BUSY_R::new((self.bits & 1) != 0)
41    }
42    #[doc = "Bit 1 - Access Locked"]
43    #[inline(always)]
44    pub fn locked(&self) -> LOCKED_R {
45        LOCKED_R::new(((self.bits >> 1) & 1) != 0)
46    }
47    #[doc = "Bit 2 - Invalid Write Address or Erase Page"]
48    #[inline(always)]
49    pub fn invaddr(&self) -> INVADDR_R {
50        INVADDR_R::new(((self.bits >> 2) & 1) != 0)
51    }
52    #[doc = "Bit 3 - WDATA Write Ready"]
53    #[inline(always)]
54    pub fn wdataready(&self) -> WDATAREADY_R {
55        WDATAREADY_R::new(((self.bits >> 3) & 1) != 0)
56    }
57    #[doc = "Bit 4 - Flash Write Word Timeout"]
58    #[inline(always)]
59    pub fn wordtimeout(&self) -> WORDTIMEOUT_R {
60        WORDTIMEOUT_R::new(((self.bits >> 4) & 1) != 0)
61    }
62    #[doc = "Bit 5 - The Current Flash Erase Operation Aborted"]
63    #[inline(always)]
64    pub fn eraseaborted(&self) -> ERASEABORTED_R {
65        ERASEABORTED_R::new(((self.bits >> 5) & 1) != 0)
66    }
67    #[doc = "Bit 6 - Performance Counters Running"]
68    #[inline(always)]
69    pub fn pcrunning(&self) -> PCRUNNING_R {
70        PCRUNNING_R::new(((self.bits >> 6) & 1) != 0)
71    }
72    #[doc = "Bit 7 - BANK SWITCHING STATUS"]
73    #[inline(always)]
74    pub fn bankswitched(&self) -> BANKSWITCHED_R {
75        BANKSWITCHED_R::new(((self.bits >> 7) & 1) != 0)
76    }
77    #[doc = "Bits 24:27 - Write Data Buffer Valid Flag"]
78    #[inline(always)]
79    pub fn wdatavalid(&self) -> WDATAVALID_R {
80        WDATAVALID_R::new(((self.bits >> 24) & 0x0f) as u8)
81    }
82    #[doc = "Bits 28:31 - Flash Power Up Checkerboard Pattern Check Fail Count"]
83    #[inline(always)]
84    pub fn pwrupckbdfailcount(&self) -> PWRUPCKBDFAILCOUNT_R {
85        PWRUPCKBDFAILCOUNT_R::new(((self.bits >> 28) & 0x0f) as u8)
86    }
87}
88#[doc = "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"]
89pub struct STATUS_SPEC;
90impl crate::RegisterSpec for STATUS_SPEC {
91    type Ux = u32;
92}
93#[doc = "`read()` method returns [status::R](R) reader structure"]
94impl crate::Readable for STATUS_SPEC {
95    type Reader = R;
96}
97#[doc = "`reset()` method sets STATUS to value 0x08"]
98impl crate::Resettable for STATUS_SPEC {
99    #[inline(always)]
100    fn reset_value() -> Self::Ux {
101        0x08
102    }
103}