1pub type R = crate::R<ALRMRrs>;
3pub type W = crate::W<ALRMRrs>;
5pub type SU_R = crate::FieldReader;
7pub type SU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
9pub type ST_R = crate::FieldReader;
11pub type ST_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
13#[cfg_attr(feature = "defmt", derive(defmt::Format))]
17#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18pub enum MSK1 {
19 Mask = 0,
21 NotMask = 1,
23}
24impl From<MSK1> for bool {
25 #[inline(always)]
26 fn from(variant: MSK1) -> Self {
27 variant as u8 != 0
28 }
29}
30pub type MSK1_R = crate::BitReader<MSK1>;
32impl MSK1_R {
33 #[inline(always)]
35 pub const fn variant(&self) -> MSK1 {
36 match self.bits {
37 false => MSK1::Mask,
38 true => MSK1::NotMask,
39 }
40 }
41 #[inline(always)]
43 pub fn is_mask(&self) -> bool {
44 *self == MSK1::Mask
45 }
46 #[inline(always)]
48 pub fn is_not_mask(&self) -> bool {
49 *self == MSK1::NotMask
50 }
51}
52pub type MSK1_W<'a, REG> = crate::BitWriter<'a, REG, MSK1>;
54impl<'a, REG> MSK1_W<'a, REG>
55where
56 REG: crate::Writable + crate::RegisterSpec,
57{
58 #[inline(always)]
60 pub fn mask(self) -> &'a mut crate::W<REG> {
61 self.variant(MSK1::Mask)
62 }
63 #[inline(always)]
65 pub fn not_mask(self) -> &'a mut crate::W<REG> {
66 self.variant(MSK1::NotMask)
67 }
68}
69pub type MNU_R = crate::FieldReader;
71pub type MNU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
73pub type MNT_R = crate::FieldReader;
75pub type MNT_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
77pub use MSK1_R as MSK2_R;
79pub use MSK1_W as MSK2_W;
81pub type HU_R = crate::FieldReader;
83pub type HU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
85pub type HT_R = crate::FieldReader;
87pub type HT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, u8, crate::Safe>;
89#[cfg_attr(feature = "defmt", derive(defmt::Format))]
93#[derive(Clone, Copy, Debug, PartialEq, Eq)]
94pub enum PM {
95 Am = 0,
97 Pm = 1,
99}
100impl From<PM> for bool {
101 #[inline(always)]
102 fn from(variant: PM) -> Self {
103 variant as u8 != 0
104 }
105}
106pub type PM_R = crate::BitReader<PM>;
108impl PM_R {
109 #[inline(always)]
111 pub const fn variant(&self) -> PM {
112 match self.bits {
113 false => PM::Am,
114 true => PM::Pm,
115 }
116 }
117 #[inline(always)]
119 pub fn is_am(&self) -> bool {
120 *self == PM::Am
121 }
122 #[inline(always)]
124 pub fn is_pm(&self) -> bool {
125 *self == PM::Pm
126 }
127}
128pub type PM_W<'a, REG> = crate::BitWriter<'a, REG, PM>;
130impl<'a, REG> PM_W<'a, REG>
131where
132 REG: crate::Writable + crate::RegisterSpec,
133{
134 #[inline(always)]
136 pub fn am(self) -> &'a mut crate::W<REG> {
137 self.variant(PM::Am)
138 }
139 #[inline(always)]
141 pub fn pm(self) -> &'a mut crate::W<REG> {
142 self.variant(PM::Pm)
143 }
144}
145pub use MSK1_R as MSK3_R;
147pub use MSK1_W as MSK3_W;
149pub type DU_R = crate::FieldReader;
151pub type DU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
153pub type DT_R = crate::FieldReader;
155pub type DT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, u8, crate::Safe>;
157#[cfg_attr(feature = "defmt", derive(defmt::Format))]
161#[derive(Clone, Copy, Debug, PartialEq, Eq)]
162pub enum WDSEL {
163 DateUnits = 0,
165 WeekDay = 1,
167}
168impl From<WDSEL> for bool {
169 #[inline(always)]
170 fn from(variant: WDSEL) -> Self {
171 variant as u8 != 0
172 }
173}
174pub type WDSEL_R = crate::BitReader<WDSEL>;
176impl WDSEL_R {
177 #[inline(always)]
179 pub const fn variant(&self) -> WDSEL {
180 match self.bits {
181 false => WDSEL::DateUnits,
182 true => WDSEL::WeekDay,
183 }
184 }
185 #[inline(always)]
187 pub fn is_date_units(&self) -> bool {
188 *self == WDSEL::DateUnits
189 }
190 #[inline(always)]
192 pub fn is_week_day(&self) -> bool {
193 *self == WDSEL::WeekDay
194 }
195}
196pub type WDSEL_W<'a, REG> = crate::BitWriter<'a, REG, WDSEL>;
198impl<'a, REG> WDSEL_W<'a, REG>
199where
200 REG: crate::Writable + crate::RegisterSpec,
201{
202 #[inline(always)]
204 pub fn date_units(self) -> &'a mut crate::W<REG> {
205 self.variant(WDSEL::DateUnits)
206 }
207 #[inline(always)]
209 pub fn week_day(self) -> &'a mut crate::W<REG> {
210 self.variant(WDSEL::WeekDay)
211 }
212}
213pub use MSK1_R as MSK4_R;
215pub use MSK1_W as MSK4_W;
217impl R {
218 #[inline(always)]
220 pub fn su(&self) -> SU_R {
221 SU_R::new((self.bits & 0x0f) as u8)
222 }
223 #[inline(always)]
225 pub fn st(&self) -> ST_R {
226 ST_R::new(((self.bits >> 4) & 7) as u8)
227 }
228 #[inline(always)]
230 pub fn msk1(&self) -> MSK1_R {
231 MSK1_R::new(((self.bits >> 7) & 1) != 0)
232 }
233 #[inline(always)]
235 pub fn mnu(&self) -> MNU_R {
236 MNU_R::new(((self.bits >> 8) & 0x0f) as u8)
237 }
238 #[inline(always)]
240 pub fn mnt(&self) -> MNT_R {
241 MNT_R::new(((self.bits >> 12) & 7) as u8)
242 }
243 #[inline(always)]
245 pub fn msk2(&self) -> MSK2_R {
246 MSK2_R::new(((self.bits >> 15) & 1) != 0)
247 }
248 #[inline(always)]
250 pub fn hu(&self) -> HU_R {
251 HU_R::new(((self.bits >> 16) & 0x0f) as u8)
252 }
253 #[inline(always)]
255 pub fn ht(&self) -> HT_R {
256 HT_R::new(((self.bits >> 20) & 3) as u8)
257 }
258 #[inline(always)]
260 pub fn pm(&self) -> PM_R {
261 PM_R::new(((self.bits >> 22) & 1) != 0)
262 }
263 #[inline(always)]
265 pub fn msk3(&self) -> MSK3_R {
266 MSK3_R::new(((self.bits >> 23) & 1) != 0)
267 }
268 #[inline(always)]
270 pub fn du(&self) -> DU_R {
271 DU_R::new(((self.bits >> 24) & 0x0f) as u8)
272 }
273 #[inline(always)]
275 pub fn dt(&self) -> DT_R {
276 DT_R::new(((self.bits >> 28) & 3) as u8)
277 }
278 #[inline(always)]
280 pub fn wdsel(&self) -> WDSEL_R {
281 WDSEL_R::new(((self.bits >> 30) & 1) != 0)
282 }
283 #[inline(always)]
285 pub fn msk4(&self) -> MSK4_R {
286 MSK4_R::new(((self.bits >> 31) & 1) != 0)
287 }
288}
289impl core::fmt::Debug for R {
290 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
291 f.debug_struct("ALRMR")
292 .field("msk1", &self.msk1())
293 .field("msk4", &self.msk4())
294 .field("wdsel", &self.wdsel())
295 .field("dt", &self.dt())
296 .field("du", &self.du())
297 .field("msk3", &self.msk3())
298 .field("pm", &self.pm())
299 .field("ht", &self.ht())
300 .field("hu", &self.hu())
301 .field("msk2", &self.msk2())
302 .field("mnt", &self.mnt())
303 .field("mnu", &self.mnu())
304 .field("st", &self.st())
305 .field("su", &self.su())
306 .finish()
307 }
308}
309impl W {
310 #[inline(always)]
312 pub fn su(&mut self) -> SU_W<ALRMRrs> {
313 SU_W::new(self, 0)
314 }
315 #[inline(always)]
317 pub fn st(&mut self) -> ST_W<ALRMRrs> {
318 ST_W::new(self, 4)
319 }
320 #[inline(always)]
322 pub fn msk1(&mut self) -> MSK1_W<ALRMRrs> {
323 MSK1_W::new(self, 7)
324 }
325 #[inline(always)]
327 pub fn mnu(&mut self) -> MNU_W<ALRMRrs> {
328 MNU_W::new(self, 8)
329 }
330 #[inline(always)]
332 pub fn mnt(&mut self) -> MNT_W<ALRMRrs> {
333 MNT_W::new(self, 12)
334 }
335 #[inline(always)]
337 pub fn msk2(&mut self) -> MSK2_W<ALRMRrs> {
338 MSK2_W::new(self, 15)
339 }
340 #[inline(always)]
342 pub fn hu(&mut self) -> HU_W<ALRMRrs> {
343 HU_W::new(self, 16)
344 }
345 #[inline(always)]
347 pub fn ht(&mut self) -> HT_W<ALRMRrs> {
348 HT_W::new(self, 20)
349 }
350 #[inline(always)]
352 pub fn pm(&mut self) -> PM_W<ALRMRrs> {
353 PM_W::new(self, 22)
354 }
355 #[inline(always)]
357 pub fn msk3(&mut self) -> MSK3_W<ALRMRrs> {
358 MSK3_W::new(self, 23)
359 }
360 #[inline(always)]
362 pub fn du(&mut self) -> DU_W<ALRMRrs> {
363 DU_W::new(self, 24)
364 }
365 #[inline(always)]
367 pub fn dt(&mut self) -> DT_W<ALRMRrs> {
368 DT_W::new(self, 28)
369 }
370 #[inline(always)]
372 pub fn wdsel(&mut self) -> WDSEL_W<ALRMRrs> {
373 WDSEL_W::new(self, 30)
374 }
375 #[inline(always)]
377 pub fn msk4(&mut self) -> MSK4_W<ALRMRrs> {
378 MSK4_W::new(self, 31)
379 }
380}
381pub struct ALRMRrs;
387impl crate::RegisterSpec for ALRMRrs {
388 type Ux = u32;
389}
390impl crate::Readable for ALRMRrs {}
392impl crate::Writable for ALRMRrs {
394 type Safety = crate::Unsafe;
395}
396impl crate::Resettable for ALRMRrs {}