1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#[doc = "Register `SLAVE1` reader"]
pub struct R(crate::R<SLAVE1_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SLAVE1_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SLAVE1_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SLAVE1_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SLAVE1` writer"]
pub struct W(crate::W<SLAVE1_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SLAVE1_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SLAVE1_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SLAVE1_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `SLV_ADDR_ERR_CLR` reader - 1: Clear SPI_SLV_ADDR_ERR. 0: not valid. Can be changed by CONF_buf."]
pub type SLV_ADDR_ERR_CLR_R = crate::BitReader<bool>;
#[doc = "Field `SLV_ADDR_ERR_CLR` writer - 1: Clear SPI_SLV_ADDR_ERR. 0: not valid. Can be changed by CONF_buf."]
pub type SLV_ADDR_ERR_CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLAVE1_SPEC, bool, O>;
#[doc = "Field `SLV_CMD_ERR_CLR` reader - 1: Clear SPI_SLV_CMD_ERR. 0: not valid. Can be changed by CONF_buf."]
pub type SLV_CMD_ERR_CLR_R = crate::BitReader<bool>;
#[doc = "Field `SLV_CMD_ERR_CLR` writer - 1: Clear SPI_SLV_CMD_ERR. 0: not valid. Can be changed by CONF_buf."]
pub type SLV_CMD_ERR_CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLAVE1_SPEC, bool, O>;
#[doc = "Field `SLV_NO_QPI_EN` reader - 1: spi slave QPI mode is not supported. 0: spi slave QPI mode is supported."]
pub type SLV_NO_QPI_EN_R = crate::BitReader<bool>;
#[doc = "Field `SLV_NO_QPI_EN` writer - 1: spi slave QPI mode is not supported. 0: spi slave QPI mode is supported."]
pub type SLV_NO_QPI_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLAVE1_SPEC, bool, O>;
#[doc = "Field `SLV_ADDR_ERR` reader - 1: The address value of the last SPI transfer is not supported by SPI slave. 0: The address value is supported or no address value is received."]
pub type SLV_ADDR_ERR_R = crate::BitReader<bool>;
#[doc = "Field `SLV_CMD_ERR` reader - 1: The command value of the last SPI transfer is not supported by SPI slave. 0: The command value is supported or no command value is received."]
pub type SLV_CMD_ERR_R = crate::BitReader<bool>;
#[doc = "Field `SLV_WR_DMA_DONE` reader - The interrupt raw bit for the completion of dma write operation in the slave mode. Can not be changed by CONF_buf."]
pub type SLV_WR_DMA_DONE_R = crate::BitReader<bool>;
#[doc = "Field `SLV_WR_DMA_DONE` writer - The interrupt raw bit for the completion of dma write operation in the slave mode. Can not be changed by CONF_buf."]
pub type SLV_WR_DMA_DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLAVE1_SPEC, bool, O>;
#[doc = "Field `SLV_LAST_COMMAND` reader - In the slave mode it is the value of command."]
pub type SLV_LAST_COMMAND_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SLV_LAST_COMMAND` writer - In the slave mode it is the value of command."]
pub type SLV_LAST_COMMAND_W<'a, const O: u8> =
crate::FieldWriter<'a, u32, SLAVE1_SPEC, u8, u8, 8, O>;
#[doc = "Field `SLV_LAST_ADDR` reader - In the slave mode it is the value of address."]
pub type SLV_LAST_ADDR_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SLV_LAST_ADDR` writer - In the slave mode it is the value of address."]
pub type SLV_LAST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SLAVE1_SPEC, u8, u8, 8, O>;
impl R {
#[doc = "Bit 10 - 1: Clear SPI_SLV_ADDR_ERR. 0: not valid. Can be changed by CONF_buf."]
#[inline(always)]
pub fn slv_addr_err_clr(&self) -> SLV_ADDR_ERR_CLR_R {
SLV_ADDR_ERR_CLR_R::new(((self.bits >> 10) & 1) != 0)
}
#[doc = "Bit 11 - 1: Clear SPI_SLV_CMD_ERR. 0: not valid. Can be changed by CONF_buf."]
#[inline(always)]
pub fn slv_cmd_err_clr(&self) -> SLV_CMD_ERR_CLR_R {
SLV_CMD_ERR_CLR_R::new(((self.bits >> 11) & 1) != 0)
}
#[doc = "Bit 12 - 1: spi slave QPI mode is not supported. 0: spi slave QPI mode is supported."]
#[inline(always)]
pub fn slv_no_qpi_en(&self) -> SLV_NO_QPI_EN_R {
SLV_NO_QPI_EN_R::new(((self.bits >> 12) & 1) != 0)
}
#[doc = "Bit 13 - 1: The address value of the last SPI transfer is not supported by SPI slave. 0: The address value is supported or no address value is received."]
#[inline(always)]
pub fn slv_addr_err(&self) -> SLV_ADDR_ERR_R {
SLV_ADDR_ERR_R::new(((self.bits >> 13) & 1) != 0)
}
#[doc = "Bit 14 - 1: The command value of the last SPI transfer is not supported by SPI slave. 0: The command value is supported or no command value is received."]
#[inline(always)]
pub fn slv_cmd_err(&self) -> SLV_CMD_ERR_R {
SLV_CMD_ERR_R::new(((self.bits >> 14) & 1) != 0)
}
#[doc = "Bit 15 - The interrupt raw bit for the completion of dma write operation in the slave mode. Can not be changed by CONF_buf."]
#[inline(always)]
pub fn slv_wr_dma_done(&self) -> SLV_WR_DMA_DONE_R {
SLV_WR_DMA_DONE_R::new(((self.bits >> 15) & 1) != 0)
}
#[doc = "Bits 16:23 - In the slave mode it is the value of command."]
#[inline(always)]
pub fn slv_last_command(&self) -> SLV_LAST_COMMAND_R {
SLV_LAST_COMMAND_R::new(((self.bits >> 16) & 0xff) as u8)
}
#[doc = "Bits 24:31 - In the slave mode it is the value of address."]
#[inline(always)]
pub fn slv_last_addr(&self) -> SLV_LAST_ADDR_R {
SLV_LAST_ADDR_R::new(((self.bits >> 24) & 0xff) as u8)
}
}
impl W {
#[doc = "Bit 10 - 1: Clear SPI_SLV_ADDR_ERR. 0: not valid. Can be changed by CONF_buf."]
#[inline(always)]
#[must_use]
pub fn slv_addr_err_clr(&mut self) -> SLV_ADDR_ERR_CLR_W<10> {
SLV_ADDR_ERR_CLR_W::new(self)
}
#[doc = "Bit 11 - 1: Clear SPI_SLV_CMD_ERR. 0: not valid. Can be changed by CONF_buf."]
#[inline(always)]
#[must_use]
pub fn slv_cmd_err_clr(&mut self) -> SLV_CMD_ERR_CLR_W<11> {
SLV_CMD_ERR_CLR_W::new(self)
}
#[doc = "Bit 12 - 1: spi slave QPI mode is not supported. 0: spi slave QPI mode is supported."]
#[inline(always)]
#[must_use]
pub fn slv_no_qpi_en(&mut self) -> SLV_NO_QPI_EN_W<12> {
SLV_NO_QPI_EN_W::new(self)
}
#[doc = "Bit 15 - The interrupt raw bit for the completion of dma write operation in the slave mode. Can not be changed by CONF_buf."]
#[inline(always)]
#[must_use]
pub fn slv_wr_dma_done(&mut self) -> SLV_WR_DMA_DONE_W<15> {
SLV_WR_DMA_DONE_W::new(self)
}
#[doc = "Bits 16:23 - In the slave mode it is the value of command."]
#[inline(always)]
#[must_use]
pub fn slv_last_command(&mut self) -> SLV_LAST_COMMAND_W<16> {
SLV_LAST_COMMAND_W::new(self)
}
#[doc = "Bits 24:31 - In the slave mode it is the value of address."]
#[inline(always)]
#[must_use]
pub fn slv_last_addr(&mut self) -> SLV_LAST_ADDR_W<24> {
SLV_LAST_ADDR_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "SPI slave control register 1\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 [slave1](index.html) module"]
pub struct SLAVE1_SPEC;
impl crate::RegisterSpec for SLAVE1_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [slave1::R](R) reader structure"]
impl crate::Readable for SLAVE1_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [slave1::W](W) writer structure"]
impl crate::Writable for SLAVE1_SPEC {
type Writer = W;
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets SLAVE1 to value 0"]
impl crate::Resettable for SLAVE1_SPEC {
const RESET_VALUE: Self::Ux = 0;
}