xmc4400/rtc/
atim1.rs

1#[doc = "Register `ATIM1` reader"]
2pub type R = crate::R<ATIM1_SPEC>;
3#[doc = "Register `ATIM1` writer"]
4pub type W = crate::W<ATIM1_SPEC>;
5#[doc = "Field `AMO` reader - Alarm Month Compare Value"]
6pub type AMO_R = crate::FieldReader;
7#[doc = "Field `AMO` writer - Alarm Month Compare Value"]
8pub type AMO_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `AYE` reader - Alarm Year Compare Value"]
10pub type AYE_R = crate::FieldReader<u16>;
11#[doc = "Field `AYE` writer - Alarm Year Compare Value"]
12pub type AYE_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    #[doc = "Bits 8:11 - Alarm Month Compare Value"]
15    #[inline(always)]
16    pub fn amo(&self) -> AMO_R {
17        AMO_R::new(((self.bits >> 8) & 0x0f) as u8)
18    }
19    #[doc = "Bits 16:31 - Alarm Year Compare Value"]
20    #[inline(always)]
21    pub fn aye(&self) -> AYE_R {
22        AYE_R::new(((self.bits >> 16) & 0xffff) as u16)
23    }
24}
25impl W {
26    #[doc = "Bits 8:11 - Alarm Month Compare Value"]
27    #[inline(always)]
28    pub fn amo(&mut self) -> AMO_W<ATIM1_SPEC> {
29        AMO_W::new(self, 8)
30    }
31    #[doc = "Bits 16:31 - Alarm Year Compare Value"]
32    #[inline(always)]
33    pub fn aye(&mut self) -> AYE_W<ATIM1_SPEC> {
34        AYE_W::new(self, 16)
35    }
36}
37#[doc = "RTC Alarm Time Register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`atim1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`atim1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct ATIM1_SPEC;
39impl crate::RegisterSpec for ATIM1_SPEC {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`atim1::R`](R) reader structure"]
43impl crate::Readable for ATIM1_SPEC {}
44#[doc = "`write(|w| ..)` method takes [`atim1::W`](W) writer structure"]
45impl crate::Writable for ATIM1_SPEC {
46    type Safety = crate::Unsafe;
47    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
48    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
49}
50#[doc = "`reset()` method sets ATIM1 to value 0"]
51impl crate::Resettable for ATIM1_SPEC {
52    const RESET_VALUE: u32 = 0;
53}