1#[doc = "Register `ALM1_TIME` reader"]
2pub struct R(crate::R<ALM1_TIME_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ALM1_TIME_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ALM1_TIME_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ALM1_TIME_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `ALM1_TIME` writer"]
17pub struct W(crate::W<ALM1_TIME_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<ALM1_TIME_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<ALM1_TIME_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<ALM1_TIME_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ALM_SEC` reader - Alarm seconds, 0-59"]
38pub type ALM_SEC_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `ALM_SEC` writer - Alarm seconds, 0-59"]
40pub type ALM_SEC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALM1_TIME_SPEC, u8, u8, 6, O>;
41#[doc = "Field `ALM_SEC_EN` reader - Alarm second enable: 0=ignore, 1=match"]
42pub type ALM_SEC_EN_R = crate::BitReader<bool>;
43#[doc = "Field `ALM_SEC_EN` writer - Alarm second enable: 0=ignore, 1=match"]
44pub type ALM_SEC_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ALM1_TIME_SPEC, bool, O>;
45#[doc = "Field `ALM_MIN` reader - Alarm minutes, 0-59"]
46pub type ALM_MIN_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `ALM_MIN` writer - Alarm minutes, 0-59"]
48pub type ALM_MIN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALM1_TIME_SPEC, u8, u8, 6, O>;
49#[doc = "Field `ALM_MIN_EN` reader - Alarm minutes enable: 0=ignore, 1=match"]
50pub type ALM_MIN_EN_R = crate::BitReader<bool>;
51#[doc = "Field `ALM_MIN_EN` writer - Alarm minutes enable: 0=ignore, 1=match"]
52pub type ALM_MIN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ALM1_TIME_SPEC, bool, O>;
53#[doc = "Field `ALM_HOUR` reader - Alarm hours, value depending on 12/24HR mode 24HR: \\[4:0\\]=0-23 12HR: \\[4\\]:0=AM, 1=PM, \\[3:0\\]=1-12"]
54pub type ALM_HOUR_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `ALM_HOUR` writer - Alarm hours, value depending on 12/24HR mode 24HR: \\[4:0\\]=0-23 12HR: \\[4\\]:0=AM, 1=PM, \\[3:0\\]=1-12"]
56pub type ALM_HOUR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALM1_TIME_SPEC, u8, u8, 5, O>;
57#[doc = "Field `ALM_HOUR_EN` reader - Alarm hour enable: 0=ignore, 1=match"]
58pub type ALM_HOUR_EN_R = crate::BitReader<bool>;
59#[doc = "Field `ALM_HOUR_EN` writer - Alarm hour enable: 0=ignore, 1=match"]
60pub type ALM_HOUR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ALM1_TIME_SPEC, bool, O>;
61#[doc = "Field `ALM_DAY` reader - Alarm Day of the week, 1-7 It is up to the user to define the meaning of the values, but 1=Monday is recommended"]
62pub type ALM_DAY_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `ALM_DAY` writer - Alarm Day of the week, 1-7 It is up to the user to define the meaning of the values, but 1=Monday is recommended"]
64pub type ALM_DAY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALM1_TIME_SPEC, u8, u8, 3, O>;
65#[doc = "Field `ALM_DAY_EN` reader - Alarm Day of the Week enable: 0=ignore, 1=match"]
66pub type ALM_DAY_EN_R = crate::BitReader<bool>;
67#[doc = "Field `ALM_DAY_EN` writer - Alarm Day of the Week enable: 0=ignore, 1=match"]
68pub type ALM_DAY_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ALM1_TIME_SPEC, bool, O>;
69impl R {
70 #[doc = "Bits 0:5 - Alarm seconds, 0-59"]
71 #[inline(always)]
72 pub fn alm_sec(&self) -> ALM_SEC_R {
73 ALM_SEC_R::new((self.bits & 0x3f) as u8)
74 }
75 #[doc = "Bit 7 - Alarm second enable: 0=ignore, 1=match"]
76 #[inline(always)]
77 pub fn alm_sec_en(&self) -> ALM_SEC_EN_R {
78 ALM_SEC_EN_R::new(((self.bits >> 7) & 1) != 0)
79 }
80 #[doc = "Bits 8:13 - Alarm minutes, 0-59"]
81 #[inline(always)]
82 pub fn alm_min(&self) -> ALM_MIN_R {
83 ALM_MIN_R::new(((self.bits >> 8) & 0x3f) as u8)
84 }
85 #[doc = "Bit 15 - Alarm minutes enable: 0=ignore, 1=match"]
86 #[inline(always)]
87 pub fn alm_min_en(&self) -> ALM_MIN_EN_R {
88 ALM_MIN_EN_R::new(((self.bits >> 15) & 1) != 0)
89 }
90 #[doc = "Bits 16:20 - Alarm hours, value depending on 12/24HR mode 24HR: \\[4:0\\]=0-23 12HR: \\[4\\]:0=AM, 1=PM, \\[3:0\\]=1-12"]
91 #[inline(always)]
92 pub fn alm_hour(&self) -> ALM_HOUR_R {
93 ALM_HOUR_R::new(((self.bits >> 16) & 0x1f) as u8)
94 }
95 #[doc = "Bit 23 - Alarm hour enable: 0=ignore, 1=match"]
96 #[inline(always)]
97 pub fn alm_hour_en(&self) -> ALM_HOUR_EN_R {
98 ALM_HOUR_EN_R::new(((self.bits >> 23) & 1) != 0)
99 }
100 #[doc = "Bits 24:26 - Alarm Day of the week, 1-7 It is up to the user to define the meaning of the values, but 1=Monday is recommended"]
101 #[inline(always)]
102 pub fn alm_day(&self) -> ALM_DAY_R {
103 ALM_DAY_R::new(((self.bits >> 24) & 7) as u8)
104 }
105 #[doc = "Bit 31 - Alarm Day of the Week enable: 0=ignore, 1=match"]
106 #[inline(always)]
107 pub fn alm_day_en(&self) -> ALM_DAY_EN_R {
108 ALM_DAY_EN_R::new(((self.bits >> 31) & 1) != 0)
109 }
110}
111impl W {
112 #[doc = "Bits 0:5 - Alarm seconds, 0-59"]
113 #[inline(always)]
114 #[must_use]
115 pub fn alm_sec(&mut self) -> ALM_SEC_W<0> {
116 ALM_SEC_W::new(self)
117 }
118 #[doc = "Bit 7 - Alarm second enable: 0=ignore, 1=match"]
119 #[inline(always)]
120 #[must_use]
121 pub fn alm_sec_en(&mut self) -> ALM_SEC_EN_W<7> {
122 ALM_SEC_EN_W::new(self)
123 }
124 #[doc = "Bits 8:13 - Alarm minutes, 0-59"]
125 #[inline(always)]
126 #[must_use]
127 pub fn alm_min(&mut self) -> ALM_MIN_W<8> {
128 ALM_MIN_W::new(self)
129 }
130 #[doc = "Bit 15 - Alarm minutes enable: 0=ignore, 1=match"]
131 #[inline(always)]
132 #[must_use]
133 pub fn alm_min_en(&mut self) -> ALM_MIN_EN_W<15> {
134 ALM_MIN_EN_W::new(self)
135 }
136 #[doc = "Bits 16:20 - Alarm hours, value depending on 12/24HR mode 24HR: \\[4:0\\]=0-23 12HR: \\[4\\]:0=AM, 1=PM, \\[3:0\\]=1-12"]
137 #[inline(always)]
138 #[must_use]
139 pub fn alm_hour(&mut self) -> ALM_HOUR_W<16> {
140 ALM_HOUR_W::new(self)
141 }
142 #[doc = "Bit 23 - Alarm hour enable: 0=ignore, 1=match"]
143 #[inline(always)]
144 #[must_use]
145 pub fn alm_hour_en(&mut self) -> ALM_HOUR_EN_W<23> {
146 ALM_HOUR_EN_W::new(self)
147 }
148 #[doc = "Bits 24:26 - Alarm Day of the week, 1-7 It is up to the user to define the meaning of the values, but 1=Monday is recommended"]
149 #[inline(always)]
150 #[must_use]
151 pub fn alm_day(&mut self) -> ALM_DAY_W<24> {
152 ALM_DAY_W::new(self)
153 }
154 #[doc = "Bit 31 - Alarm Day of the Week enable: 0=ignore, 1=match"]
155 #[inline(always)]
156 #[must_use]
157 pub fn alm_day_en(&mut self) -> ALM_DAY_EN_W<31> {
158 ALM_DAY_EN_W::new(self)
159 }
160 #[doc = "Writes raw bits to the register."]
161 #[inline(always)]
162 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
163 self.0.bits(bits);
164 self
165 }
166}
167#[doc = "Alarm 1 Seconds, Minute, Hours, Day of Week\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [alm1_time](index.html) module"]
168pub struct ALM1_TIME_SPEC;
169impl crate::RegisterSpec for ALM1_TIME_SPEC {
170 type Ux = u32;
171}
172#[doc = "`read()` method returns [alm1_time::R](R) reader structure"]
173impl crate::Readable for ALM1_TIME_SPEC {
174 type Reader = R;
175}
176#[doc = "`write(|w| ..)` method takes [alm1_time::W](W) writer structure"]
177impl crate::Writable for ALM1_TIME_SPEC {
178 type Writer = W;
179 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
180 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
181}
182#[doc = "`reset()` method sets ALM1_TIME to value 0x0100_0000"]
183impl crate::Resettable for ALM1_TIME_SPEC {
184 const RESET_VALUE: Self::Ux = 0x0100_0000;
185}