d1_pac/rtc/
alarm0_cur_vlu.rs

1#[doc = "Register `alarm0_cur_vlu` reader"]
2pub type R = crate::R<ALARM0_CUR_VLU_SPEC>;
3#[doc = "Register `alarm0_cur_vlu` writer"]
4pub type W = crate::W<ALARM0_CUR_VLU_SPEC>;
5#[doc = "Field `second` reader - Current second Range from 0 to 59."]
6pub type SECOND_R = crate::FieldReader;
7#[doc = "Field `second` writer - Current second Range from 0 to 59."]
8pub type SECOND_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `minute` reader - Current minute Range from 0 to 59."]
10pub type MINUTE_R = crate::FieldReader;
11#[doc = "Field `minute` writer - Current minute Range from 0 to 59."]
12pub type MINUTE_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13#[doc = "Field `hour` reader - Current hour Range from 0 to 23."]
14pub type HOUR_R = crate::FieldReader;
15#[doc = "Field `hour` writer - Current hour Range from 0 to 23."]
16pub type HOUR_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
17impl R {
18    #[doc = "Bits 0:5 - Current second Range from 0 to 59."]
19    #[inline(always)]
20    pub fn second(&self) -> SECOND_R {
21        SECOND_R::new((self.bits & 0x3f) as u8)
22    }
23    #[doc = "Bits 8:13 - Current minute Range from 0 to 59."]
24    #[inline(always)]
25    pub fn minute(&self) -> MINUTE_R {
26        MINUTE_R::new(((self.bits >> 8) & 0x3f) as u8)
27    }
28    #[doc = "Bits 16:20 - Current hour Range from 0 to 23."]
29    #[inline(always)]
30    pub fn hour(&self) -> HOUR_R {
31        HOUR_R::new(((self.bits >> 16) & 0x1f) as u8)
32    }
33}
34impl W {
35    #[doc = "Bits 0:5 - Current second Range from 0 to 59."]
36    #[inline(always)]
37    #[must_use]
38    pub fn second(&mut self) -> SECOND_W<ALARM0_CUR_VLU_SPEC> {
39        SECOND_W::new(self, 0)
40    }
41    #[doc = "Bits 8:13 - Current minute Range from 0 to 59."]
42    #[inline(always)]
43    #[must_use]
44    pub fn minute(&mut self) -> MINUTE_W<ALARM0_CUR_VLU_SPEC> {
45        MINUTE_W::new(self, 8)
46    }
47    #[doc = "Bits 16:20 - Current hour Range from 0 to 23."]
48    #[inline(always)]
49    #[must_use]
50    pub fn hour(&mut self) -> HOUR_W<ALARM0_CUR_VLU_SPEC> {
51        HOUR_W::new(self, 16)
52    }
53    #[doc = r" Writes raw bits to the register."]
54    #[doc = r""]
55    #[doc = r" # Safety"]
56    #[doc = r""]
57    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
58    #[inline(always)]
59    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
60        self.bits = bits;
61        self
62    }
63}
64#[doc = "Alarm 0 Counter Current Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`alarm0_cur_vlu::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`alarm0_cur_vlu::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
65pub struct ALARM0_CUR_VLU_SPEC;
66impl crate::RegisterSpec for ALARM0_CUR_VLU_SPEC {
67    type Ux = u32;
68}
69#[doc = "`read()` method returns [`alarm0_cur_vlu::R`](R) reader structure"]
70impl crate::Readable for ALARM0_CUR_VLU_SPEC {}
71#[doc = "`write(|w| ..)` method takes [`alarm0_cur_vlu::W`](W) writer structure"]
72impl crate::Writable for ALARM0_CUR_VLU_SPEC {
73    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
74    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
75}
76#[doc = "`reset()` method sets alarm0_cur_vlu to value 0"]
77impl crate::Resettable for ALARM0_CUR_VLU_SPEC {
78    const RESET_VALUE: Self::Ux = 0;
79}