max3263x/rtctmr/
flags.rs

1#[doc = "Register `FLAGS` reader"]
2pub struct R(crate::R<FLAGS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FLAGS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FLAGS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FLAGS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FLAGS` writer"]
17pub struct W(crate::W<FLAGS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FLAGS_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<FLAGS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FLAGS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `comp0` reader - RTC Compare 0 Interrupt Status"]
38pub type COMP0_R = crate::BitReader<bool>;
39#[doc = "Field `comp0` writer - RTC Compare 0 Interrupt Status"]
40pub type COMP0_W<'a> = crate::BitWriter1C<'a, u32, FLAGS_SPEC, bool, 0>;
41#[doc = "Field `comp1` reader - RTC Compare 1 Interrupt Status"]
42pub type COMP1_R = crate::BitReader<bool>;
43#[doc = "Field `comp1` writer - RTC Compare 1 Interrupt Status"]
44pub type COMP1_W<'a> = crate::BitWriter1C<'a, u32, FLAGS_SPEC, bool, 1>;
45#[doc = "Field `prescale_comp` reader - RTC Prescale Compare Int Status"]
46pub type PRESCALE_COMP_R = crate::BitReader<bool>;
47#[doc = "Field `prescale_comp` writer - RTC Prescale Compare Int Status"]
48pub type PRESCALE_COMP_W<'a> = crate::BitWriter1C<'a, u32, FLAGS_SPEC, bool, 2>;
49#[doc = "Field `overflow` reader - RTC Overflow Interrupt Status"]
50pub type OVERFLOW_R = crate::BitReader<bool>;
51#[doc = "Field `overflow` writer - RTC Overflow Interrupt Status"]
52pub type OVERFLOW_W<'a> = crate::BitWriter1C<'a, u32, FLAGS_SPEC, bool, 3>;
53#[doc = "Field `trim` reader - RTC Trim Interrupt Status"]
54pub type TRIM_R = crate::BitReader<bool>;
55#[doc = "Field `trim` writer - RTC Trim Interrupt Status"]
56pub type TRIM_W<'a> = crate::BitWriter1C<'a, u32, FLAGS_SPEC, bool, 4>;
57#[doc = "Field `comp0_flag_a` reader - RTC Compare 0 4kHz Flag"]
58pub type COMP0_FLAG_A_R = crate::BitReader<bool>;
59#[doc = "Field `comp1_flag_a` reader - RTC Compare 1 4kHz Flag"]
60pub type COMP1_FLAG_A_R = crate::BitReader<bool>;
61#[doc = "Field `prescl_flag_a` reader - RTC Prescale Compare 4kHz Flag"]
62pub type PRESCL_FLAG_A_R = crate::BitReader<bool>;
63#[doc = "Field `overflow_flag_a` reader - RTC Overflow 4kHz Flag"]
64pub type OVERFLOW_FLAG_A_R = crate::BitReader<bool>;
65#[doc = "Field `trim_flag_a` reader - RTC Trim Event 4kHz Flag"]
66pub type TRIM_FLAG_A_R = crate::BitReader<bool>;
67#[doc = "Field `async_clr_flags` writer - Asynchronous RTC Flag Clear"]
68pub type ASYNC_CLR_FLAGS_W<'a> = crate::BitWriter<'a, u32, FLAGS_SPEC, bool, 31>;
69impl R {
70    #[doc = "Bit 0 - RTC Compare 0 Interrupt Status"]
71    #[inline(always)]
72    pub fn comp0(&self) -> COMP0_R {
73        COMP0_R::new((self.bits & 1) != 0)
74    }
75    #[doc = "Bit 1 - RTC Compare 1 Interrupt Status"]
76    #[inline(always)]
77    pub fn comp1(&self) -> COMP1_R {
78        COMP1_R::new(((self.bits >> 1) & 1) != 0)
79    }
80    #[doc = "Bit 2 - RTC Prescale Compare Int Status"]
81    #[inline(always)]
82    pub fn prescale_comp(&self) -> PRESCALE_COMP_R {
83        PRESCALE_COMP_R::new(((self.bits >> 2) & 1) != 0)
84    }
85    #[doc = "Bit 3 - RTC Overflow Interrupt Status"]
86    #[inline(always)]
87    pub fn overflow(&self) -> OVERFLOW_R {
88        OVERFLOW_R::new(((self.bits >> 3) & 1) != 0)
89    }
90    #[doc = "Bit 4 - RTC Trim Interrupt Status"]
91    #[inline(always)]
92    pub fn trim(&self) -> TRIM_R {
93        TRIM_R::new(((self.bits >> 4) & 1) != 0)
94    }
95    #[doc = "Bit 8 - RTC Compare 0 4kHz Flag"]
96    #[inline(always)]
97    pub fn comp0_flag_a(&self) -> COMP0_FLAG_A_R {
98        COMP0_FLAG_A_R::new(((self.bits >> 8) & 1) != 0)
99    }
100    #[doc = "Bit 9 - RTC Compare 1 4kHz Flag"]
101    #[inline(always)]
102    pub fn comp1_flag_a(&self) -> COMP1_FLAG_A_R {
103        COMP1_FLAG_A_R::new(((self.bits >> 9) & 1) != 0)
104    }
105    #[doc = "Bit 10 - RTC Prescale Compare 4kHz Flag"]
106    #[inline(always)]
107    pub fn prescl_flag_a(&self) -> PRESCL_FLAG_A_R {
108        PRESCL_FLAG_A_R::new(((self.bits >> 10) & 1) != 0)
109    }
110    #[doc = "Bit 11 - RTC Overflow 4kHz Flag"]
111    #[inline(always)]
112    pub fn overflow_flag_a(&self) -> OVERFLOW_FLAG_A_R {
113        OVERFLOW_FLAG_A_R::new(((self.bits >> 11) & 1) != 0)
114    }
115    #[doc = "Bit 12 - RTC Trim Event 4kHz Flag"]
116    #[inline(always)]
117    pub fn trim_flag_a(&self) -> TRIM_FLAG_A_R {
118        TRIM_FLAG_A_R::new(((self.bits >> 12) & 1) != 0)
119    }
120}
121impl W {
122    #[doc = "Bit 0 - RTC Compare 0 Interrupt Status"]
123    #[inline(always)]
124    pub fn comp0(&mut self) -> COMP0_W {
125        COMP0_W::new(self)
126    }
127    #[doc = "Bit 1 - RTC Compare 1 Interrupt Status"]
128    #[inline(always)]
129    pub fn comp1(&mut self) -> COMP1_W {
130        COMP1_W::new(self)
131    }
132    #[doc = "Bit 2 - RTC Prescale Compare Int Status"]
133    #[inline(always)]
134    pub fn prescale_comp(&mut self) -> PRESCALE_COMP_W {
135        PRESCALE_COMP_W::new(self)
136    }
137    #[doc = "Bit 3 - RTC Overflow Interrupt Status"]
138    #[inline(always)]
139    pub fn overflow(&mut self) -> OVERFLOW_W {
140        OVERFLOW_W::new(self)
141    }
142    #[doc = "Bit 4 - RTC Trim Interrupt Status"]
143    #[inline(always)]
144    pub fn trim(&mut self) -> TRIM_W {
145        TRIM_W::new(self)
146    }
147    #[doc = "Bit 31 - Asynchronous RTC Flag Clear"]
148    #[inline(always)]
149    pub fn async_clr_flags(&mut self) -> ASYNC_CLR_FLAGS_W {
150        ASYNC_CLR_FLAGS_W::new(self)
151    }
152    #[doc = "Writes raw bits to the register."]
153    #[inline(always)]
154    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
155        self.0.bits(bits);
156        self
157    }
158}
159#[doc = "CPU Interrupt and RTC Domain Flags\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 [flags](index.html) module"]
160pub struct FLAGS_SPEC;
161impl crate::RegisterSpec for FLAGS_SPEC {
162    type Ux = u32;
163}
164#[doc = "`read()` method returns [flags::R](R) reader structure"]
165impl crate::Readable for FLAGS_SPEC {
166    type Reader = R;
167}
168#[doc = "`write(|w| ..)` method takes [flags::W](W) writer structure"]
169impl crate::Writable for FLAGS_SPEC {
170    type Writer = W;
171}
172#[doc = "`reset()` method sets FLAGS to value 0"]
173impl crate::Resettable for FLAGS_SPEC {
174    #[inline(always)]
175    fn reset_value() -> Self::Ux {
176        0
177    }
178}