ra6e1/spi0/
spssr.rs

1#[doc = "Register `SPSSR` reader"]
2pub struct R(crate::R<SPSSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SPSSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SPSSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SPSSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `SPCP` reader - SPI Command Pointer"]
17pub type SPCP_R = crate::FieldReader<u8, SPCP_A>;
18#[doc = "SPI Command Pointer\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20#[repr(u8)]
21pub enum SPCP_A {
22    #[doc = "0: SPCMD0"]
23    _000 = 0,
24    #[doc = "1: SPCMD1"]
25    _001 = 1,
26    #[doc = "2: SPCMD2"]
27    _010 = 2,
28    #[doc = "3: SPCMD3"]
29    _011 = 3,
30    #[doc = "4: SPCMD4"]
31    _100 = 4,
32    #[doc = "5: SPCMD5"]
33    _101 = 5,
34    #[doc = "6: SPCMD6"]
35    _110 = 6,
36    #[doc = "7: SPCMD7"]
37    _111 = 7,
38}
39impl From<SPCP_A> for u8 {
40    #[inline(always)]
41    fn from(variant: SPCP_A) -> Self {
42        variant as _
43    }
44}
45impl SPCP_R {
46    #[doc = "Get enumerated values variant"]
47    #[inline(always)]
48    pub fn variant(&self) -> SPCP_A {
49        match self.bits {
50            0 => SPCP_A::_000,
51            1 => SPCP_A::_001,
52            2 => SPCP_A::_010,
53            3 => SPCP_A::_011,
54            4 => SPCP_A::_100,
55            5 => SPCP_A::_101,
56            6 => SPCP_A::_110,
57            7 => SPCP_A::_111,
58            _ => unreachable!(),
59        }
60    }
61    #[doc = "Checks if the value of the field is `_000`"]
62    #[inline(always)]
63    pub fn is_000(&self) -> bool {
64        *self == SPCP_A::_000
65    }
66    #[doc = "Checks if the value of the field is `_001`"]
67    #[inline(always)]
68    pub fn is_001(&self) -> bool {
69        *self == SPCP_A::_001
70    }
71    #[doc = "Checks if the value of the field is `_010`"]
72    #[inline(always)]
73    pub fn is_010(&self) -> bool {
74        *self == SPCP_A::_010
75    }
76    #[doc = "Checks if the value of the field is `_011`"]
77    #[inline(always)]
78    pub fn is_011(&self) -> bool {
79        *self == SPCP_A::_011
80    }
81    #[doc = "Checks if the value of the field is `_100`"]
82    #[inline(always)]
83    pub fn is_100(&self) -> bool {
84        *self == SPCP_A::_100
85    }
86    #[doc = "Checks if the value of the field is `_101`"]
87    #[inline(always)]
88    pub fn is_101(&self) -> bool {
89        *self == SPCP_A::_101
90    }
91    #[doc = "Checks if the value of the field is `_110`"]
92    #[inline(always)]
93    pub fn is_110(&self) -> bool {
94        *self == SPCP_A::_110
95    }
96    #[doc = "Checks if the value of the field is `_111`"]
97    #[inline(always)]
98    pub fn is_111(&self) -> bool {
99        *self == SPCP_A::_111
100    }
101}
102#[doc = "Field `SPECM` reader - SPI Error Command"]
103pub type SPECM_R = crate::FieldReader<u8, SPECM_A>;
104#[doc = "SPI Error Command\n\nValue on reset: 0"]
105#[derive(Clone, Copy, Debug, PartialEq, Eq)]
106#[repr(u8)]
107pub enum SPECM_A {
108    #[doc = "0: SPCMD0"]
109    _000 = 0,
110    #[doc = "1: SPCMD1"]
111    _001 = 1,
112    #[doc = "2: SPCMD2"]
113    _010 = 2,
114    #[doc = "3: SPCMD3"]
115    _011 = 3,
116    #[doc = "4: SPCMD4"]
117    _100 = 4,
118    #[doc = "5: SPCMD5"]
119    _101 = 5,
120    #[doc = "6: SPCMD6"]
121    _110 = 6,
122    #[doc = "7: SPCMD7"]
123    _111 = 7,
124}
125impl From<SPECM_A> for u8 {
126    #[inline(always)]
127    fn from(variant: SPECM_A) -> Self {
128        variant as _
129    }
130}
131impl SPECM_R {
132    #[doc = "Get enumerated values variant"]
133    #[inline(always)]
134    pub fn variant(&self) -> SPECM_A {
135        match self.bits {
136            0 => SPECM_A::_000,
137            1 => SPECM_A::_001,
138            2 => SPECM_A::_010,
139            3 => SPECM_A::_011,
140            4 => SPECM_A::_100,
141            5 => SPECM_A::_101,
142            6 => SPECM_A::_110,
143            7 => SPECM_A::_111,
144            _ => unreachable!(),
145        }
146    }
147    #[doc = "Checks if the value of the field is `_000`"]
148    #[inline(always)]
149    pub fn is_000(&self) -> bool {
150        *self == SPECM_A::_000
151    }
152    #[doc = "Checks if the value of the field is `_001`"]
153    #[inline(always)]
154    pub fn is_001(&self) -> bool {
155        *self == SPECM_A::_001
156    }
157    #[doc = "Checks if the value of the field is `_010`"]
158    #[inline(always)]
159    pub fn is_010(&self) -> bool {
160        *self == SPECM_A::_010
161    }
162    #[doc = "Checks if the value of the field is `_011`"]
163    #[inline(always)]
164    pub fn is_011(&self) -> bool {
165        *self == SPECM_A::_011
166    }
167    #[doc = "Checks if the value of the field is `_100`"]
168    #[inline(always)]
169    pub fn is_100(&self) -> bool {
170        *self == SPECM_A::_100
171    }
172    #[doc = "Checks if the value of the field is `_101`"]
173    #[inline(always)]
174    pub fn is_101(&self) -> bool {
175        *self == SPECM_A::_101
176    }
177    #[doc = "Checks if the value of the field is `_110`"]
178    #[inline(always)]
179    pub fn is_110(&self) -> bool {
180        *self == SPECM_A::_110
181    }
182    #[doc = "Checks if the value of the field is `_111`"]
183    #[inline(always)]
184    pub fn is_111(&self) -> bool {
185        *self == SPECM_A::_111
186    }
187}
188impl R {
189    #[doc = "Bits 0:2 - SPI Command Pointer"]
190    #[inline(always)]
191    pub fn spcp(&self) -> SPCP_R {
192        SPCP_R::new(self.bits & 7)
193    }
194    #[doc = "Bits 4:6 - SPI Error Command"]
195    #[inline(always)]
196    pub fn specm(&self) -> SPECM_R {
197        SPECM_R::new((self.bits >> 4) & 7)
198    }
199}
200#[doc = "SPI Sequence 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 [spssr](index.html) module"]
201pub struct SPSSR_SPEC;
202impl crate::RegisterSpec for SPSSR_SPEC {
203    type Ux = u8;
204}
205#[doc = "`read()` method returns [spssr::R](R) reader structure"]
206impl crate::Readable for SPSSR_SPEC {
207    type Reader = R;
208}
209#[doc = "`reset()` method sets SPSSR to value 0"]
210impl crate::Resettable for SPSSR_SPEC {
211    const RESET_VALUE: Self::Ux = 0;
212}