1#[doc = "Register `SSIFSR` reader"]
2pub struct R(crate::R<SSIFSR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SSIFSR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SSIFSR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SSIFSR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SSIFSR` writer"]
17pub struct W(crate::W<SSIFSR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SSIFSR_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<SSIFSR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SSIFSR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RDF` reader - Receive Data Full Flag"]
38pub type RDF_R = crate::BitReader<RDF_A>;
39#[doc = "Receive Data Full Flag\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum RDF_A {
42 #[doc = "0: The size of received data in SSIFRDR is not more than the value of SSISCR.RDFS."]
43 _0 = 0,
44 #[doc = "1: The size of received data in SSIFRDR is not less than the value of SSISCR.RDFS plus one."]
45 _1 = 1,
46}
47impl From<RDF_A> for bool {
48 #[inline(always)]
49 fn from(variant: RDF_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl RDF_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> RDF_A {
57 match self.bits {
58 false => RDF_A::_0,
59 true => RDF_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == RDF_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == RDF_A::_1
71 }
72}
73#[doc = "Field `RDF` writer - Receive Data Full Flag"]
74pub type RDF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSIFSR_SPEC, RDF_A, O>;
75impl<'a, const O: u8> RDF_W<'a, O> {
76 #[doc = "The size of received data in SSIFRDR is not more than the value of SSISCR.RDFS."]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(RDF_A::_0)
80 }
81 #[doc = "The size of received data in SSIFRDR is not less than the value of SSISCR.RDFS plus one."]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(RDF_A::_1)
85 }
86}
87#[doc = "Field `RDC` reader - Number of Receive FIFO Data Indication Flag"]
88pub type RDC_R = crate::FieldReader<u8, u8>;
89#[doc = "Field `TDE` reader - Transmit Data Empty Flag"]
90pub type TDE_R = crate::BitReader<TDE_A>;
91#[doc = "Transmit Data Empty Flag\n\nValue on reset: 1"]
92#[derive(Clone, Copy, Debug, PartialEq, Eq)]
93pub enum TDE_A {
94 #[doc = "0: The free space of SSIFTDR is not more than the value of SSISCR.TDES."]
95 _0 = 0,
96 #[doc = "1: The free space of SSIFTDR is not less than the value of SSISCR.TDES plus one."]
97 _1 = 1,
98}
99impl From<TDE_A> for bool {
100 #[inline(always)]
101 fn from(variant: TDE_A) -> Self {
102 variant as u8 != 0
103 }
104}
105impl TDE_R {
106 #[doc = "Get enumerated values variant"]
107 #[inline(always)]
108 pub fn variant(&self) -> TDE_A {
109 match self.bits {
110 false => TDE_A::_0,
111 true => TDE_A::_1,
112 }
113 }
114 #[doc = "Checks if the value of the field is `_0`"]
115 #[inline(always)]
116 pub fn is_0(&self) -> bool {
117 *self == TDE_A::_0
118 }
119 #[doc = "Checks if the value of the field is `_1`"]
120 #[inline(always)]
121 pub fn is_1(&self) -> bool {
122 *self == TDE_A::_1
123 }
124}
125#[doc = "Field `TDE` writer - Transmit Data Empty Flag"]
126pub type TDE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSIFSR_SPEC, TDE_A, O>;
127impl<'a, const O: u8> TDE_W<'a, O> {
128 #[doc = "The free space of SSIFTDR is not more than the value of SSISCR.TDES."]
129 #[inline(always)]
130 pub fn _0(self) -> &'a mut W {
131 self.variant(TDE_A::_0)
132 }
133 #[doc = "The free space of SSIFTDR is not less than the value of SSISCR.TDES plus one."]
134 #[inline(always)]
135 pub fn _1(self) -> &'a mut W {
136 self.variant(TDE_A::_1)
137 }
138}
139#[doc = "Field `TDC` reader - Number of Transmit FIFO Data Indication Flag"]
140pub type TDC_R = crate::FieldReader<u8, u8>;
141impl R {
142 #[doc = "Bit 0 - Receive Data Full Flag"]
143 #[inline(always)]
144 pub fn rdf(&self) -> RDF_R {
145 RDF_R::new((self.bits & 1) != 0)
146 }
147 #[doc = "Bits 8:13 - Number of Receive FIFO Data Indication Flag"]
148 #[inline(always)]
149 pub fn rdc(&self) -> RDC_R {
150 RDC_R::new(((self.bits >> 8) & 0x3f) as u8)
151 }
152 #[doc = "Bit 16 - Transmit Data Empty Flag"]
153 #[inline(always)]
154 pub fn tde(&self) -> TDE_R {
155 TDE_R::new(((self.bits >> 16) & 1) != 0)
156 }
157 #[doc = "Bits 24:29 - Number of Transmit FIFO Data Indication Flag"]
158 #[inline(always)]
159 pub fn tdc(&self) -> TDC_R {
160 TDC_R::new(((self.bits >> 24) & 0x3f) as u8)
161 }
162}
163impl W {
164 #[doc = "Bit 0 - Receive Data Full Flag"]
165 #[inline(always)]
166 #[must_use]
167 pub fn rdf(&mut self) -> RDF_W<0> {
168 RDF_W::new(self)
169 }
170 #[doc = "Bit 16 - Transmit Data Empty Flag"]
171 #[inline(always)]
172 #[must_use]
173 pub fn tde(&mut self) -> TDE_W<16> {
174 TDE_W::new(self)
175 }
176 #[doc = "Writes raw bits to the register."]
177 #[inline(always)]
178 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
179 self.0.bits(bits);
180 self
181 }
182}
183#[doc = "FIFO 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 [ssifsr](index.html) module"]
184pub struct SSIFSR_SPEC;
185impl crate::RegisterSpec for SSIFSR_SPEC {
186 type Ux = u32;
187}
188#[doc = "`read()` method returns [ssifsr::R](R) reader structure"]
189impl crate::Readable for SSIFSR_SPEC {
190 type Reader = R;
191}
192#[doc = "`write(|w| ..)` method takes [ssifsr::W](W) writer structure"]
193impl crate::Writable for SSIFSR_SPEC {
194 type Writer = W;
195 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
196 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
197}
198#[doc = "`reset()` method sets SSIFSR to value 0x0001_0000"]
199impl crate::Resettable for SSIFSR_SPEC {
200 const RESET_VALUE: Self::Ux = 0x0001_0000;
201}