esp8266/spi1/
spi_slave3.rs1#[doc = "Register `SPI_SLAVE3` reader"]
2pub struct R(crate::R<SPI_SLAVE3_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SPI_SLAVE3_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SPI_SLAVE3_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SPI_SLAVE3_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SPI_SLAVE3` writer"]
17pub struct W(crate::W<SPI_SLAVE3_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SPI_SLAVE3_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<SPI_SLAVE3_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SPI_SLAVE3_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `slv_wrsta_cmd_value` reader - In slave mode, it is the value of \"write-status\" command"]
38pub struct SLV_WRSTA_CMD_VALUE_R(crate::FieldReader<u8, u8>);
39impl SLV_WRSTA_CMD_VALUE_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u8) -> Self {
42 SLV_WRSTA_CMD_VALUE_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for SLV_WRSTA_CMD_VALUE_R {
46 type Target = crate::FieldReader<u8, u8>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `slv_wrsta_cmd_value` writer - In slave mode, it is the value of \"write-status\" command"]
53pub struct SLV_WRSTA_CMD_VALUE_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> SLV_WRSTA_CMD_VALUE_W<'a> {
57 #[doc = r"Writes raw bits to the field"]
58 #[inline(always)]
59 pub unsafe fn bits(self, value: u8) -> &'a mut W {
60 self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24);
61 self.w
62 }
63}
64#[doc = "Field `slv_rdsta_cmd_value` reader - In slave mode, it is the value of \"read-status\" command"]
65pub struct SLV_RDSTA_CMD_VALUE_R(crate::FieldReader<u8, u8>);
66impl SLV_RDSTA_CMD_VALUE_R {
67 #[inline(always)]
68 pub(crate) fn new(bits: u8) -> Self {
69 SLV_RDSTA_CMD_VALUE_R(crate::FieldReader::new(bits))
70 }
71}
72impl core::ops::Deref for SLV_RDSTA_CMD_VALUE_R {
73 type Target = crate::FieldReader<u8, u8>;
74 #[inline(always)]
75 fn deref(&self) -> &Self::Target {
76 &self.0
77 }
78}
79#[doc = "Field `slv_rdsta_cmd_value` writer - In slave mode, it is the value of \"read-status\" command"]
80pub struct SLV_RDSTA_CMD_VALUE_W<'a> {
81 w: &'a mut W,
82}
83impl<'a> SLV_RDSTA_CMD_VALUE_W<'a> {
84 #[doc = r"Writes raw bits to the field"]
85 #[inline(always)]
86 pub unsafe fn bits(self, value: u8) -> &'a mut W {
87 self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
88 self.w
89 }
90}
91#[doc = "Field `slv_wrbuf_cmd_value` reader - In slave mode, it is the value of \"write-buffer\" command"]
92pub struct SLV_WRBUF_CMD_VALUE_R(crate::FieldReader<u8, u8>);
93impl SLV_WRBUF_CMD_VALUE_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: u8) -> Self {
96 SLV_WRBUF_CMD_VALUE_R(crate::FieldReader::new(bits))
97 }
98}
99impl core::ops::Deref for SLV_WRBUF_CMD_VALUE_R {
100 type Target = crate::FieldReader<u8, u8>;
101 #[inline(always)]
102 fn deref(&self) -> &Self::Target {
103 &self.0
104 }
105}
106#[doc = "Field `slv_wrbuf_cmd_value` writer - In slave mode, it is the value of \"write-buffer\" command"]
107pub struct SLV_WRBUF_CMD_VALUE_W<'a> {
108 w: &'a mut W,
109}
110impl<'a> SLV_WRBUF_CMD_VALUE_W<'a> {
111 #[doc = r"Writes raw bits to the field"]
112 #[inline(always)]
113 pub unsafe fn bits(self, value: u8) -> &'a mut W {
114 self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
115 self.w
116 }
117}
118#[doc = "Field `slv_rdbuf_cmd_value` reader - In slave mode, it is the value of \"read-buffer\" command"]
119pub struct SLV_RDBUF_CMD_VALUE_R(crate::FieldReader<u8, u8>);
120impl SLV_RDBUF_CMD_VALUE_R {
121 #[inline(always)]
122 pub(crate) fn new(bits: u8) -> Self {
123 SLV_RDBUF_CMD_VALUE_R(crate::FieldReader::new(bits))
124 }
125}
126impl core::ops::Deref for SLV_RDBUF_CMD_VALUE_R {
127 type Target = crate::FieldReader<u8, u8>;
128 #[inline(always)]
129 fn deref(&self) -> &Self::Target {
130 &self.0
131 }
132}
133#[doc = "Field `slv_rdbuf_cmd_value` writer - In slave mode, it is the value of \"read-buffer\" command"]
134pub struct SLV_RDBUF_CMD_VALUE_W<'a> {
135 w: &'a mut W,
136}
137impl<'a> SLV_RDBUF_CMD_VALUE_W<'a> {
138 #[doc = r"Writes raw bits to the field"]
139 #[inline(always)]
140 pub unsafe fn bits(self, value: u8) -> &'a mut W {
141 self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
142 self.w
143 }
144}
145impl R {
146 #[doc = "Bits 24:31 - In slave mode, it is the value of \"write-status\" command"]
147 #[inline(always)]
148 pub fn slv_wrsta_cmd_value(&self) -> SLV_WRSTA_CMD_VALUE_R {
149 SLV_WRSTA_CMD_VALUE_R::new(((self.bits >> 24) & 0xff) as u8)
150 }
151 #[doc = "Bits 16:23 - In slave mode, it is the value of \"read-status\" command"]
152 #[inline(always)]
153 pub fn slv_rdsta_cmd_value(&self) -> SLV_RDSTA_CMD_VALUE_R {
154 SLV_RDSTA_CMD_VALUE_R::new(((self.bits >> 16) & 0xff) as u8)
155 }
156 #[doc = "Bits 8:15 - In slave mode, it is the value of \"write-buffer\" command"]
157 #[inline(always)]
158 pub fn slv_wrbuf_cmd_value(&self) -> SLV_WRBUF_CMD_VALUE_R {
159 SLV_WRBUF_CMD_VALUE_R::new(((self.bits >> 8) & 0xff) as u8)
160 }
161 #[doc = "Bits 0:7 - In slave mode, it is the value of \"read-buffer\" command"]
162 #[inline(always)]
163 pub fn slv_rdbuf_cmd_value(&self) -> SLV_RDBUF_CMD_VALUE_R {
164 SLV_RDBUF_CMD_VALUE_R::new((self.bits & 0xff) as u8)
165 }
166}
167impl W {
168 #[doc = "Bits 24:31 - In slave mode, it is the value of \"write-status\" command"]
169 #[inline(always)]
170 pub fn slv_wrsta_cmd_value(&mut self) -> SLV_WRSTA_CMD_VALUE_W {
171 SLV_WRSTA_CMD_VALUE_W { w: self }
172 }
173 #[doc = "Bits 16:23 - In slave mode, it is the value of \"read-status\" command"]
174 #[inline(always)]
175 pub fn slv_rdsta_cmd_value(&mut self) -> SLV_RDSTA_CMD_VALUE_W {
176 SLV_RDSTA_CMD_VALUE_W { w: self }
177 }
178 #[doc = "Bits 8:15 - In slave mode, it is the value of \"write-buffer\" command"]
179 #[inline(always)]
180 pub fn slv_wrbuf_cmd_value(&mut self) -> SLV_WRBUF_CMD_VALUE_W {
181 SLV_WRBUF_CMD_VALUE_W { w: self }
182 }
183 #[doc = "Bits 0:7 - In slave mode, it is the value of \"read-buffer\" command"]
184 #[inline(always)]
185 pub fn slv_rdbuf_cmd_value(&mut self) -> SLV_RDBUF_CMD_VALUE_W {
186 SLV_RDBUF_CMD_VALUE_W { w: self }
187 }
188 #[doc = "Writes raw bits to the register."]
189 #[inline(always)]
190 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
191 self.0.bits(bits);
192 self
193 }
194}
195#[doc = "In slave mode, it is the value of \"write-status\" command\n\nThis register you can [`read`]
196(crate::generic::Reg::read), [`write_with_zero`]
197(crate::generic::Reg::write_with_zero), [`reset`]
198(crate::generic::Reg::reset), [`write`]
199(crate::generic::Reg::write), [`modify`]
200(crate::generic::Reg::modify). See [API]
201(https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spi_slave3]
202(index.html) module"]
203pub struct SPI_SLAVE3_SPEC;
204impl crate::RegisterSpec for SPI_SLAVE3_SPEC {
205 type Ux = u32;
206}
207#[doc = "`read()` method returns [spi_slave3::R]
208(R) reader structure"]
209impl crate::Readable for SPI_SLAVE3_SPEC {
210 type Reader = R;
211}
212#[doc = "`write(|w| ..)` method takes [spi_slave3::W]
213(W) writer structure"]
214impl crate::Writable for SPI_SLAVE3_SPEC {
215 type Writer = W;
216}
217#[doc = "`reset()` method sets SPI_SLAVE3 to value 0"]
218impl crate::Resettable for SPI_SLAVE3_SPEC {
219 #[inline(always)]
220 fn reset_value() -> Self::Ux {
221 0
222 }
223}