rp2040_pac/rtc/
irq_setup_0.rs
1#[doc = "Register `IRQ_SETUP_0` reader"]
2pub type R = crate::R<IRQ_SETUP_0_SPEC>;
3#[doc = "Register `IRQ_SETUP_0` writer"]
4pub type W = crate::W<IRQ_SETUP_0_SPEC>;
5#[doc = "Field `DAY` reader - Day of the month (1..31)"]
6pub type DAY_R = crate::FieldReader;
7#[doc = "Field `DAY` writer - Day of the month (1..31)"]
8pub type DAY_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `MONTH` reader - Month (1..12)"]
10pub type MONTH_R = crate::FieldReader;
11#[doc = "Field `MONTH` writer - Month (1..12)"]
12pub type MONTH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `YEAR` reader - Year"]
14pub type YEAR_R = crate::FieldReader<u16>;
15#[doc = "Field `YEAR` writer - Year"]
16pub type YEAR_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
17#[doc = "Field `DAY_ENA` reader - Enable day matching"]
18pub type DAY_ENA_R = crate::BitReader;
19#[doc = "Field `DAY_ENA` writer - Enable day matching"]
20pub type DAY_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `MONTH_ENA` reader - Enable month matching"]
22pub type MONTH_ENA_R = crate::BitReader;
23#[doc = "Field `MONTH_ENA` writer - Enable month matching"]
24pub type MONTH_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `YEAR_ENA` reader - Enable year matching"]
26pub type YEAR_ENA_R = crate::BitReader;
27#[doc = "Field `YEAR_ENA` writer - Enable year matching"]
28pub type YEAR_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `MATCH_ENA` reader - Global match enable. Don't change any other value while this one is enabled"]
30pub type MATCH_ENA_R = crate::BitReader;
31#[doc = "Field `MATCH_ENA` writer - Global match enable. Don't change any other value while this one is enabled"]
32pub type MATCH_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `MATCH_ACTIVE` reader - "]
34pub type MATCH_ACTIVE_R = crate::BitReader;
35impl R {
36 #[doc = "Bits 0:4 - Day of the month (1..31)"]
37 #[inline(always)]
38 pub fn day(&self) -> DAY_R {
39 DAY_R::new((self.bits & 0x1f) as u8)
40 }
41 #[doc = "Bits 8:11 - Month (1..12)"]
42 #[inline(always)]
43 pub fn month(&self) -> MONTH_R {
44 MONTH_R::new(((self.bits >> 8) & 0x0f) as u8)
45 }
46 #[doc = "Bits 12:23 - Year"]
47 #[inline(always)]
48 pub fn year(&self) -> YEAR_R {
49 YEAR_R::new(((self.bits >> 12) & 0x0fff) as u16)
50 }
51 #[doc = "Bit 24 - Enable day matching"]
52 #[inline(always)]
53 pub fn day_ena(&self) -> DAY_ENA_R {
54 DAY_ENA_R::new(((self.bits >> 24) & 1) != 0)
55 }
56 #[doc = "Bit 25 - Enable month matching"]
57 #[inline(always)]
58 pub fn month_ena(&self) -> MONTH_ENA_R {
59 MONTH_ENA_R::new(((self.bits >> 25) & 1) != 0)
60 }
61 #[doc = "Bit 26 - Enable year matching"]
62 #[inline(always)]
63 pub fn year_ena(&self) -> YEAR_ENA_R {
64 YEAR_ENA_R::new(((self.bits >> 26) & 1) != 0)
65 }
66 #[doc = "Bit 28 - Global match enable. Don't change any other value while this one is enabled"]
67 #[inline(always)]
68 pub fn match_ena(&self) -> MATCH_ENA_R {
69 MATCH_ENA_R::new(((self.bits >> 28) & 1) != 0)
70 }
71 #[doc = "Bit 29"]
72 #[inline(always)]
73 pub fn match_active(&self) -> MATCH_ACTIVE_R {
74 MATCH_ACTIVE_R::new(((self.bits >> 29) & 1) != 0)
75 }
76}
77impl W {
78 #[doc = "Bits 0:4 - Day of the month (1..31)"]
79 #[inline(always)]
80 #[must_use]
81 pub fn day(&mut self) -> DAY_W<IRQ_SETUP_0_SPEC> {
82 DAY_W::new(self, 0)
83 }
84 #[doc = "Bits 8:11 - Month (1..12)"]
85 #[inline(always)]
86 #[must_use]
87 pub fn month(&mut self) -> MONTH_W<IRQ_SETUP_0_SPEC> {
88 MONTH_W::new(self, 8)
89 }
90 #[doc = "Bits 12:23 - Year"]
91 #[inline(always)]
92 #[must_use]
93 pub fn year(&mut self) -> YEAR_W<IRQ_SETUP_0_SPEC> {
94 YEAR_W::new(self, 12)
95 }
96 #[doc = "Bit 24 - Enable day matching"]
97 #[inline(always)]
98 #[must_use]
99 pub fn day_ena(&mut self) -> DAY_ENA_W<IRQ_SETUP_0_SPEC> {
100 DAY_ENA_W::new(self, 24)
101 }
102 #[doc = "Bit 25 - Enable month matching"]
103 #[inline(always)]
104 #[must_use]
105 pub fn month_ena(&mut self) -> MONTH_ENA_W<IRQ_SETUP_0_SPEC> {
106 MONTH_ENA_W::new(self, 25)
107 }
108 #[doc = "Bit 26 - Enable year matching"]
109 #[inline(always)]
110 #[must_use]
111 pub fn year_ena(&mut self) -> YEAR_ENA_W<IRQ_SETUP_0_SPEC> {
112 YEAR_ENA_W::new(self, 26)
113 }
114 #[doc = "Bit 28 - Global match enable. Don't change any other value while this one is enabled"]
115 #[inline(always)]
116 #[must_use]
117 pub fn match_ena(&mut self) -> MATCH_ENA_W<IRQ_SETUP_0_SPEC> {
118 MATCH_ENA_W::new(self, 28)
119 }
120 #[doc = r" Writes raw bits to the register."]
121 #[doc = r""]
122 #[doc = r" # Safety"]
123 #[doc = r""]
124 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
125 #[inline(always)]
126 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
127 self.bits = bits;
128 self
129 }
130}
131#[doc = "Interrupt setup register 0
132
133You can [`read`](crate::generic::Reg::read) this register and get [`irq_setup_0::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 [`irq_setup_0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
134pub struct IRQ_SETUP_0_SPEC;
135impl crate::RegisterSpec for IRQ_SETUP_0_SPEC {
136 type Ux = u32;
137}
138#[doc = "`read()` method returns [`irq_setup_0::R`](R) reader structure"]
139impl crate::Readable for IRQ_SETUP_0_SPEC {}
140#[doc = "`write(|w| ..)` method takes [`irq_setup_0::W`](W) writer structure"]
141impl crate::Writable for IRQ_SETUP_0_SPEC {
142 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
143 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
144}
145#[doc = "`reset()` method sets IRQ_SETUP_0 to value 0"]
146impl crate::Resettable for IRQ_SETUP_0_SPEC {
147 const RESET_VALUE: u32 = 0;
148}