xmc4400/rtc/
atim0.rs

1#[doc = "Register `ATIM0` reader"]
2pub type R = crate::R<ATIM0_SPEC>;
3#[doc = "Register `ATIM0` writer"]
4pub type W = crate::W<ATIM0_SPEC>;
5#[doc = "Field `ASE` reader - Alarm Seconds Compare Value"]
6pub type ASE_R = crate::FieldReader;
7#[doc = "Field `ASE` writer - Alarm Seconds Compare Value"]
8pub type ASE_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `AMI` reader - Alarm Minutes Compare Value"]
10pub type AMI_R = crate::FieldReader;
11#[doc = "Field `AMI` writer - Alarm Minutes Compare Value"]
12pub type AMI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13#[doc = "Field `AHO` reader - Alarm Hours Compare Value"]
14pub type AHO_R = crate::FieldReader;
15#[doc = "Field `AHO` writer - Alarm Hours Compare Value"]
16pub type AHO_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
17#[doc = "Field `ADA` reader - Alarm Days Compare Value"]
18pub type ADA_R = crate::FieldReader;
19#[doc = "Field `ADA` writer - Alarm Days Compare Value"]
20pub type ADA_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
21impl R {
22    #[doc = "Bits 0:5 - Alarm Seconds Compare Value"]
23    #[inline(always)]
24    pub fn ase(&self) -> ASE_R {
25        ASE_R::new((self.bits & 0x3f) as u8)
26    }
27    #[doc = "Bits 8:13 - Alarm Minutes Compare Value"]
28    #[inline(always)]
29    pub fn ami(&self) -> AMI_R {
30        AMI_R::new(((self.bits >> 8) & 0x3f) as u8)
31    }
32    #[doc = "Bits 16:20 - Alarm Hours Compare Value"]
33    #[inline(always)]
34    pub fn aho(&self) -> AHO_R {
35        AHO_R::new(((self.bits >> 16) & 0x1f) as u8)
36    }
37    #[doc = "Bits 24:28 - Alarm Days Compare Value"]
38    #[inline(always)]
39    pub fn ada(&self) -> ADA_R {
40        ADA_R::new(((self.bits >> 24) & 0x1f) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:5 - Alarm Seconds Compare Value"]
45    #[inline(always)]
46    pub fn ase(&mut self) -> ASE_W<ATIM0_SPEC> {
47        ASE_W::new(self, 0)
48    }
49    #[doc = "Bits 8:13 - Alarm Minutes Compare Value"]
50    #[inline(always)]
51    pub fn ami(&mut self) -> AMI_W<ATIM0_SPEC> {
52        AMI_W::new(self, 8)
53    }
54    #[doc = "Bits 16:20 - Alarm Hours Compare Value"]
55    #[inline(always)]
56    pub fn aho(&mut self) -> AHO_W<ATIM0_SPEC> {
57        AHO_W::new(self, 16)
58    }
59    #[doc = "Bits 24:28 - Alarm Days Compare Value"]
60    #[inline(always)]
61    pub fn ada(&mut self) -> ADA_W<ATIM0_SPEC> {
62        ADA_W::new(self, 24)
63    }
64}
65#[doc = "RTC Alarm Time Register 0\n\nYou can [`read`](crate::Reg::read) this register and get [`atim0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`atim0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
66pub struct ATIM0_SPEC;
67impl crate::RegisterSpec for ATIM0_SPEC {
68    type Ux = u32;
69}
70#[doc = "`read()` method returns [`atim0::R`](R) reader structure"]
71impl crate::Readable for ATIM0_SPEC {}
72#[doc = "`write(|w| ..)` method takes [`atim0::W`](W) writer structure"]
73impl crate::Writable for ATIM0_SPEC {
74    type Safety = crate::Unsafe;
75    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
77}
78#[doc = "`reset()` method sets ATIM0 to value 0"]
79impl crate::Resettable for ATIM0_SPEC {
80    const RESET_VALUE: u32 = 0;
81}