1#[doc = "Register `SDRSTAT` reader"]
2pub type R = crate::R<SDRSTAT_SPEC>;
3#[doc = "SDRAM Refresh Error\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum REFERR_A {
6 #[doc = "0: No refresh error."]
7 VALUE1 = 0,
8 #[doc = "1: Refresh error occurred."]
9 VALUE2 = 1,
10}
11impl From<REFERR_A> for bool {
12 #[inline(always)]
13 fn from(variant: REFERR_A) -> Self {
14 variant as u8 != 0
15 }
16}
17#[doc = "Field `REFERR` reader - SDRAM Refresh Error"]
18pub type REFERR_R = crate::BitReader<REFERR_A>;
19impl REFERR_R {
20 #[doc = "Get enumerated values variant"]
21 #[inline(always)]
22 pub const fn variant(&self) -> REFERR_A {
23 match self.bits {
24 false => REFERR_A::VALUE1,
25 true => REFERR_A::VALUE2,
26 }
27 }
28 #[doc = "No refresh error."]
29 #[inline(always)]
30 pub fn is_value1(&self) -> bool {
31 *self == REFERR_A::VALUE1
32 }
33 #[doc = "Refresh error occurred."]
34 #[inline(always)]
35 pub fn is_value2(&self) -> bool {
36 *self == REFERR_A::VALUE2
37 }
38}
39#[doc = "SDRAM Busy\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum SDRMBUSY_A {
42 #[doc = "0: Power-up initialization sequence is not running"]
43 VALUE1 = 0,
44 #[doc = "1: Power-up initialization sequence is running"]
45 VALUE2 = 1,
46}
47impl From<SDRMBUSY_A> for bool {
48 #[inline(always)]
49 fn from(variant: SDRMBUSY_A) -> Self {
50 variant as u8 != 0
51 }
52}
53#[doc = "Field `SDRMBUSY` reader - SDRAM Busy"]
54pub type SDRMBUSY_R = crate::BitReader<SDRMBUSY_A>;
55impl SDRMBUSY_R {
56 #[doc = "Get enumerated values variant"]
57 #[inline(always)]
58 pub const fn variant(&self) -> SDRMBUSY_A {
59 match self.bits {
60 false => SDRMBUSY_A::VALUE1,
61 true => SDRMBUSY_A::VALUE2,
62 }
63 }
64 #[doc = "Power-up initialization sequence is not running"]
65 #[inline(always)]
66 pub fn is_value1(&self) -> bool {
67 *self == SDRMBUSY_A::VALUE1
68 }
69 #[doc = "Power-up initialization sequence is running"]
70 #[inline(always)]
71 pub fn is_value2(&self) -> bool {
72 *self == SDRMBUSY_A::VALUE2
73 }
74}
75#[doc = "SDRAM read error\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum SDERR_A {
78 #[doc = "0: Reads running successfully"]
79 VALUE1 = 0,
80 #[doc = "1: Read error condition has been detected"]
81 VALUE2 = 1,
82}
83impl From<SDERR_A> for bool {
84 #[inline(always)]
85 fn from(variant: SDERR_A) -> Self {
86 variant as u8 != 0
87 }
88}
89#[doc = "Field `SDERR` reader - SDRAM read error"]
90pub type SDERR_R = crate::BitReader<SDERR_A>;
91impl SDERR_R {
92 #[doc = "Get enumerated values variant"]
93 #[inline(always)]
94 pub const fn variant(&self) -> SDERR_A {
95 match self.bits {
96 false => SDERR_A::VALUE1,
97 true => SDERR_A::VALUE2,
98 }
99 }
100 #[doc = "Reads running successfully"]
101 #[inline(always)]
102 pub fn is_value1(&self) -> bool {
103 *self == SDERR_A::VALUE1
104 }
105 #[doc = "Read error condition has been detected"]
106 #[inline(always)]
107 pub fn is_value2(&self) -> bool {
108 *self == SDERR_A::VALUE2
109 }
110}
111impl R {
112 #[doc = "Bit 0 - SDRAM Refresh Error"]
113 #[inline(always)]
114 pub fn referr(&self) -> REFERR_R {
115 REFERR_R::new((self.bits & 1) != 0)
116 }
117 #[doc = "Bit 1 - SDRAM Busy"]
118 #[inline(always)]
119 pub fn sdrmbusy(&self) -> SDRMBUSY_R {
120 SDRMBUSY_R::new(((self.bits >> 1) & 1) != 0)
121 }
122 #[doc = "Bit 2 - SDRAM read error"]
123 #[inline(always)]
124 pub fn sderr(&self) -> SDERR_R {
125 SDERR_R::new(((self.bits >> 2) & 1) != 0)
126 }
127}
128#[doc = "EBU SDRAM Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sdrstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
129pub struct SDRSTAT_SPEC;
130impl crate::RegisterSpec for SDRSTAT_SPEC {
131 type Ux = u32;
132}
133#[doc = "`read()` method returns [`sdrstat::R`](R) reader structure"]
134impl crate::Readable for SDRSTAT_SPEC {}
135#[doc = "`reset()` method sets SDRSTAT to value 0x0001_0000"]
136impl crate::Resettable for SDRSTAT_SPEC {
137 const RESET_VALUE: u32 = 0x0001_0000;
138}