xmc4800/scu_hibernate/
hdset.rs

1#[doc = "Register `HDSET` writer"]
2pub type W = crate::W<HDSET_SPEC>;
3#[doc = "Wake-up Pin Event Positive Edge Set\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum EPEV_A {
6    #[doc = "0: No effect"]
7    VALUE1 = 0,
8    #[doc = "1: Set wake-up event"]
9    VALUE2 = 1,
10}
11impl From<EPEV_A> for bool {
12    #[inline(always)]
13    fn from(variant: EPEV_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `EPEV` writer - Wake-up Pin Event Positive Edge Set"]
18pub type EPEV_W<'a, REG> = crate::BitWriter<'a, REG, EPEV_A>;
19impl<'a, REG> EPEV_W<'a, REG>
20where
21    REG: crate::Writable + crate::RegisterSpec,
22{
23    #[doc = "No effect"]
24    #[inline(always)]
25    pub fn value1(self) -> &'a mut crate::W<REG> {
26        self.variant(EPEV_A::VALUE1)
27    }
28    #[doc = "Set wake-up event"]
29    #[inline(always)]
30    pub fn value2(self) -> &'a mut crate::W<REG> {
31        self.variant(EPEV_A::VALUE2)
32    }
33}
34#[doc = "Wake-up Pin Event Negative Edge Set\n\nValue on reset: 0"]
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum ENEV_A {
37    #[doc = "0: No effect"]
38    VALUE1 = 0,
39    #[doc = "1: Set wake-up event"]
40    VALUE2 = 1,
41}
42impl From<ENEV_A> for bool {
43    #[inline(always)]
44    fn from(variant: ENEV_A) -> Self {
45        variant as u8 != 0
46    }
47}
48#[doc = "Field `ENEV` writer - Wake-up Pin Event Negative Edge Set"]
49pub type ENEV_W<'a, REG> = crate::BitWriter<'a, REG, ENEV_A>;
50impl<'a, REG> ENEV_W<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53{
54    #[doc = "No effect"]
55    #[inline(always)]
56    pub fn value1(self) -> &'a mut crate::W<REG> {
57        self.variant(ENEV_A::VALUE1)
58    }
59    #[doc = "Set wake-up event"]
60    #[inline(always)]
61    pub fn value2(self) -> &'a mut crate::W<REG> {
62        self.variant(ENEV_A::VALUE2)
63    }
64}
65#[doc = "RTC Event Set\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq, Eq)]
67pub enum RTCEV_A {
68    #[doc = "0: No effect"]
69    VALUE1 = 0,
70    #[doc = "1: Set wake-up event"]
71    VALUE2 = 1,
72}
73impl From<RTCEV_A> for bool {
74    #[inline(always)]
75    fn from(variant: RTCEV_A) -> Self {
76        variant as u8 != 0
77    }
78}
79#[doc = "Field `RTCEV` writer - RTC Event Set"]
80pub type RTCEV_W<'a, REG> = crate::BitWriter<'a, REG, RTCEV_A>;
81impl<'a, REG> RTCEV_W<'a, REG>
82where
83    REG: crate::Writable + crate::RegisterSpec,
84{
85    #[doc = "No effect"]
86    #[inline(always)]
87    pub fn value1(self) -> &'a mut crate::W<REG> {
88        self.variant(RTCEV_A::VALUE1)
89    }
90    #[doc = "Set wake-up event"]
91    #[inline(always)]
92    pub fn value2(self) -> &'a mut crate::W<REG> {
93        self.variant(RTCEV_A::VALUE2)
94    }
95}
96#[doc = "ULP WDG Alarm Set\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum ULPWDG_A {
99    #[doc = "0: No effect"]
100    VALUE1 = 0,
101    #[doc = "1: Set watchdog alarm"]
102    VALUE2 = 1,
103}
104impl From<ULPWDG_A> for bool {
105    #[inline(always)]
106    fn from(variant: ULPWDG_A) -> Self {
107        variant as u8 != 0
108    }
109}
110#[doc = "Field `ULPWDG` writer - ULP WDG Alarm Set"]
111pub type ULPWDG_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDG_A>;
112impl<'a, REG> ULPWDG_W<'a, REG>
113where
114    REG: crate::Writable + crate::RegisterSpec,
115{
116    #[doc = "No effect"]
117    #[inline(always)]
118    pub fn value1(self) -> &'a mut crate::W<REG> {
119        self.variant(ULPWDG_A::VALUE1)
120    }
121    #[doc = "Set watchdog alarm"]
122    #[inline(always)]
123    pub fn value2(self) -> &'a mut crate::W<REG> {
124        self.variant(ULPWDG_A::VALUE2)
125    }
126}
127impl W {
128    #[doc = "Bit 0 - Wake-up Pin Event Positive Edge Set"]
129    #[inline(always)]
130    pub fn epev(&mut self) -> EPEV_W<HDSET_SPEC> {
131        EPEV_W::new(self, 0)
132    }
133    #[doc = "Bit 1 - Wake-up Pin Event Negative Edge Set"]
134    #[inline(always)]
135    pub fn enev(&mut self) -> ENEV_W<HDSET_SPEC> {
136        ENEV_W::new(self, 1)
137    }
138    #[doc = "Bit 2 - RTC Event Set"]
139    #[inline(always)]
140    pub fn rtcev(&mut self) -> RTCEV_W<HDSET_SPEC> {
141        RTCEV_W::new(self, 2)
142    }
143    #[doc = "Bit 3 - ULP WDG Alarm Set"]
144    #[inline(always)]
145    pub fn ulpwdg(&mut self) -> ULPWDG_W<HDSET_SPEC> {
146        ULPWDG_W::new(self, 3)
147    }
148}
149#[doc = "Hibernate Domain Status Set Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hdset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
150pub struct HDSET_SPEC;
151impl crate::RegisterSpec for HDSET_SPEC {
152    type Ux = u32;
153}
154#[doc = "`write(|w| ..)` method takes [`hdset::W`](W) writer structure"]
155impl crate::Writable for HDSET_SPEC {
156    type Safety = crate::Unsafe;
157    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
158    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
159}
160#[doc = "`reset()` method sets HDSET to value 0"]
161impl crate::Resettable for HDSET_SPEC {
162    const RESET_VALUE: u32 = 0;
163}