rp2040_pac/rtc/
rtc_0.rs

1#[doc = "Register `RTC_0` reader"]
2pub type R = crate::R<RTC_0_SPEC>;
3#[doc = "Field `SEC` reader - Seconds"]
4pub type SEC_R = crate::FieldReader;
5#[doc = "Field `MIN` reader - Minutes"]
6pub type MIN_R = crate::FieldReader;
7#[doc = "Field `HOUR` reader - Hours"]
8pub type HOUR_R = crate::FieldReader;
9#[doc = "Field `DOTW` reader - Day of the week"]
10pub type DOTW_R = crate::FieldReader;
11impl R {
12    #[doc = "Bits 0:5 - Seconds"]
13    #[inline(always)]
14    pub fn sec(&self) -> SEC_R {
15        SEC_R::new((self.bits & 0x3f) as u8)
16    }
17    #[doc = "Bits 8:13 - Minutes"]
18    #[inline(always)]
19    pub fn min(&self) -> MIN_R {
20        MIN_R::new(((self.bits >> 8) & 0x3f) as u8)
21    }
22    #[doc = "Bits 16:20 - Hours"]
23    #[inline(always)]
24    pub fn hour(&self) -> HOUR_R {
25        HOUR_R::new(((self.bits >> 16) & 0x1f) as u8)
26    }
27    #[doc = "Bits 24:26 - Day of the week"]
28    #[inline(always)]
29    pub fn dotw(&self) -> DOTW_R {
30        DOTW_R::new(((self.bits >> 24) & 7) as u8)
31    }
32}
33#[doc = "RTC register 0  
34 Read this before RTC 1!  
35
36You can [`read`](crate::generic::Reg::read) this register and get [`rtc_0::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct RTC_0_SPEC;
38impl crate::RegisterSpec for RTC_0_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`rtc_0::R`](R) reader structure"]
42impl crate::Readable for RTC_0_SPEC {}
43#[doc = "`reset()` method sets RTC_0 to value 0"]
44impl crate::Resettable for RTC_0_SPEC {
45    const RESET_VALUE: u32 = 0;
46}