bl808_pac/lz4d/
interrupt_state.rs

1#[doc = "Register `interrupt_state` reader"]
2pub struct R(crate::R<INTERRUPT_STATE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTERRUPT_STATE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTERRUPT_STATE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTERRUPT_STATE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `done` reader - Decompliation finished"]
17pub type DONE_R = crate::BitReader<INTERRUPT_STATE_A>;
18#[doc = "Decompliation finished\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum INTERRUPT_STATE_A {
21    #[doc = "1: Has interrupt"]
22    HAS_INTERRUPT = 1,
23    #[doc = "0: No interrupt occurred"]
24    NO_INTERRUPT = 0,
25}
26impl From<INTERRUPT_STATE_A> for bool {
27    #[inline(always)]
28    fn from(variant: INTERRUPT_STATE_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl DONE_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> INTERRUPT_STATE_A {
36        match self.bits {
37            true => INTERRUPT_STATE_A::HAS_INTERRUPT,
38            false => INTERRUPT_STATE_A::NO_INTERRUPT,
39        }
40    }
41    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
42    #[inline(always)]
43    pub fn is_has_interrupt(&self) -> bool {
44        *self == INTERRUPT_STATE_A::HAS_INTERRUPT
45    }
46    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
47    #[inline(always)]
48    pub fn is_no_interrupt(&self) -> bool {
49        *self == INTERRUPT_STATE_A::NO_INTERRUPT
50    }
51}
52#[doc = "Field `error` reader - Error occurred while decompliation"]
53pub use DONE_R as ERROR_R;
54impl R {
55    #[doc = "Bit 0 - Decompliation finished"]
56    #[inline(always)]
57    pub fn done(&self) -> DONE_R {
58        DONE_R::new((self.bits & 1) != 0)
59    }
60    #[doc = "Bit 1 - Error occurred while decompliation"]
61    #[inline(always)]
62    pub fn error(&self) -> ERROR_R {
63        ERROR_R::new(((self.bits >> 1) & 1) != 0)
64    }
65}
66#[doc = "Interrupt state 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 [interrupt_state](index.html) module"]
67pub struct INTERRUPT_STATE_SPEC;
68impl crate::RegisterSpec for INTERRUPT_STATE_SPEC {
69    type Ux = u32;
70}
71#[doc = "`read()` method returns [interrupt_state::R](R) reader structure"]
72impl crate::Readable for INTERRUPT_STATE_SPEC {
73    type Reader = R;
74}
75#[doc = "`reset()` method sets interrupt_state to value 0"]
76impl crate::Resettable for INTERRUPT_STATE_SPEC {
77    #[inline(always)]
78    fn reset_value() -> Self::Ux {
79        0
80    }
81}