corstone300_pac/ssp0/
sr.rs1#[doc = "Register `SR` reader"]
6pub struct R(crate::R<SR_SPEC>);
7impl core::ops::Deref for R {
8 type Target = crate::R<SR_SPEC>;
9 #[inline(always)]
10 fn deref(&self) -> &Self::Target {
11 &self.0
12 }
13}
14impl From<crate::R<SR_SPEC>> for R {
15 #[inline(always)]
16 fn from(reader: crate::R<SR_SPEC>) -> Self {
17 R(reader)
18 }
19}
20#[doc = "Register `SR` writer"]
21pub struct W(crate::W<SR_SPEC>);
22impl core::ops::Deref for W {
23 type Target = crate::W<SR_SPEC>;
24 #[inline(always)]
25 fn deref(&self) -> &Self::Target {
26 &self.0
27 }
28}
29impl core::ops::DerefMut for W {
30 #[inline(always)]
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34}
35impl From<crate::W<SR_SPEC>> for W {
36 #[inline(always)]
37 fn from(writer: crate::W<SR_SPEC>) -> Self {
38 W(writer)
39 }
40}
41#[doc = "Field `TFE` reader - Transmit FIFO empty"]
42pub type TFE_R = crate::BitReader<TFE_A>;
43#[doc = "Transmit FIFO empty\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum TFE_A {
46 #[doc = "0: Receive FIFO is not empty"]
47 NE = 0,
48 #[doc = "1: Receive FIFO is empty"]
49 E = 1,
50}
51impl From<TFE_A> for bool {
52 #[inline(always)]
53 fn from(variant: TFE_A) -> Self {
54 variant as u8 != 0
55 }
56}
57impl TFE_R {
58 #[doc = "Get enumerated values variant"]
59 #[inline(always)]
60 pub fn variant(&self) -> TFE_A {
61 match self.bits {
62 false => TFE_A::NE,
63 true => TFE_A::E,
64 }
65 }
66 #[doc = "Checks if the value of the field is `NE`"]
67 #[inline(always)]
68 pub fn is_ne(&self) -> bool {
69 *self == TFE_A::NE
70 }
71 #[doc = "Checks if the value of the field is `E`"]
72 #[inline(always)]
73 pub fn is_e(&self) -> bool {
74 *self == TFE_A::E
75 }
76}
77#[doc = "Field `TFE` writer - Transmit FIFO empty"]
78pub type TFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, TFE_A, O>;
79impl<'a, const O: u8> TFE_W<'a, O> {
80 #[doc = "Receive FIFO is not empty"]
81 #[inline(always)]
82 pub fn ne(self) -> &'a mut W {
83 self.variant(TFE_A::NE)
84 }
85 #[doc = "Receive FIFO is empty"]
86 #[inline(always)]
87 pub fn e(self) -> &'a mut W {
88 self.variant(TFE_A::E)
89 }
90}
91#[doc = "Field `TNF` reader - Transmit FIFO not full"]
92pub type TNF_R = crate::BitReader<TNF_A>;
93#[doc = "Transmit FIFO not full\n\nValue on reset: 0"]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95pub enum TNF_A {
96 #[doc = "0: Receive FIFO is full"]
97 F = 0,
98 #[doc = "1: Receive FIFO is not full"]
99 NF = 1,
100}
101impl From<TNF_A> for bool {
102 #[inline(always)]
103 fn from(variant: TNF_A) -> Self {
104 variant as u8 != 0
105 }
106}
107impl TNF_R {
108 #[doc = "Get enumerated values variant"]
109 #[inline(always)]
110 pub fn variant(&self) -> TNF_A {
111 match self.bits {
112 false => TNF_A::F,
113 true => TNF_A::NF,
114 }
115 }
116 #[doc = "Checks if the value of the field is `F`"]
117 #[inline(always)]
118 pub fn is_f(&self) -> bool {
119 *self == TNF_A::F
120 }
121 #[doc = "Checks if the value of the field is `NF`"]
122 #[inline(always)]
123 pub fn is_nf(&self) -> bool {
124 *self == TNF_A::NF
125 }
126}
127#[doc = "Field `TNF` writer - Transmit FIFO not full"]
128pub type TNF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, TNF_A, O>;
129impl<'a, const O: u8> TNF_W<'a, O> {
130 #[doc = "Receive FIFO is full"]
131 #[inline(always)]
132 pub fn f(self) -> &'a mut W {
133 self.variant(TNF_A::F)
134 }
135 #[doc = "Receive FIFO is not full"]
136 #[inline(always)]
137 pub fn nf(self) -> &'a mut W {
138 self.variant(TNF_A::NF)
139 }
140}
141#[doc = "Field `RNE` reader - Receive FIFO not empty"]
142pub type RNE_R = crate::BitReader<RNE_A>;
143#[doc = "Receive FIFO not empty\n\nValue on reset: 0"]
144#[derive(Clone, Copy, Debug, PartialEq, Eq)]
145pub enum RNE_A {
146 #[doc = "0: Receive FIFO is empty"]
147 E = 0,
148 #[doc = "1: Receive FIFO is not empty"]
149 NE = 1,
150}
151impl From<RNE_A> for bool {
152 #[inline(always)]
153 fn from(variant: RNE_A) -> Self {
154 variant as u8 != 0
155 }
156}
157impl RNE_R {
158 #[doc = "Get enumerated values variant"]
159 #[inline(always)]
160 pub fn variant(&self) -> RNE_A {
161 match self.bits {
162 false => RNE_A::E,
163 true => RNE_A::NE,
164 }
165 }
166 #[doc = "Checks if the value of the field is `E`"]
167 #[inline(always)]
168 pub fn is_e(&self) -> bool {
169 *self == RNE_A::E
170 }
171 #[doc = "Checks if the value of the field is `NE`"]
172 #[inline(always)]
173 pub fn is_ne(&self) -> bool {
174 *self == RNE_A::NE
175 }
176}
177#[doc = "Field `RNE` writer - Receive FIFO not empty"]
178pub type RNE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, RNE_A, O>;
179impl<'a, const O: u8> RNE_W<'a, O> {
180 #[doc = "Receive FIFO is empty"]
181 #[inline(always)]
182 pub fn e(self) -> &'a mut W {
183 self.variant(RNE_A::E)
184 }
185 #[doc = "Receive FIFO is not empty"]
186 #[inline(always)]
187 pub fn ne(self) -> &'a mut W {
188 self.variant(RNE_A::NE)
189 }
190}
191#[doc = "Field `RFF` reader - Receive FIFO full"]
192pub type RFF_R = crate::BitReader<RFF_A>;
193#[doc = "Receive FIFO full\n\nValue on reset: 0"]
194#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195pub enum RFF_A {
196 #[doc = "0: Receive FIFO is not full"]
197 NF = 0,
198 #[doc = "1: Receive FIFO is full"]
199 F = 1,
200}
201impl From<RFF_A> for bool {
202 #[inline(always)]
203 fn from(variant: RFF_A) -> Self {
204 variant as u8 != 0
205 }
206}
207impl RFF_R {
208 #[doc = "Get enumerated values variant"]
209 #[inline(always)]
210 pub fn variant(&self) -> RFF_A {
211 match self.bits {
212 false => RFF_A::NF,
213 true => RFF_A::F,
214 }
215 }
216 #[doc = "Checks if the value of the field is `NF`"]
217 #[inline(always)]
218 pub fn is_nf(&self) -> bool {
219 *self == RFF_A::NF
220 }
221 #[doc = "Checks if the value of the field is `F`"]
222 #[inline(always)]
223 pub fn is_f(&self) -> bool {
224 *self == RFF_A::F
225 }
226}
227#[doc = "Field `RFF` writer - Receive FIFO full"]
228pub type RFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, RFF_A, O>;
229impl<'a, const O: u8> RFF_W<'a, O> {
230 #[doc = "Receive FIFO is not full"]
231 #[inline(always)]
232 pub fn nf(self) -> &'a mut W {
233 self.variant(RFF_A::NF)
234 }
235 #[doc = "Receive FIFO is full"]
236 #[inline(always)]
237 pub fn f(self) -> &'a mut W {
238 self.variant(RFF_A::F)
239 }
240}
241#[doc = "Field `BSY` reader - PrimeCell SSP busy flag"]
242pub type BSY_R = crate::BitReader<BSY_A>;
243#[doc = "PrimeCell SSP busy flag\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq, Eq)]
245pub enum BSY_A {
246 #[doc = "0: SSP is idle"]
247 IDLE = 0,
248 #[doc = "1: SSP is currently transmitting and/or receiving a frame or the transmit FIFO is not empty"]
249 BUSY = 1,
250}
251impl From<BSY_A> for bool {
252 #[inline(always)]
253 fn from(variant: BSY_A) -> Self {
254 variant as u8 != 0
255 }
256}
257impl BSY_R {
258 #[doc = "Get enumerated values variant"]
259 #[inline(always)]
260 pub fn variant(&self) -> BSY_A {
261 match self.bits {
262 false => BSY_A::IDLE,
263 true => BSY_A::BUSY,
264 }
265 }
266 #[doc = "Checks if the value of the field is `IDLE`"]
267 #[inline(always)]
268 pub fn is_idle(&self) -> bool {
269 *self == BSY_A::IDLE
270 }
271 #[doc = "Checks if the value of the field is `BUSY`"]
272 #[inline(always)]
273 pub fn is_busy(&self) -> bool {
274 *self == BSY_A::BUSY
275 }
276}
277#[doc = "Field `BSY` writer - PrimeCell SSP busy flag"]
278pub type BSY_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, BSY_A, O>;
279impl<'a, const O: u8> BSY_W<'a, O> {
280 #[doc = "SSP is idle"]
281 #[inline(always)]
282 pub fn idle(self) -> &'a mut W {
283 self.variant(BSY_A::IDLE)
284 }
285 #[doc = "SSP is currently transmitting and/or receiving a frame or the transmit FIFO is not empty"]
286 #[inline(always)]
287 pub fn busy(self) -> &'a mut W {
288 self.variant(BSY_A::BUSY)
289 }
290}
291impl R {
292 #[doc = "Bit 0 - Transmit FIFO empty"]
293 #[inline(always)]
294 pub fn tfe(&self) -> TFE_R {
295 TFE_R::new((self.bits & 1) != 0)
296 }
297 #[doc = "Bit 1 - Transmit FIFO not full"]
298 #[inline(always)]
299 pub fn tnf(&self) -> TNF_R {
300 TNF_R::new(((self.bits >> 1) & 1) != 0)
301 }
302 #[doc = "Bit 2 - Receive FIFO not empty"]
303 #[inline(always)]
304 pub fn rne(&self) -> RNE_R {
305 RNE_R::new(((self.bits >> 2) & 1) != 0)
306 }
307 #[doc = "Bit 3 - Receive FIFO full"]
308 #[inline(always)]
309 pub fn rff(&self) -> RFF_R {
310 RFF_R::new(((self.bits >> 3) & 1) != 0)
311 }
312 #[doc = "Bit 4 - PrimeCell SSP busy flag"]
313 #[inline(always)]
314 pub fn bsy(&self) -> BSY_R {
315 BSY_R::new(((self.bits >> 4) & 1) != 0)
316 }
317}
318impl W {
319 #[doc = "Bit 0 - Transmit FIFO empty"]
320 #[inline(always)]
321 pub fn tfe(&mut self) -> TFE_W<0> {
322 TFE_W::new(self)
323 }
324 #[doc = "Bit 1 - Transmit FIFO not full"]
325 #[inline(always)]
326 pub fn tnf(&mut self) -> TNF_W<1> {
327 TNF_W::new(self)
328 }
329 #[doc = "Bit 2 - Receive FIFO not empty"]
330 #[inline(always)]
331 pub fn rne(&mut self) -> RNE_W<2> {
332 RNE_W::new(self)
333 }
334 #[doc = "Bit 3 - Receive FIFO full"]
335 #[inline(always)]
336 pub fn rff(&mut self) -> RFF_W<3> {
337 RFF_W::new(self)
338 }
339 #[doc = "Bit 4 - PrimeCell SSP busy flag"]
340 #[inline(always)]
341 pub fn bsy(&mut self) -> BSY_W<4> {
342 BSY_W::new(self)
343 }
344 #[doc = "Writes raw bits to the register."]
345 #[inline(always)]
346 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
347 self.0.bits(bits);
348 self
349 }
350}
351#[doc = "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 [sr](index.html) module"]
352pub struct SR_SPEC;
353impl crate::RegisterSpec for SR_SPEC {
354 type Ux = u32;
355}
356#[doc = "`read()` method returns [sr::R](R) reader structure"]
357impl crate::Readable for SR_SPEC {
358 type Reader = R;
359}
360#[doc = "`write(|w| ..)` method takes [sr::W](W) writer structure"]
361impl crate::Writable for SR_SPEC {
362 type Writer = W;
363}
364#[doc = "`reset()` method sets SR to value 0"]
365impl crate::Resettable for SR_SPEC {
366 #[inline(always)]
367 fn reset_value() -> Self::Ux {
368 0
369 }
370}