1#[doc = "Register `RXDAT` reader"]
2pub struct R(crate::R<RXDAT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RXDAT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RXDAT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RXDAT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `RXDAT` reader - Receiver Data. This contains the next piece of received data. The number of bits that are used depends on the LEN setting in TXCTL / TXDATCTL."]
17pub struct RXDAT_R(crate::FieldReader<u16, u16>);
18impl RXDAT_R {
19 pub(crate) fn new(bits: u16) -> Self {
20 RXDAT_R(crate::FieldReader::new(bits))
21 }
22}
23impl core::ops::Deref for RXDAT_R {
24 type Target = crate::FieldReader<u16, u16>;
25 #[inline(always)]
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29}
30#[doc = "Field `RXSSEL0_N` reader - Slave Select for receive. This field allows the state of the SSEL0 pin to be saved along with received data. The value will reflect the SSEL0 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
31pub struct RXSSEL0_N_R(crate::FieldReader<bool, bool>);
32impl RXSSEL0_N_R {
33 pub(crate) fn new(bits: bool) -> Self {
34 RXSSEL0_N_R(crate::FieldReader::new(bits))
35 }
36}
37impl core::ops::Deref for RXSSEL0_N_R {
38 type Target = crate::FieldReader<bool, bool>;
39 #[inline(always)]
40 fn deref(&self) -> &Self::Target {
41 &self.0
42 }
43}
44#[doc = "Field `RXSSEL1_N` reader - Slave Select for receive. This field allows the state of the SSEL1 pin to be saved along with received data. The value will reflect the SSEL1 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
45pub struct RXSSEL1_N_R(crate::FieldReader<bool, bool>);
46impl RXSSEL1_N_R {
47 pub(crate) fn new(bits: bool) -> Self {
48 RXSSEL1_N_R(crate::FieldReader::new(bits))
49 }
50}
51impl core::ops::Deref for RXSSEL1_N_R {
52 type Target = crate::FieldReader<bool, bool>;
53 #[inline(always)]
54 fn deref(&self) -> &Self::Target {
55 &self.0
56 }
57}
58#[doc = "Field `RXSSEL2_N` reader - Slave Select for receive. This field allows the state of the SSEL2 pin to be saved along with received data. The value will reflect the SSEL2 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
59pub struct RXSSEL2_N_R(crate::FieldReader<bool, bool>);
60impl RXSSEL2_N_R {
61 pub(crate) fn new(bits: bool) -> Self {
62 RXSSEL2_N_R(crate::FieldReader::new(bits))
63 }
64}
65impl core::ops::Deref for RXSSEL2_N_R {
66 type Target = crate::FieldReader<bool, bool>;
67 #[inline(always)]
68 fn deref(&self) -> &Self::Target {
69 &self.0
70 }
71}
72#[doc = "Field `RXSSEL3_N` reader - Slave Select for receive. This field allows the state of the SSEL3 pin to be saved along with received data. The value will reflect the SSEL3 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
73pub struct RXSSEL3_N_R(crate::FieldReader<bool, bool>);
74impl RXSSEL3_N_R {
75 pub(crate) fn new(bits: bool) -> Self {
76 RXSSEL3_N_R(crate::FieldReader::new(bits))
77 }
78}
79impl core::ops::Deref for RXSSEL3_N_R {
80 type Target = crate::FieldReader<bool, bool>;
81 #[inline(always)]
82 fn deref(&self) -> &Self::Target {
83 &self.0
84 }
85}
86#[doc = "Field `SOT` reader - Start of Transfer flag. This flag will be 1 if this is the first data after the SSELs went from deasserted to asserted (i.e., any previous transfer has ended). This information can be used to identify the first piece of data in cases where the transfer length is greater than 16 bit."]
87pub struct SOT_R(crate::FieldReader<bool, bool>);
88impl SOT_R {
89 pub(crate) fn new(bits: bool) -> Self {
90 SOT_R(crate::FieldReader::new(bits))
91 }
92}
93impl core::ops::Deref for SOT_R {
94 type Target = crate::FieldReader<bool, bool>;
95 #[inline(always)]
96 fn deref(&self) -> &Self::Target {
97 &self.0
98 }
99}
100impl R {
101 #[doc = "Bits 0:15 - Receiver Data. This contains the next piece of received data. The number of bits that are used depends on the LEN setting in TXCTL / TXDATCTL."]
102 #[inline(always)]
103 pub fn rxdat(&self) -> RXDAT_R {
104 RXDAT_R::new((self.bits & 0xffff) as u16)
105 }
106 #[doc = "Bit 16 - Slave Select for receive. This field allows the state of the SSEL0 pin to be saved along with received data. The value will reflect the SSEL0 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
107 #[inline(always)]
108 pub fn rxssel0_n(&self) -> RXSSEL0_N_R {
109 RXSSEL0_N_R::new(((self.bits >> 16) & 0x01) != 0)
110 }
111 #[doc = "Bit 17 - Slave Select for receive. This field allows the state of the SSEL1 pin to be saved along with received data. The value will reflect the SSEL1 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
112 #[inline(always)]
113 pub fn rxssel1_n(&self) -> RXSSEL1_N_R {
114 RXSSEL1_N_R::new(((self.bits >> 17) & 0x01) != 0)
115 }
116 #[doc = "Bit 18 - Slave Select for receive. This field allows the state of the SSEL2 pin to be saved along with received data. The value will reflect the SSEL2 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
117 #[inline(always)]
118 pub fn rxssel2_n(&self) -> RXSSEL2_N_R {
119 RXSSEL2_N_R::new(((self.bits >> 18) & 0x01) != 0)
120 }
121 #[doc = "Bit 19 - Slave Select for receive. This field allows the state of the SSEL3 pin to be saved along with received data. The value will reflect the SSEL3 pin for both master and slave operation. A zero indicates that a slave select is active. The actual polarity of each slave select pin is configured by the related SPOL bit in CFG."]
122 #[inline(always)]
123 pub fn rxssel3_n(&self) -> RXSSEL3_N_R {
124 RXSSEL3_N_R::new(((self.bits >> 19) & 0x01) != 0)
125 }
126 #[doc = "Bit 20 - Start of Transfer flag. This flag will be 1 if this is the first data after the SSELs went from deasserted to asserted (i.e., any previous transfer has ended). This information can be used to identify the first piece of data in cases where the transfer length is greater than 16 bit."]
127 #[inline(always)]
128 pub fn sot(&self) -> SOT_R {
129 SOT_R::new(((self.bits >> 20) & 0x01) != 0)
130 }
131}
132#[doc = "SPI Receive Data\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 [rxdat](index.html) module"]
133pub struct RXDAT_SPEC;
134impl crate::RegisterSpec for RXDAT_SPEC {
135 type Ux = u32;
136}
137#[doc = "`read()` method returns [rxdat::R](R) reader structure"]
138impl crate::Readable for RXDAT_SPEC {
139 type Reader = R;
140}
141#[doc = "`reset()` method sets RXDAT to value 0"]
142impl crate::Resettable for RXDAT_SPEC {
143 #[inline(always)]
144 fn reset_value() -> Self::Ux {
145 0
146 }
147}