efm32gg12b410_pac/qspi0/
pollingflashstatus.rs

1#[doc = "Register `POLLINGFLASHSTATUS` reader"]
2pub struct R(crate::R<POLLINGFLASHSTATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<POLLINGFLASHSTATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<POLLINGFLASHSTATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<POLLINGFLASHSTATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `POLLINGFLASHSTATUS` writer"]
17pub struct W(crate::W<POLLINGFLASHSTATUS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<POLLINGFLASHSTATUS_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<POLLINGFLASHSTATUS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<POLLINGFLASHSTATUS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DEVICESTATUS` reader - Device Status"]
38pub type DEVICESTATUS_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `DEVICESTATUSVALID` reader - Device Status Valid"]
40pub type DEVICESTATUSVALID_R = crate::BitReader<bool>;
41#[doc = "Field `DEVICESTATUSNBDUMMY` reader - Auto-polling Dummy Cycles"]
42pub type DEVICESTATUSNBDUMMY_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `DEVICESTATUSNBDUMMY` writer - Auto-polling Dummy Cycles"]
44pub type DEVICESTATUSNBDUMMY_W<'a> =
45    crate::FieldWriter<'a, u32, POLLINGFLASHSTATUS_SPEC, u8, u8, 4, 16>;
46impl R {
47    #[doc = "Bits 0:7 - Device Status"]
48    #[inline(always)]
49    pub fn devicestatus(&self) -> DEVICESTATUS_R {
50        DEVICESTATUS_R::new((self.bits & 0xff) as u8)
51    }
52    #[doc = "Bit 8 - Device Status Valid"]
53    #[inline(always)]
54    pub fn devicestatusvalid(&self) -> DEVICESTATUSVALID_R {
55        DEVICESTATUSVALID_R::new(((self.bits >> 8) & 1) != 0)
56    }
57    #[doc = "Bits 16:19 - Auto-polling Dummy Cycles"]
58    #[inline(always)]
59    pub fn devicestatusnbdummy(&self) -> DEVICESTATUSNBDUMMY_R {
60        DEVICESTATUSNBDUMMY_R::new(((self.bits >> 16) & 0x0f) as u8)
61    }
62}
63impl W {
64    #[doc = "Bits 16:19 - Auto-polling Dummy Cycles"]
65    #[inline(always)]
66    pub fn devicestatusnbdummy(&mut self) -> DEVICESTATUSNBDUMMY_W {
67        DEVICESTATUSNBDUMMY_W::new(self)
68    }
69    #[doc = "Writes raw bits to the register."]
70    #[inline(always)]
71    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
72        self.0.bits(bits);
73        self
74    }
75}
76#[doc = "Polling Flash 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 [pollingflashstatus](index.html) module"]
77pub struct POLLINGFLASHSTATUS_SPEC;
78impl crate::RegisterSpec for POLLINGFLASHSTATUS_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [pollingflashstatus::R](R) reader structure"]
82impl crate::Readable for POLLINGFLASHSTATUS_SPEC {
83    type Reader = R;
84}
85#[doc = "`write(|w| ..)` method takes [pollingflashstatus::W](W) writer structure"]
86impl crate::Writable for POLLINGFLASHSTATUS_SPEC {
87    type Writer = W;
88}
89#[doc = "`reset()` method sets POLLINGFLASHSTATUS to value 0"]
90impl crate::Resettable for POLLINGFLASHSTATUS_SPEC {
91    #[inline(always)]
92    fn reset_value() -> Self::Ux {
93        0
94    }
95}