max3263x/pwrseq/
msk_flags.rs

1#[doc = "Register `MSK_FLAGS` reader"]
2pub struct R(crate::R<MSK_FLAGS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MSK_FLAGS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MSK_FLAGS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MSK_FLAGS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MSK_FLAGS` writer"]
17pub struct W(crate::W<MSK_FLAGS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MSK_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<MSK_FLAGS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MSK_FLAGS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `pwr_sys_reboot` reader - Mask for system reboot detect"]
38pub type PWR_SYS_REBOOT_R = crate::BitReader<bool>;
39#[doc = "Field `pwr_sys_reboot` writer - Mask for system reboot detect"]
40pub type PWR_SYS_REBOOT_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 1>;
41#[doc = "Field `pwr_power_fail` reader - Mask for previous power fail detect"]
42pub type PWR_POWER_FAIL_R = crate::BitReader<bool>;
43#[doc = "Field `pwr_power_fail` writer - Mask for previous power fail detect"]
44pub type PWR_POWER_FAIL_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 2>;
45#[doc = "Field `pwr_boot_fail` reader - Mask for previous boot fail detect"]
46pub type PWR_BOOT_FAIL_R = crate::BitReader<bool>;
47#[doc = "Field `pwr_boot_fail` writer - Mask for previous boot fail detect"]
48pub type PWR_BOOT_FAIL_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 3>;
49#[doc = "Field `pwr_flash_discharge` reader - Mask for flash discharge event"]
50pub type PWR_FLASH_DISCHARGE_R = crate::BitReader<bool>;
51#[doc = "Field `pwr_flash_discharge` writer - Mask for flash discharge event"]
52pub type PWR_FLASH_DISCHARGE_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 4>;
53#[doc = "Field `pwr_iowakeup` reader - Mask for GPIO wakeup event detect"]
54pub type PWR_IOWAKEUP_R = crate::BitReader<bool>;
55#[doc = "Field `pwr_iowakeup` writer - Mask for GPIO wakeup event detect"]
56pub type PWR_IOWAKEUP_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 5>;
57#[doc = "Field `pwr_vdd12_rst_bad` reader - Mask for VDD12 rst event"]
58pub type PWR_VDD12_RST_BAD_R = crate::BitReader<bool>;
59#[doc = "Field `pwr_vdd12_rst_bad` writer - Mask for VDD12 rst event"]
60pub type PWR_VDD12_RST_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 6>;
61#[doc = "Field `pwr_vdd18_rst_bad` reader - Mask for VDD18 rst event"]
62pub type PWR_VDD18_RST_BAD_R = crate::BitReader<bool>;
63#[doc = "Field `pwr_vdd18_rst_bad` writer - Mask for VDD18 rst event"]
64pub type PWR_VDD18_RST_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 7>;
65#[doc = "Field `pwr_vrtc_rst_bad` reader - Mask for VRTC rst event"]
66pub type PWR_VRTC_RST_BAD_R = crate::BitReader<bool>;
67#[doc = "Field `pwr_vrtc_rst_bad` writer - Mask for VRTC rst event"]
68pub type PWR_VRTC_RST_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 8>;
69#[doc = "Field `pwr_vddb_rst_bad` reader - Mask for VDDB rst event"]
70pub type PWR_VDDB_RST_BAD_R = crate::BitReader<bool>;
71#[doc = "Field `pwr_vddb_rst_bad` writer - Mask for VDDB rst event"]
72pub type PWR_VDDB_RST_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 9>;
73#[doc = "Field `pwr_tvdd12_rst_bad` reader - Mask for TVDD12 rst event"]
74pub type PWR_TVDD12_RST_BAD_R = crate::BitReader<bool>;
75#[doc = "Field `pwr_tvdd12_rst_bad` writer - Mask for TVDD12 rst event"]
76pub type PWR_TVDD12_RST_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 10>;
77#[doc = "Field `pwr_por18z_fail_latch` reader - Mask for POR18 powerfail event"]
78pub type PWR_POR18Z_FAIL_LATCH_R = crate::BitReader<bool>;
79#[doc = "Field `pwr_por18z_fail_latch` writer - Mask for POR18 powerfail event"]
80pub type PWR_POR18Z_FAIL_LATCH_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 11>;
81#[doc = "Field `rtc_cmpr0` reader - Mask for RTC compare 0 event"]
82pub type RTC_CMPR0_R = crate::BitReader<bool>;
83#[doc = "Field `rtc_cmpr0` writer - Mask for RTC compare 0 event"]
84pub type RTC_CMPR0_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 12>;
85#[doc = "Field `rtc_cmpr1` reader - Mask for RTC compare 1 event"]
86pub type RTC_CMPR1_R = crate::BitReader<bool>;
87#[doc = "Field `rtc_cmpr1` writer - Mask for RTC compare 1 event"]
88pub type RTC_CMPR1_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 13>;
89#[doc = "Field `rtc_prescale_cmp` reader - Mask for RTC prescale compare event"]
90pub type RTC_PRESCALE_CMP_R = crate::BitReader<bool>;
91#[doc = "Field `rtc_prescale_cmp` writer - Mask for RTC prescale compare event"]
92pub type RTC_PRESCALE_CMP_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 14>;
93#[doc = "Field `rtc_rollover` reader - Mask for RTC rollover event"]
94pub type RTC_ROLLOVER_R = crate::BitReader<bool>;
95#[doc = "Field `rtc_rollover` writer - Mask for RTC rollover event"]
96pub type RTC_ROLLOVER_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 15>;
97#[doc = "Field `pwr_usb_plug_wakeup` reader - Mask for USB plug connect event"]
98pub type PWR_USB_PLUG_WAKEUP_R = crate::BitReader<bool>;
99#[doc = "Field `pwr_usb_plug_wakeup` writer - Mask for USB plug connect event"]
100pub type PWR_USB_PLUG_WAKEUP_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 16>;
101#[doc = "Field `pwr_usb_remove_wakeup` reader - Mask for USB plug disconnect event"]
102pub type PWR_USB_REMOVE_WAKEUP_R = crate::BitReader<bool>;
103#[doc = "Field `pwr_usb_remove_wakeup` writer - Mask for USB plug disconnect event"]
104pub type PWR_USB_REMOVE_WAKEUP_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 17>;
105#[doc = "Field `pwr_tvdd12_bad` reader - Mask for TVDD12 power fail event"]
106pub type PWR_TVDD12_BAD_R = crate::BitReader<bool>;
107#[doc = "Field `pwr_tvdd12_bad` writer - Mask for TVDD12 power fail event"]
108pub type PWR_TVDD12_BAD_W<'a> = crate::BitWriter<'a, u32, MSK_FLAGS_SPEC, bool, 18>;
109impl R {
110    #[doc = "Bit 1 - Mask for system reboot detect"]
111    #[inline(always)]
112    pub fn pwr_sys_reboot(&self) -> PWR_SYS_REBOOT_R {
113        PWR_SYS_REBOOT_R::new(((self.bits >> 1) & 1) != 0)
114    }
115    #[doc = "Bit 2 - Mask for previous power fail detect"]
116    #[inline(always)]
117    pub fn pwr_power_fail(&self) -> PWR_POWER_FAIL_R {
118        PWR_POWER_FAIL_R::new(((self.bits >> 2) & 1) != 0)
119    }
120    #[doc = "Bit 3 - Mask for previous boot fail detect"]
121    #[inline(always)]
122    pub fn pwr_boot_fail(&self) -> PWR_BOOT_FAIL_R {
123        PWR_BOOT_FAIL_R::new(((self.bits >> 3) & 1) != 0)
124    }
125    #[doc = "Bit 4 - Mask for flash discharge event"]
126    #[inline(always)]
127    pub fn pwr_flash_discharge(&self) -> PWR_FLASH_DISCHARGE_R {
128        PWR_FLASH_DISCHARGE_R::new(((self.bits >> 4) & 1) != 0)
129    }
130    #[doc = "Bit 5 - Mask for GPIO wakeup event detect"]
131    #[inline(always)]
132    pub fn pwr_iowakeup(&self) -> PWR_IOWAKEUP_R {
133        PWR_IOWAKEUP_R::new(((self.bits >> 5) & 1) != 0)
134    }
135    #[doc = "Bit 6 - Mask for VDD12 rst event"]
136    #[inline(always)]
137    pub fn pwr_vdd12_rst_bad(&self) -> PWR_VDD12_RST_BAD_R {
138        PWR_VDD12_RST_BAD_R::new(((self.bits >> 6) & 1) != 0)
139    }
140    #[doc = "Bit 7 - Mask for VDD18 rst event"]
141    #[inline(always)]
142    pub fn pwr_vdd18_rst_bad(&self) -> PWR_VDD18_RST_BAD_R {
143        PWR_VDD18_RST_BAD_R::new(((self.bits >> 7) & 1) != 0)
144    }
145    #[doc = "Bit 8 - Mask for VRTC rst event"]
146    #[inline(always)]
147    pub fn pwr_vrtc_rst_bad(&self) -> PWR_VRTC_RST_BAD_R {
148        PWR_VRTC_RST_BAD_R::new(((self.bits >> 8) & 1) != 0)
149    }
150    #[doc = "Bit 9 - Mask for VDDB rst event"]
151    #[inline(always)]
152    pub fn pwr_vddb_rst_bad(&self) -> PWR_VDDB_RST_BAD_R {
153        PWR_VDDB_RST_BAD_R::new(((self.bits >> 9) & 1) != 0)
154    }
155    #[doc = "Bit 10 - Mask for TVDD12 rst event"]
156    #[inline(always)]
157    pub fn pwr_tvdd12_rst_bad(&self) -> PWR_TVDD12_RST_BAD_R {
158        PWR_TVDD12_RST_BAD_R::new(((self.bits >> 10) & 1) != 0)
159    }
160    #[doc = "Bit 11 - Mask for POR18 powerfail event"]
161    #[inline(always)]
162    pub fn pwr_por18z_fail_latch(&self) -> PWR_POR18Z_FAIL_LATCH_R {
163        PWR_POR18Z_FAIL_LATCH_R::new(((self.bits >> 11) & 1) != 0)
164    }
165    #[doc = "Bit 12 - Mask for RTC compare 0 event"]
166    #[inline(always)]
167    pub fn rtc_cmpr0(&self) -> RTC_CMPR0_R {
168        RTC_CMPR0_R::new(((self.bits >> 12) & 1) != 0)
169    }
170    #[doc = "Bit 13 - Mask for RTC compare 1 event"]
171    #[inline(always)]
172    pub fn rtc_cmpr1(&self) -> RTC_CMPR1_R {
173        RTC_CMPR1_R::new(((self.bits >> 13) & 1) != 0)
174    }
175    #[doc = "Bit 14 - Mask for RTC prescale compare event"]
176    #[inline(always)]
177    pub fn rtc_prescale_cmp(&self) -> RTC_PRESCALE_CMP_R {
178        RTC_PRESCALE_CMP_R::new(((self.bits >> 14) & 1) != 0)
179    }
180    #[doc = "Bit 15 - Mask for RTC rollover event"]
181    #[inline(always)]
182    pub fn rtc_rollover(&self) -> RTC_ROLLOVER_R {
183        RTC_ROLLOVER_R::new(((self.bits >> 15) & 1) != 0)
184    }
185    #[doc = "Bit 16 - Mask for USB plug connect event"]
186    #[inline(always)]
187    pub fn pwr_usb_plug_wakeup(&self) -> PWR_USB_PLUG_WAKEUP_R {
188        PWR_USB_PLUG_WAKEUP_R::new(((self.bits >> 16) & 1) != 0)
189    }
190    #[doc = "Bit 17 - Mask for USB plug disconnect event"]
191    #[inline(always)]
192    pub fn pwr_usb_remove_wakeup(&self) -> PWR_USB_REMOVE_WAKEUP_R {
193        PWR_USB_REMOVE_WAKEUP_R::new(((self.bits >> 17) & 1) != 0)
194    }
195    #[doc = "Bit 18 - Mask for TVDD12 power fail event"]
196    #[inline(always)]
197    pub fn pwr_tvdd12_bad(&self) -> PWR_TVDD12_BAD_R {
198        PWR_TVDD12_BAD_R::new(((self.bits >> 18) & 1) != 0)
199    }
200}
201impl W {
202    #[doc = "Bit 1 - Mask for system reboot detect"]
203    #[inline(always)]
204    pub fn pwr_sys_reboot(&mut self) -> PWR_SYS_REBOOT_W {
205        PWR_SYS_REBOOT_W::new(self)
206    }
207    #[doc = "Bit 2 - Mask for previous power fail detect"]
208    #[inline(always)]
209    pub fn pwr_power_fail(&mut self) -> PWR_POWER_FAIL_W {
210        PWR_POWER_FAIL_W::new(self)
211    }
212    #[doc = "Bit 3 - Mask for previous boot fail detect"]
213    #[inline(always)]
214    pub fn pwr_boot_fail(&mut self) -> PWR_BOOT_FAIL_W {
215        PWR_BOOT_FAIL_W::new(self)
216    }
217    #[doc = "Bit 4 - Mask for flash discharge event"]
218    #[inline(always)]
219    pub fn pwr_flash_discharge(&mut self) -> PWR_FLASH_DISCHARGE_W {
220        PWR_FLASH_DISCHARGE_W::new(self)
221    }
222    #[doc = "Bit 5 - Mask for GPIO wakeup event detect"]
223    #[inline(always)]
224    pub fn pwr_iowakeup(&mut self) -> PWR_IOWAKEUP_W {
225        PWR_IOWAKEUP_W::new(self)
226    }
227    #[doc = "Bit 6 - Mask for VDD12 rst event"]
228    #[inline(always)]
229    pub fn pwr_vdd12_rst_bad(&mut self) -> PWR_VDD12_RST_BAD_W {
230        PWR_VDD12_RST_BAD_W::new(self)
231    }
232    #[doc = "Bit 7 - Mask for VDD18 rst event"]
233    #[inline(always)]
234    pub fn pwr_vdd18_rst_bad(&mut self) -> PWR_VDD18_RST_BAD_W {
235        PWR_VDD18_RST_BAD_W::new(self)
236    }
237    #[doc = "Bit 8 - Mask for VRTC rst event"]
238    #[inline(always)]
239    pub fn pwr_vrtc_rst_bad(&mut self) -> PWR_VRTC_RST_BAD_W {
240        PWR_VRTC_RST_BAD_W::new(self)
241    }
242    #[doc = "Bit 9 - Mask for VDDB rst event"]
243    #[inline(always)]
244    pub fn pwr_vddb_rst_bad(&mut self) -> PWR_VDDB_RST_BAD_W {
245        PWR_VDDB_RST_BAD_W::new(self)
246    }
247    #[doc = "Bit 10 - Mask for TVDD12 rst event"]
248    #[inline(always)]
249    pub fn pwr_tvdd12_rst_bad(&mut self) -> PWR_TVDD12_RST_BAD_W {
250        PWR_TVDD12_RST_BAD_W::new(self)
251    }
252    #[doc = "Bit 11 - Mask for POR18 powerfail event"]
253    #[inline(always)]
254    pub fn pwr_por18z_fail_latch(&mut self) -> PWR_POR18Z_FAIL_LATCH_W {
255        PWR_POR18Z_FAIL_LATCH_W::new(self)
256    }
257    #[doc = "Bit 12 - Mask for RTC compare 0 event"]
258    #[inline(always)]
259    pub fn rtc_cmpr0(&mut self) -> RTC_CMPR0_W {
260        RTC_CMPR0_W::new(self)
261    }
262    #[doc = "Bit 13 - Mask for RTC compare 1 event"]
263    #[inline(always)]
264    pub fn rtc_cmpr1(&mut self) -> RTC_CMPR1_W {
265        RTC_CMPR1_W::new(self)
266    }
267    #[doc = "Bit 14 - Mask for RTC prescale compare event"]
268    #[inline(always)]
269    pub fn rtc_prescale_cmp(&mut self) -> RTC_PRESCALE_CMP_W {
270        RTC_PRESCALE_CMP_W::new(self)
271    }
272    #[doc = "Bit 15 - Mask for RTC rollover event"]
273    #[inline(always)]
274    pub fn rtc_rollover(&mut self) -> RTC_ROLLOVER_W {
275        RTC_ROLLOVER_W::new(self)
276    }
277    #[doc = "Bit 16 - Mask for USB plug connect event"]
278    #[inline(always)]
279    pub fn pwr_usb_plug_wakeup(&mut self) -> PWR_USB_PLUG_WAKEUP_W {
280        PWR_USB_PLUG_WAKEUP_W::new(self)
281    }
282    #[doc = "Bit 17 - Mask for USB plug disconnect event"]
283    #[inline(always)]
284    pub fn pwr_usb_remove_wakeup(&mut self) -> PWR_USB_REMOVE_WAKEUP_W {
285        PWR_USB_REMOVE_WAKEUP_W::new(self)
286    }
287    #[doc = "Bit 18 - Mask for TVDD12 power fail event"]
288    #[inline(always)]
289    pub fn pwr_tvdd12_bad(&mut self) -> PWR_TVDD12_BAD_W {
290        PWR_TVDD12_BAD_W::new(self)
291    }
292    #[doc = "Writes raw bits to the register."]
293    #[inline(always)]
294    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
295        self.0.bits(bits);
296        self
297    }
298}
299#[doc = "Power Sequencer Flags Mask Register\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 [msk_flags](index.html) module"]
300pub struct MSK_FLAGS_SPEC;
301impl crate::RegisterSpec for MSK_FLAGS_SPEC {
302    type Ux = u32;
303}
304#[doc = "`read()` method returns [msk_flags::R](R) reader structure"]
305impl crate::Readable for MSK_FLAGS_SPEC {
306    type Reader = R;
307}
308#[doc = "`write(|w| ..)` method takes [msk_flags::W](W) writer structure"]
309impl crate::Writable for MSK_FLAGS_SPEC {
310    type Writer = W;
311}
312#[doc = "`reset()` method sets MSK_FLAGS to value 0"]
313impl crate::Resettable for MSK_FLAGS_SPEC {
314    #[inline(always)]
315    fn reset_value() -> Self::Ux {
316        0
317    }
318}