1#[doc = "Register `BUS%sERRSTAT` reader"]
2pub struct R(crate::R<BUSERRSTAT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BUSERRSTAT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BUSERRSTAT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BUSERRSTAT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `SLERRSTAT` reader - Slave bus Error Status"]
17pub type SLERRSTAT_R = crate::BitReader<SLERRSTAT_A>;
18#[doc = "Slave bus Error Status\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum SLERRSTAT_A {
21 #[doc = "0: No error occurred"]
22 _0 = 0,
23 #[doc = "1: Error occurred"]
24 _1 = 1,
25}
26impl From<SLERRSTAT_A> for bool {
27 #[inline(always)]
28 fn from(variant: SLERRSTAT_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl SLERRSTAT_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> SLERRSTAT_A {
36 match self.bits {
37 false => SLERRSTAT_A::_0,
38 true => SLERRSTAT_A::_1,
39 }
40 }
41 #[doc = "Checks if the value of the field is `_0`"]
42 #[inline(always)]
43 pub fn is_0(&self) -> bool {
44 *self == SLERRSTAT_A::_0
45 }
46 #[doc = "Checks if the value of the field is `_1`"]
47 #[inline(always)]
48 pub fn is_1(&self) -> bool {
49 *self == SLERRSTAT_A::_1
50 }
51}
52#[doc = "Field `STERRSTAT` reader - Slave TrustZone filter Error Status"]
53pub type STERRSTAT_R = crate::BitReader<STERRSTAT_A>;
54#[doc = "Slave TrustZone filter Error Status\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum STERRSTAT_A {
57 #[doc = "0: No error occurred"]
58 _0 = 0,
59 #[doc = "1: Error occurred"]
60 _1 = 1,
61}
62impl From<STERRSTAT_A> for bool {
63 #[inline(always)]
64 fn from(variant: STERRSTAT_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl STERRSTAT_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> STERRSTAT_A {
72 match self.bits {
73 false => STERRSTAT_A::_0,
74 true => STERRSTAT_A::_1,
75 }
76 }
77 #[doc = "Checks if the value of the field is `_0`"]
78 #[inline(always)]
79 pub fn is_0(&self) -> bool {
80 *self == STERRSTAT_A::_0
81 }
82 #[doc = "Checks if the value of the field is `_1`"]
83 #[inline(always)]
84 pub fn is_1(&self) -> bool {
85 *self == STERRSTAT_A::_1
86 }
87}
88#[doc = "Field `MMERRSTAT` reader - Master MPU Error Status"]
89pub type MMERRSTAT_R = crate::BitReader<MMERRSTAT_A>;
90#[doc = "Master MPU Error Status\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum MMERRSTAT_A {
93 #[doc = "0: No error occurred"]
94 _0 = 0,
95 #[doc = "1: Error occurred"]
96 _1 = 1,
97}
98impl From<MMERRSTAT_A> for bool {
99 #[inline(always)]
100 fn from(variant: MMERRSTAT_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl MMERRSTAT_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> MMERRSTAT_A {
108 match self.bits {
109 false => MMERRSTAT_A::_0,
110 true => MMERRSTAT_A::_1,
111 }
112 }
113 #[doc = "Checks if the value of the field is `_0`"]
114 #[inline(always)]
115 pub fn is_0(&self) -> bool {
116 *self == MMERRSTAT_A::_0
117 }
118 #[doc = "Checks if the value of the field is `_1`"]
119 #[inline(always)]
120 pub fn is_1(&self) -> bool {
121 *self == MMERRSTAT_A::_1
122 }
123}
124#[doc = "Field `ILERRSTAT` reader - Illegal address access Error Status"]
125pub type ILERRSTAT_R = crate::BitReader<ILERRSTAT_A>;
126#[doc = "Illegal address access Error Status\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
128pub enum ILERRSTAT_A {
129 #[doc = "0: No error occurred"]
130 _0 = 0,
131 #[doc = "1: Error occurred"]
132 _1 = 1,
133}
134impl From<ILERRSTAT_A> for bool {
135 #[inline(always)]
136 fn from(variant: ILERRSTAT_A) -> Self {
137 variant as u8 != 0
138 }
139}
140impl ILERRSTAT_R {
141 #[doc = "Get enumerated values variant"]
142 #[inline(always)]
143 pub fn variant(&self) -> ILERRSTAT_A {
144 match self.bits {
145 false => ILERRSTAT_A::_0,
146 true => ILERRSTAT_A::_1,
147 }
148 }
149 #[doc = "Checks if the value of the field is `_0`"]
150 #[inline(always)]
151 pub fn is_0(&self) -> bool {
152 *self == ILERRSTAT_A::_0
153 }
154 #[doc = "Checks if the value of the field is `_1`"]
155 #[inline(always)]
156 pub fn is_1(&self) -> bool {
157 *self == ILERRSTAT_A::_1
158 }
159}
160impl R {
161 #[doc = "Bit 0 - Slave bus Error Status"]
162 #[inline(always)]
163 pub fn slerrstat(&self) -> SLERRSTAT_R {
164 SLERRSTAT_R::new((self.bits & 1) != 0)
165 }
166 #[doc = "Bit 1 - Slave TrustZone filter Error Status"]
167 #[inline(always)]
168 pub fn sterrstat(&self) -> STERRSTAT_R {
169 STERRSTAT_R::new(((self.bits >> 1) & 1) != 0)
170 }
171 #[doc = "Bit 3 - Master MPU Error Status"]
172 #[inline(always)]
173 pub fn mmerrstat(&self) -> MMERRSTAT_R {
174 MMERRSTAT_R::new(((self.bits >> 3) & 1) != 0)
175 }
176 #[doc = "Bit 4 - Illegal address access Error Status"]
177 #[inline(always)]
178 pub fn ilerrstat(&self) -> ILERRSTAT_R {
179 ILERRSTAT_R::new(((self.bits >> 4) & 1) != 0)
180 }
181}
182#[doc = "BUS Error Status Register %s\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 [buserrstat](index.html) module"]
183pub struct BUSERRSTAT_SPEC;
184impl crate::RegisterSpec for BUSERRSTAT_SPEC {
185 type Ux = u8;
186}
187#[doc = "`read()` method returns [buserrstat::R](R) reader structure"]
188impl crate::Readable for BUSERRSTAT_SPEC {
189 type Reader = R;
190}
191#[doc = "`reset()` method sets BUS%sERRSTAT to value 0"]
192impl crate::Resettable for BUSERRSTAT_SPEC {
193 const RESET_VALUE: Self::Ux = 0;
194}