stm32g4_staging/stm32g484/aes/
sr.rs1pub type R = crate::R<SRrs>;
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum CCF {
9 Complete = 0,
11 NotComplete = 1,
13}
14impl From<CCF> for bool {
15 #[inline(always)]
16 fn from(variant: CCF) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type CCF_R = crate::BitReader<CCF>;
22impl CCF_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> CCF {
26 match self.bits {
27 false => CCF::Complete,
28 true => CCF::NotComplete,
29 }
30 }
31 #[inline(always)]
33 pub fn is_complete(&self) -> bool {
34 *self == CCF::Complete
35 }
36 #[inline(always)]
38 pub fn is_not_complete(&self) -> bool {
39 *self == CCF::NotComplete
40 }
41}
42#[cfg_attr(feature = "defmt", derive(defmt::Format))]
46#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum RDERR {
48 NoError = 0,
50 Error = 1,
52}
53impl From<RDERR> for bool {
54 #[inline(always)]
55 fn from(variant: RDERR) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type RDERR_R = crate::BitReader<RDERR>;
61impl RDERR_R {
62 #[inline(always)]
64 pub const fn variant(&self) -> RDERR {
65 match self.bits {
66 false => RDERR::NoError,
67 true => RDERR::Error,
68 }
69 }
70 #[inline(always)]
72 pub fn is_no_error(&self) -> bool {
73 *self == RDERR::NoError
74 }
75 #[inline(always)]
77 pub fn is_error(&self) -> bool {
78 *self == RDERR::Error
79 }
80}
81#[cfg_attr(feature = "defmt", derive(defmt::Format))]
85#[derive(Clone, Copy, Debug, PartialEq, Eq)]
86pub enum WRERR {
87 NoError = 0,
89 Error = 1,
91}
92impl From<WRERR> for bool {
93 #[inline(always)]
94 fn from(variant: WRERR) -> Self {
95 variant as u8 != 0
96 }
97}
98pub type WRERR_R = crate::BitReader<WRERR>;
100impl WRERR_R {
101 #[inline(always)]
103 pub const fn variant(&self) -> WRERR {
104 match self.bits {
105 false => WRERR::NoError,
106 true => WRERR::Error,
107 }
108 }
109 #[inline(always)]
111 pub fn is_no_error(&self) -> bool {
112 *self == WRERR::NoError
113 }
114 #[inline(always)]
116 pub fn is_error(&self) -> bool {
117 *self == WRERR::Error
118 }
119}
120#[cfg_attr(feature = "defmt", derive(defmt::Format))]
124#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125pub enum BUSY {
126 Idle = 0,
128 Busy = 1,
130}
131impl From<BUSY> for bool {
132 #[inline(always)]
133 fn from(variant: BUSY) -> Self {
134 variant as u8 != 0
135 }
136}
137pub type BUSY_R = crate::BitReader<BUSY>;
139impl BUSY_R {
140 #[inline(always)]
142 pub const fn variant(&self) -> BUSY {
143 match self.bits {
144 false => BUSY::Idle,
145 true => BUSY::Busy,
146 }
147 }
148 #[inline(always)]
150 pub fn is_idle(&self) -> bool {
151 *self == BUSY::Idle
152 }
153 #[inline(always)]
155 pub fn is_busy(&self) -> bool {
156 *self == BUSY::Busy
157 }
158}
159impl R {
160 #[inline(always)]
162 pub fn ccf(&self) -> CCF_R {
163 CCF_R::new((self.bits & 1) != 0)
164 }
165 #[inline(always)]
167 pub fn rderr(&self) -> RDERR_R {
168 RDERR_R::new(((self.bits >> 1) & 1) != 0)
169 }
170 #[inline(always)]
172 pub fn wrerr(&self) -> WRERR_R {
173 WRERR_R::new(((self.bits >> 2) & 1) != 0)
174 }
175 #[inline(always)]
177 pub fn busy(&self) -> BUSY_R {
178 BUSY_R::new(((self.bits >> 3) & 1) != 0)
179 }
180}
181impl core::fmt::Debug for R {
182 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
183 f.debug_struct("SR")
184 .field("busy", &self.busy())
185 .field("wrerr", &self.wrerr())
186 .field("rderr", &self.rderr())
187 .field("ccf", &self.ccf())
188 .finish()
189 }
190}
191pub struct SRrs;
197impl crate::RegisterSpec for SRrs {
198 type Ux = u32;
199}
200impl crate::Readable for SRrs {}
202impl crate::Resettable for SRrs {
204 const RESET_VALUE: u32 = 0;
205}