rp2040_pac/rtc/
rtc_1.rs

1#[doc = "Register `RTC_1` reader"]
2pub type R = crate::R<RTC_1_SPEC>;
3#[doc = "Field `DAY` reader - Day of the month (1..31)"]
4pub type DAY_R = crate::FieldReader;
5#[doc = "Field `MONTH` reader - Month (1..12)"]
6pub type MONTH_R = crate::FieldReader;
7#[doc = "Field `YEAR` reader - Year"]
8pub type YEAR_R = crate::FieldReader<u16>;
9impl R {
10    #[doc = "Bits 0:4 - Day of the month (1..31)"]
11    #[inline(always)]
12    pub fn day(&self) -> DAY_R {
13        DAY_R::new((self.bits & 0x1f) as u8)
14    }
15    #[doc = "Bits 8:11 - Month (1..12)"]
16    #[inline(always)]
17    pub fn month(&self) -> MONTH_R {
18        MONTH_R::new(((self.bits >> 8) & 0x0f) as u8)
19    }
20    #[doc = "Bits 12:23 - Year"]
21    #[inline(always)]
22    pub fn year(&self) -> YEAR_R {
23        YEAR_R::new(((self.bits >> 12) & 0x0fff) as u16)
24    }
25}
26#[doc = "RTC register 1.  
27
28You can [`read`](crate::generic::Reg::read) this register and get [`rtc_1::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
29pub struct RTC_1_SPEC;
30impl crate::RegisterSpec for RTC_1_SPEC {
31    type Ux = u32;
32}
33#[doc = "`read()` method returns [`rtc_1::R`](R) reader structure"]
34impl crate::Readable for RTC_1_SPEC {}
35#[doc = "`reset()` method sets RTC_1 to value 0"]
36impl crate::Resettable for RTC_1_SPEC {
37    const RESET_VALUE: u32 = 0;
38}