mimxrt595s/hashcrypt/
intenset.rs

1#[doc = "Register `INTENSET` reader"]
2pub struct R(crate::R<INTENSET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTENSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTENSET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTENSET` writer"]
17pub struct W(crate::W<INTENSET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTENSET_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<INTENSET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `WAITING` reader - Interrupt When Waiting for Data Input"]
38pub type WAITING_R = crate::BitReader<WAITING_A>;
39#[doc = "Interrupt When Waiting for Data Input\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum WAITING_A {
42    #[doc = "0: Interrupt not enabled when waiting"]
43    NO_INTERRUPT = 0,
44    #[doc = "1: Interrupt is enabled when waiting"]
45    INTERRUPT = 1,
46}
47impl From<WAITING_A> for bool {
48    #[inline(always)]
49    fn from(variant: WAITING_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl WAITING_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> WAITING_A {
57        match self.bits {
58            false => WAITING_A::NO_INTERRUPT,
59            true => WAITING_A::INTERRUPT,
60        }
61    }
62    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
63    #[inline(always)]
64    pub fn is_no_interrupt(&self) -> bool {
65        *self == WAITING_A::NO_INTERRUPT
66    }
67    #[doc = "Checks if the value of the field is `INTERRUPT`"]
68    #[inline(always)]
69    pub fn is_interrupt(&self) -> bool {
70        *self == WAITING_A::INTERRUPT
71    }
72}
73#[doc = "Field `WAITING` writer - Interrupt When Waiting for Data Input"]
74pub type WAITING_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, WAITING_A, O>;
75impl<'a, const O: u8> WAITING_W<'a, O> {
76    #[doc = "Interrupt not enabled when waiting"]
77    #[inline(always)]
78    pub fn no_interrupt(self) -> &'a mut W {
79        self.variant(WAITING_A::NO_INTERRUPT)
80    }
81    #[doc = "Interrupt is enabled when waiting"]
82    #[inline(always)]
83    pub fn interrupt(self) -> &'a mut W {
84        self.variant(WAITING_A::INTERRUPT)
85    }
86}
87#[doc = "Field `DIGEST` reader - Digest/Outdata"]
88pub type DIGEST_R = crate::BitReader<DIGEST_A>;
89#[doc = "Digest/Outdata\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum DIGEST_A {
92    #[doc = "0: Interrupt not enabled when Digest is ready"]
93    NO_INTERRUPT = 0,
94    #[doc = "1: Interrupt is enabled when Digest is ready. Interrupt cleared by writing more data, starting a new Hash, or disabling (done)."]
95    INTERRUPT = 1,
96}
97impl From<DIGEST_A> for bool {
98    #[inline(always)]
99    fn from(variant: DIGEST_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl DIGEST_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> DIGEST_A {
107        match self.bits {
108            false => DIGEST_A::NO_INTERRUPT,
109            true => DIGEST_A::INTERRUPT,
110        }
111    }
112    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
113    #[inline(always)]
114    pub fn is_no_interrupt(&self) -> bool {
115        *self == DIGEST_A::NO_INTERRUPT
116    }
117    #[doc = "Checks if the value of the field is `INTERRUPT`"]
118    #[inline(always)]
119    pub fn is_interrupt(&self) -> bool {
120        *self == DIGEST_A::INTERRUPT
121    }
122}
123#[doc = "Field `DIGEST` writer - Digest/Outdata"]
124pub type DIGEST_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, DIGEST_A, O>;
125impl<'a, const O: u8> DIGEST_W<'a, O> {
126    #[doc = "Interrupt not enabled when Digest is ready"]
127    #[inline(always)]
128    pub fn no_interrupt(self) -> &'a mut W {
129        self.variant(DIGEST_A::NO_INTERRUPT)
130    }
131    #[doc = "Interrupt is enabled when Digest is ready. Interrupt cleared by writing more data, starting a new Hash, or disabling (done)."]
132    #[inline(always)]
133    pub fn interrupt(self) -> &'a mut W {
134        self.variant(DIGEST_A::INTERRUPT)
135    }
136}
137#[doc = "Field `ERROR` reader - Interrupt on Error"]
138pub type ERROR_R = crate::BitReader<ERROR_A>;
139#[doc = "Interrupt on Error\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum ERROR_A {
142    #[doc = "0: Interrupt not enabled on Error."]
143    NOT_INTERRUPT = 0,
144    #[doc = "1: Interrupt is enabled on Error (until cleared)."]
145    INTERRUPT = 1,
146}
147impl From<ERROR_A> for bool {
148    #[inline(always)]
149    fn from(variant: ERROR_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl ERROR_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> ERROR_A {
157        match self.bits {
158            false => ERROR_A::NOT_INTERRUPT,
159            true => ERROR_A::INTERRUPT,
160        }
161    }
162    #[doc = "Checks if the value of the field is `NOT_INTERRUPT`"]
163    #[inline(always)]
164    pub fn is_not_interrupt(&self) -> bool {
165        *self == ERROR_A::NOT_INTERRUPT
166    }
167    #[doc = "Checks if the value of the field is `INTERRUPT`"]
168    #[inline(always)]
169    pub fn is_interrupt(&self) -> bool {
170        *self == ERROR_A::INTERRUPT
171    }
172}
173#[doc = "Field `ERROR` writer - Interrupt on Error"]
174pub type ERROR_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, ERROR_A, O>;
175impl<'a, const O: u8> ERROR_W<'a, O> {
176    #[doc = "Interrupt not enabled on Error."]
177    #[inline(always)]
178    pub fn not_interrupt(self) -> &'a mut W {
179        self.variant(ERROR_A::NOT_INTERRUPT)
180    }
181    #[doc = "Interrupt is enabled on Error (until cleared)."]
182    #[inline(always)]
183    pub fn interrupt(self) -> &'a mut W {
184        self.variant(ERROR_A::INTERRUPT)
185    }
186}
187impl R {
188    #[doc = "Bit 0 - Interrupt When Waiting for Data Input"]
189    #[inline(always)]
190    pub fn waiting(&self) -> WAITING_R {
191        WAITING_R::new((self.bits & 1) != 0)
192    }
193    #[doc = "Bit 1 - Digest/Outdata"]
194    #[inline(always)]
195    pub fn digest(&self) -> DIGEST_R {
196        DIGEST_R::new(((self.bits >> 1) & 1) != 0)
197    }
198    #[doc = "Bit 2 - Interrupt on Error"]
199    #[inline(always)]
200    pub fn error(&self) -> ERROR_R {
201        ERROR_R::new(((self.bits >> 2) & 1) != 0)
202    }
203}
204impl W {
205    #[doc = "Bit 0 - Interrupt When Waiting for Data Input"]
206    #[inline(always)]
207    #[must_use]
208    pub fn waiting(&mut self) -> WAITING_W<0> {
209        WAITING_W::new(self)
210    }
211    #[doc = "Bit 1 - Digest/Outdata"]
212    #[inline(always)]
213    #[must_use]
214    pub fn digest(&mut self) -> DIGEST_W<1> {
215        DIGEST_W::new(self)
216    }
217    #[doc = "Bit 2 - Interrupt on Error"]
218    #[inline(always)]
219    #[must_use]
220    pub fn error(&mut self) -> ERROR_W<2> {
221        ERROR_W::new(self)
222    }
223    #[doc = "Writes raw bits to the register."]
224    #[inline(always)]
225    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
226        self.0.bits(bits);
227        self
228    }
229}
230#[doc = "Interrupt Enable\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 [intenset](index.html) module"]
231pub struct INTENSET_SPEC;
232impl crate::RegisterSpec for INTENSET_SPEC {
233    type Ux = u32;
234}
235#[doc = "`read()` method returns [intenset::R](R) reader structure"]
236impl crate::Readable for INTENSET_SPEC {
237    type Reader = R;
238}
239#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
240impl crate::Writable for INTENSET_SPEC {
241    type Writer = W;
242    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
243    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
244}
245#[doc = "`reset()` method sets INTENSET to value 0"]
246impl crate::Resettable for INTENSET_SPEC {
247    const RESET_VALUE: Self::Ux = 0;
248}