mimxrt685s_pac/casper/
intstat.rs

1#[doc = "Register `INTSTAT` reader"]
2pub type R = crate::R<IntstatSpec>;
3#[doc = "Register `INTSTAT` writer"]
4pub type W = crate::W<IntstatSpec>;
5#[doc = "If set, interrupt is caused by accelerator being done.\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Done {
9    #[doc = "0: Not caused by accelerator being done"]
10    NotCaused = 0,
11    #[doc = "1: Caused by accelerator being done"]
12    Caused = 1,
13}
14impl From<Done> for bool {
15    #[inline(always)]
16    fn from(variant: Done) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `DONE` reader - If set, interrupt is caused by accelerator being done."]
21pub type DoneR = crate::BitReader<Done>;
22impl DoneR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Done {
26        match self.bits {
27            false => Done::NotCaused,
28            true => Done::Caused,
29        }
30    }
31    #[doc = "Not caused by accelerator being done"]
32    #[inline(always)]
33    pub fn is_not_caused(&self) -> bool {
34        *self == Done::NotCaused
35    }
36    #[doc = "Caused by accelerator being done"]
37    #[inline(always)]
38    pub fn is_caused(&self) -> bool {
39        *self == Done::Caused
40    }
41}
42impl R {
43    #[doc = "Bit 0 - If set, interrupt is caused by accelerator being done."]
44    #[inline(always)]
45    pub fn done(&self) -> DoneR {
46        DoneR::new((self.bits & 1) != 0)
47    }
48}
49#[cfg(feature = "debug")]
50impl core::fmt::Debug for R {
51    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
52        f.debug_struct("INTSTAT")
53            .field("done", &self.done())
54            .finish()
55    }
56}
57impl W {}
58#[doc = "Interrupt status bits (mask of INTENSET and STATUS)\n\nYou can [`read`](crate::Reg::read) this register and get [`intstat::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intstat::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
59pub struct IntstatSpec;
60impl crate::RegisterSpec for IntstatSpec {
61    type Ux = u32;
62}
63#[doc = "`read()` method returns [`intstat::R`](R) reader structure"]
64impl crate::Readable for IntstatSpec {}
65#[doc = "`write(|w| ..)` method takes [`intstat::W`](W) writer structure"]
66impl crate::Writable for IntstatSpec {
67    type Safety = crate::Unsafe;
68    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
69    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
70}
71#[doc = "`reset()` method sets INTSTAT to value 0"]
72impl crate::Resettable for IntstatSpec {
73    const RESET_VALUE: u32 = 0;
74}