msp430g2553/special_function/
ifg1.rs

1#[doc = "Register `IFG1` reader"]
2pub struct R(crate::R<IFG1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IFG1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IFG1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IFG1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `IFG1` writer"]
17pub struct W(crate::W<IFG1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IFG1_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<IFG1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IFG1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `WDTIFG` reader - Watchdog Interrupt Flag"]
38pub type WDTIFG_R = crate::BitReader<bool>;
39#[doc = "Field `WDTIFG` writer - Watchdog Interrupt Flag"]
40pub type WDTIFG_W<'a, const O: u8> =
41    crate::BitWriter<'a, u8, IFG1_SPEC, bool, O>;
42#[doc = "Field `OFIFG` reader - Osc. Fault Interrupt Flag"]
43pub type OFIFG_R = crate::BitReader<bool>;
44#[doc = "Field `OFIFG` writer - Osc. Fault Interrupt Flag"]
45pub type OFIFG_W<'a, const O: u8> =
46    crate::BitWriter<'a, u8, IFG1_SPEC, bool, O>;
47#[doc = "Field `PORIFG` reader - Power On Interrupt Flag"]
48pub type PORIFG_R = crate::BitReader<bool>;
49#[doc = "Field `PORIFG` writer - Power On Interrupt Flag"]
50pub type PORIFG_W<'a, const O: u8> =
51    crate::BitWriter<'a, u8, IFG1_SPEC, bool, O>;
52#[doc = "Field `RSTIFG` reader - Reset Interrupt Flag"]
53pub type RSTIFG_R = crate::BitReader<bool>;
54#[doc = "Field `RSTIFG` writer - Reset Interrupt Flag"]
55pub type RSTIFG_W<'a, const O: u8> =
56    crate::BitWriter<'a, u8, IFG1_SPEC, bool, O>;
57#[doc = "Field `NMIIFG` reader - NMI Interrupt Flag"]
58pub type NMIIFG_R = crate::BitReader<bool>;
59#[doc = "Field `NMIIFG` writer - NMI Interrupt Flag"]
60pub type NMIIFG_W<'a, const O: u8> =
61    crate::BitWriter<'a, u8, IFG1_SPEC, bool, O>;
62impl R {
63    #[doc = "Bit 0 - Watchdog Interrupt Flag"]
64    #[inline(always)]
65    pub fn wdtifg(&self) -> WDTIFG_R {
66        WDTIFG_R::new((self.bits & 1) != 0)
67    }
68    #[doc = "Bit 1 - Osc. Fault Interrupt Flag"]
69    #[inline(always)]
70    pub fn ofifg(&self) -> OFIFG_R {
71        OFIFG_R::new(((self.bits >> 1) & 1) != 0)
72    }
73    #[doc = "Bit 2 - Power On Interrupt Flag"]
74    #[inline(always)]
75    pub fn porifg(&self) -> PORIFG_R {
76        PORIFG_R::new(((self.bits >> 2) & 1) != 0)
77    }
78    #[doc = "Bit 3 - Reset Interrupt Flag"]
79    #[inline(always)]
80    pub fn rstifg(&self) -> RSTIFG_R {
81        RSTIFG_R::new(((self.bits >> 3) & 1) != 0)
82    }
83    #[doc = "Bit 4 - NMI Interrupt Flag"]
84    #[inline(always)]
85    pub fn nmiifg(&self) -> NMIIFG_R {
86        NMIIFG_R::new(((self.bits >> 4) & 1) != 0)
87    }
88}
89impl W {
90    #[doc = "Bit 0 - Watchdog Interrupt Flag"]
91    #[inline(always)]
92    pub fn wdtifg(&mut self) -> WDTIFG_W<0> {
93        WDTIFG_W::new(self)
94    }
95    #[doc = "Bit 1 - Osc. Fault Interrupt Flag"]
96    #[inline(always)]
97    pub fn ofifg(&mut self) -> OFIFG_W<1> {
98        OFIFG_W::new(self)
99    }
100    #[doc = "Bit 2 - Power On Interrupt Flag"]
101    #[inline(always)]
102    pub fn porifg(&mut self) -> PORIFG_W<2> {
103        PORIFG_W::new(self)
104    }
105    #[doc = "Bit 3 - Reset Interrupt Flag"]
106    #[inline(always)]
107    pub fn rstifg(&mut self) -> RSTIFG_W<3> {
108        RSTIFG_W::new(self)
109    }
110    #[doc = "Bit 4 - NMI Interrupt Flag"]
111    #[inline(always)]
112    pub fn nmiifg(&mut self) -> NMIIFG_W<4> {
113        NMIIFG_W::new(self)
114    }
115    #[doc = "Writes raw bits to the register."]
116    #[inline(always)]
117    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
118        self.0.bits(bits);
119        self
120    }
121}
122#[doc = "Interrupt Flag 1\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 [ifg1](index.html) module"]
123pub struct IFG1_SPEC;
124impl crate::RegisterSpec for IFG1_SPEC {
125    type Ux = u8;
126}
127#[doc = "`read()` method returns [ifg1::R](R) reader structure"]
128impl crate::Readable for IFG1_SPEC {
129    type Reader = R;
130}
131#[doc = "`write(|w| ..)` method takes [ifg1::W](W) writer structure"]
132impl crate::Writable for IFG1_SPEC {
133    type Writer = W;
134}
135#[doc = "`reset()` method sets IFG1 to value 0"]
136impl crate::Resettable for IFG1_SPEC {
137    #[inline(always)]
138    fn reset_value() -> Self::Ux {
139        0
140    }
141}