1#[doc = "Register `RWKAR` reader"]
2pub struct R(crate::R<RWKAR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RWKAR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RWKAR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RWKAR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `RWKAR` writer"]
17pub struct W(crate::W<RWKAR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<RWKAR_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<RWKAR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<RWKAR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `DAYW` reader - Day-of-Week Setting"]
38pub type DAYW_R = crate::FieldReader<u8, DAYW_A>;
39#[doc = "Day-of-Week Setting\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum DAYW_A {
43 #[doc = "0: Sunday"]
44 _000 = 0,
45 #[doc = "1: Monday"]
46 _001 = 1,
47 #[doc = "2: Tuesday"]
48 _010 = 2,
49 #[doc = "3: Wednesday"]
50 _011 = 3,
51 #[doc = "4: Thursday"]
52 _100 = 4,
53 #[doc = "5: Friday"]
54 _101 = 5,
55 #[doc = "6: Saturday"]
56 _110 = 6,
57 #[doc = "7: Setting prohibited"]
58 _111 = 7,
59}
60impl From<DAYW_A> for u8 {
61 #[inline(always)]
62 fn from(variant: DAYW_A) -> Self {
63 variant as _
64 }
65}
66impl DAYW_R {
67 #[doc = "Get enumerated values variant"]
68 #[inline(always)]
69 pub fn variant(&self) -> DAYW_A {
70 match self.bits {
71 0 => DAYW_A::_000,
72 1 => DAYW_A::_001,
73 2 => DAYW_A::_010,
74 3 => DAYW_A::_011,
75 4 => DAYW_A::_100,
76 5 => DAYW_A::_101,
77 6 => DAYW_A::_110,
78 7 => DAYW_A::_111,
79 _ => unreachable!(),
80 }
81 }
82 #[doc = "Checks if the value of the field is `_000`"]
83 #[inline(always)]
84 pub fn is_000(&self) -> bool {
85 *self == DAYW_A::_000
86 }
87 #[doc = "Checks if the value of the field is `_001`"]
88 #[inline(always)]
89 pub fn is_001(&self) -> bool {
90 *self == DAYW_A::_001
91 }
92 #[doc = "Checks if the value of the field is `_010`"]
93 #[inline(always)]
94 pub fn is_010(&self) -> bool {
95 *self == DAYW_A::_010
96 }
97 #[doc = "Checks if the value of the field is `_011`"]
98 #[inline(always)]
99 pub fn is_011(&self) -> bool {
100 *self == DAYW_A::_011
101 }
102 #[doc = "Checks if the value of the field is `_100`"]
103 #[inline(always)]
104 pub fn is_100(&self) -> bool {
105 *self == DAYW_A::_100
106 }
107 #[doc = "Checks if the value of the field is `_101`"]
108 #[inline(always)]
109 pub fn is_101(&self) -> bool {
110 *self == DAYW_A::_101
111 }
112 #[doc = "Checks if the value of the field is `_110`"]
113 #[inline(always)]
114 pub fn is_110(&self) -> bool {
115 *self == DAYW_A::_110
116 }
117 #[doc = "Checks if the value of the field is `_111`"]
118 #[inline(always)]
119 pub fn is_111(&self) -> bool {
120 *self == DAYW_A::_111
121 }
122}
123#[doc = "Field `DAYW` writer - Day-of-Week Setting"]
124pub type DAYW_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u8, RWKAR_SPEC, u8, DAYW_A, 3, O>;
125impl<'a, const O: u8> DAYW_W<'a, O> {
126 #[doc = "Sunday"]
127 #[inline(always)]
128 pub fn _000(self) -> &'a mut W {
129 self.variant(DAYW_A::_000)
130 }
131 #[doc = "Monday"]
132 #[inline(always)]
133 pub fn _001(self) -> &'a mut W {
134 self.variant(DAYW_A::_001)
135 }
136 #[doc = "Tuesday"]
137 #[inline(always)]
138 pub fn _010(self) -> &'a mut W {
139 self.variant(DAYW_A::_010)
140 }
141 #[doc = "Wednesday"]
142 #[inline(always)]
143 pub fn _011(self) -> &'a mut W {
144 self.variant(DAYW_A::_011)
145 }
146 #[doc = "Thursday"]
147 #[inline(always)]
148 pub fn _100(self) -> &'a mut W {
149 self.variant(DAYW_A::_100)
150 }
151 #[doc = "Friday"]
152 #[inline(always)]
153 pub fn _101(self) -> &'a mut W {
154 self.variant(DAYW_A::_101)
155 }
156 #[doc = "Saturday"]
157 #[inline(always)]
158 pub fn _110(self) -> &'a mut W {
159 self.variant(DAYW_A::_110)
160 }
161 #[doc = "Setting prohibited"]
162 #[inline(always)]
163 pub fn _111(self) -> &'a mut W {
164 self.variant(DAYW_A::_111)
165 }
166}
167#[doc = "Field `ENB` reader - ENB"]
168pub type ENB_R = crate::BitReader<ENB_A>;
169#[doc = "ENB\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq, Eq)]
171pub enum ENB_A {
172 #[doc = "0: Do not compare register value with RWKCNT counter value"]
173 _0 = 0,
174 #[doc = "1: Compare register value with RWKCNT counter value"]
175 _1 = 1,
176}
177impl From<ENB_A> for bool {
178 #[inline(always)]
179 fn from(variant: ENB_A) -> Self {
180 variant as u8 != 0
181 }
182}
183impl ENB_R {
184 #[doc = "Get enumerated values variant"]
185 #[inline(always)]
186 pub fn variant(&self) -> ENB_A {
187 match self.bits {
188 false => ENB_A::_0,
189 true => ENB_A::_1,
190 }
191 }
192 #[doc = "Checks if the value of the field is `_0`"]
193 #[inline(always)]
194 pub fn is_0(&self) -> bool {
195 *self == ENB_A::_0
196 }
197 #[doc = "Checks if the value of the field is `_1`"]
198 #[inline(always)]
199 pub fn is_1(&self) -> bool {
200 *self == ENB_A::_1
201 }
202}
203#[doc = "Field `ENB` writer - ENB"]
204pub type ENB_W<'a, const O: u8> = crate::BitWriter<'a, u8, RWKAR_SPEC, ENB_A, O>;
205impl<'a, const O: u8> ENB_W<'a, O> {
206 #[doc = "Do not compare register value with RWKCNT counter value"]
207 #[inline(always)]
208 pub fn _0(self) -> &'a mut W {
209 self.variant(ENB_A::_0)
210 }
211 #[doc = "Compare register value with RWKCNT counter value"]
212 #[inline(always)]
213 pub fn _1(self) -> &'a mut W {
214 self.variant(ENB_A::_1)
215 }
216}
217impl R {
218 #[doc = "Bits 0:2 - Day-of-Week Setting"]
219 #[inline(always)]
220 pub fn dayw(&self) -> DAYW_R {
221 DAYW_R::new(self.bits & 7)
222 }
223 #[doc = "Bit 7 - ENB"]
224 #[inline(always)]
225 pub fn enb(&self) -> ENB_R {
226 ENB_R::new(((self.bits >> 7) & 1) != 0)
227 }
228}
229impl W {
230 #[doc = "Bits 0:2 - Day-of-Week Setting"]
231 #[inline(always)]
232 #[must_use]
233 pub fn dayw(&mut self) -> DAYW_W<0> {
234 DAYW_W::new(self)
235 }
236 #[doc = "Bit 7 - ENB"]
237 #[inline(always)]
238 #[must_use]
239 pub fn enb(&mut self) -> ENB_W<7> {
240 ENB_W::new(self)
241 }
242 #[doc = "Writes raw bits to the register."]
243 #[inline(always)]
244 pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
245 self.0.bits(bits);
246 self
247 }
248}
249#[doc = "Day-of-Week Alarm Register (in Calendar Count Mode)\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 [rwkar](index.html) module"]
250pub struct RWKAR_SPEC;
251impl crate::RegisterSpec for RWKAR_SPEC {
252 type Ux = u8;
253}
254#[doc = "`read()` method returns [rwkar::R](R) reader structure"]
255impl crate::Readable for RWKAR_SPEC {
256 type Reader = R;
257}
258#[doc = "`write(|w| ..)` method takes [rwkar::W](W) writer structure"]
259impl crate::Writable for RWKAR_SPEC {
260 type Writer = W;
261 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
262 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
263}
264#[doc = "`reset()` method sets RWKAR to value 0"]
265impl crate::Resettable for RWKAR_SPEC {
266 const RESET_VALUE: Self::Ux = 0;
267}