Skip to main content

atsams70j21/qspi/
qspi_sr.rs

1#[doc = "Register `QSPI_SR` reader"]
2pub struct R(crate::R<QSPI_SR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<QSPI_SR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<QSPI_SR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<QSPI_SR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `RDRF` reader - Receive Data Register Full (cleared by reading SPI_RDR)"]
17pub struct RDRF_R(crate::FieldReader<bool, bool>);
18impl RDRF_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        RDRF_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for RDRF_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `TDRE` reader - Transmit Data Register Empty (cleared by writing SPI_TDR)"]
32pub struct TDRE_R(crate::FieldReader<bool, bool>);
33impl TDRE_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        TDRE_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for TDRE_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `TXEMPTY` reader - Transmission Registers Empty (cleared by writing SPI_TDR)"]
47pub struct TXEMPTY_R(crate::FieldReader<bool, bool>);
48impl TXEMPTY_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: bool) -> Self {
51        TXEMPTY_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for TXEMPTY_R {
55    type Target = crate::FieldReader<bool, bool>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `OVRES` reader - Overrun Error Status (cleared on read)"]
62pub struct OVRES_R(crate::FieldReader<bool, bool>);
63impl OVRES_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        OVRES_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for OVRES_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76#[doc = "Field `CSR` reader - Chip Select Rise (cleared on read)"]
77pub struct CSR_R(crate::FieldReader<bool, bool>);
78impl CSR_R {
79    #[inline(always)]
80    pub(crate) fn new(bits: bool) -> Self {
81        CSR_R(crate::FieldReader::new(bits))
82    }
83}
84impl core::ops::Deref for CSR_R {
85    type Target = crate::FieldReader<bool, bool>;
86    #[inline(always)]
87    fn deref(&self) -> &Self::Target {
88        &self.0
89    }
90}
91#[doc = "Field `CSS` reader - Chip Select Status"]
92pub struct CSS_R(crate::FieldReader<bool, bool>);
93impl CSS_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: bool) -> Self {
96        CSS_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for CSS_R {
100    type Target = crate::FieldReader<bool, bool>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `INSTRE` reader - Instruction End Status (cleared on read)"]
107pub struct INSTRE_R(crate::FieldReader<bool, bool>);
108impl INSTRE_R {
109    #[inline(always)]
110    pub(crate) fn new(bits: bool) -> Self {
111        INSTRE_R(crate::FieldReader::new(bits))
112    }
113}
114impl core::ops::Deref for INSTRE_R {
115    type Target = crate::FieldReader<bool, bool>;
116    #[inline(always)]
117    fn deref(&self) -> &Self::Target {
118        &self.0
119    }
120}
121#[doc = "Field `QSPIENS` reader - QSPI Enable Status"]
122pub struct QSPIENS_R(crate::FieldReader<bool, bool>);
123impl QSPIENS_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        QSPIENS_R(crate::FieldReader::new(bits))
127    }
128}
129impl core::ops::Deref for QSPIENS_R {
130    type Target = crate::FieldReader<bool, bool>;
131    #[inline(always)]
132    fn deref(&self) -> &Self::Target {
133        &self.0
134    }
135}
136impl R {
137    #[doc = "Bit 0 - Receive Data Register Full (cleared by reading SPI_RDR)"]
138    #[inline(always)]
139    pub fn rdrf(&self) -> RDRF_R {
140        RDRF_R::new((self.bits & 0x01) != 0)
141    }
142    #[doc = "Bit 1 - Transmit Data Register Empty (cleared by writing SPI_TDR)"]
143    #[inline(always)]
144    pub fn tdre(&self) -> TDRE_R {
145        TDRE_R::new(((self.bits >> 1) & 0x01) != 0)
146    }
147    #[doc = "Bit 2 - Transmission Registers Empty (cleared by writing SPI_TDR)"]
148    #[inline(always)]
149    pub fn txempty(&self) -> TXEMPTY_R {
150        TXEMPTY_R::new(((self.bits >> 2) & 0x01) != 0)
151    }
152    #[doc = "Bit 3 - Overrun Error Status (cleared on read)"]
153    #[inline(always)]
154    pub fn ovres(&self) -> OVRES_R {
155        OVRES_R::new(((self.bits >> 3) & 0x01) != 0)
156    }
157    #[doc = "Bit 8 - Chip Select Rise (cleared on read)"]
158    #[inline(always)]
159    pub fn csr(&self) -> CSR_R {
160        CSR_R::new(((self.bits >> 8) & 0x01) != 0)
161    }
162    #[doc = "Bit 9 - Chip Select Status"]
163    #[inline(always)]
164    pub fn css(&self) -> CSS_R {
165        CSS_R::new(((self.bits >> 9) & 0x01) != 0)
166    }
167    #[doc = "Bit 10 - Instruction End Status (cleared on read)"]
168    #[inline(always)]
169    pub fn instre(&self) -> INSTRE_R {
170        INSTRE_R::new(((self.bits >> 10) & 0x01) != 0)
171    }
172    #[doc = "Bit 24 - QSPI Enable Status"]
173    #[inline(always)]
174    pub fn qspiens(&self) -> QSPIENS_R {
175        QSPIENS_R::new(((self.bits >> 24) & 0x01) != 0)
176    }
177}
178#[doc = "Status Register\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 [qspi_sr](index.html) module"]
179pub struct QSPI_SR_SPEC;
180impl crate::RegisterSpec for QSPI_SR_SPEC {
181    type Ux = u32;
182}
183#[doc = "`read()` method returns [qspi_sr::R](R) reader structure"]
184impl crate::Readable for QSPI_SR_SPEC {
185    type Reader = R;
186}
187#[doc = "`reset()` method sets QSPI_SR to value 0"]
188impl crate::Resettable for QSPI_SR_SPEC {
189    #[inline(always)]
190    fn reset_value() -> Self::Ux {
191        0
192    }
193}