1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#[doc = "Register `TAMP` reader"]
pub type R = crate::R<TampSpec>;
#[doc = "Register `TAMP` writer"]
pub type W = crate::W<TampSpec>;
#[doc = "Field `TP0EN` reader - RTC_TAMP1 input detection enable"]
pub type Tp0enR = crate::BitReader;
#[doc = "Field `TP0EN` writer - RTC_TAMP1 input detection enable"]
pub type Tp0enW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TP0EG` reader - Tamper 0 event trigger edge for RTC_TAMP0 input"]
pub type Tp0egR = crate::BitReader;
#[doc = "Field `TP0EG` writer - Tamper 0 event trigger edge for RTC_TAMP0 input"]
pub type Tp0egW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TPIE` reader - Tamper detection interrupt enable"]
pub type TpieR = crate::BitReader;
#[doc = "Field `TPIE` writer - Tamper detection interrupt enable"]
pub type TpieW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TP1EN` reader - Tamper 1 detection enable"]
pub type Tp1enR = crate::BitReader;
#[doc = "Field `TP1EN` writer - Tamper 1 detection enable"]
pub type Tp1enW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TP1EG` reader - Tamper 1 event trigger edge for RTC_TAMP1 input"]
pub type Tp1egR = crate::BitReader;
#[doc = "Field `TP1EG` writer - Tamper 1 event trigger edge for RTC_TAMP1 input"]
pub type Tp1egW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TPTS` reader - Make tamper function used for timestamp function"]
pub type TptsR = crate::BitReader;
#[doc = "Field `TPTS` writer - Make tamper function used for timestamp function"]
pub type TptsW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `FREQ` reader - Sample frequency of tamper event detection"]
pub type FreqR = crate::FieldReader;
#[doc = "Field `FREQ` writer - Sample frequency of tamper event detection"]
pub type FreqW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
#[doc = "Field `FLT` reader - RTC_TAMPx filter count setting"]
pub type FltR = crate::FieldReader;
#[doc = "Field `FLT` writer - RTC_TAMPx filter count setting"]
pub type FltW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `PRCH` reader - Precharge duration time of RTC_TAMPx"]
pub type PrchR = crate::FieldReader;
#[doc = "Field `PRCH` writer - Precharge duration time of RTC_TAMPx"]
pub type PrchW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `DISPU` reader - RTC_TAMPx pull up disable bit"]
pub type DispuR = crate::BitReader;
#[doc = "Field `DISPU` writer - RTC_TAMPx pull up disable bit"]
pub type DispuW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC13VAL` reader - Alarm output type control/PC13 output value"]
pub type Pc13valR = crate::BitReader;
#[doc = "Field `PC13VAL` writer - Alarm output type control/PC13 output value"]
pub type Pc13valW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC13MDE` reader - PC13 mode"]
pub type Pc13mdeR = crate::BitReader;
#[doc = "Field `PC13MDE` writer - PC13 mode"]
pub type Pc13mdeW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC14VAL` reader - PC14 value"]
pub type Pc14valR = crate::BitReader;
#[doc = "Field `PC14VAL` writer - PC14 value"]
pub type Pc14valW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC14MDE` reader - PC14 mode"]
pub type Pc14mdeR = crate::BitReader;
#[doc = "Field `PC14MDE` writer - PC14 mode"]
pub type Pc14mdeW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC15VAL` reader - PC15 value"]
pub type Pc15valR = crate::BitReader;
#[doc = "Field `PC15VAL` writer - PC15 value"]
pub type Pc15valW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PC15MDE` reader - PC15 mode"]
pub type Pc15mdeR = crate::BitReader;
#[doc = "Field `PC15MDE` writer - PC15 mode"]
pub type Pc15mdeW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bit 0 - RTC_TAMP1 input detection enable"]
    #[inline(always)]
    pub fn tp0en(&self) -> Tp0enR {
        Tp0enR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Tamper 0 event trigger edge for RTC_TAMP0 input"]
    #[inline(always)]
    pub fn tp0eg(&self) -> Tp0egR {
        Tp0egR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Tamper detection interrupt enable"]
    #[inline(always)]
    pub fn tpie(&self) -> TpieR {
        TpieR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Tamper 1 detection enable"]
    #[inline(always)]
    pub fn tp1en(&self) -> Tp1enR {
        Tp1enR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Tamper 1 event trigger edge for RTC_TAMP1 input"]
    #[inline(always)]
    pub fn tp1eg(&self) -> Tp1egR {
        Tp1egR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 7 - Make tamper function used for timestamp function"]
    #[inline(always)]
    pub fn tpts(&self) -> TptsR {
        TptsR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 8:10 - Sample frequency of tamper event detection"]
    #[inline(always)]
    pub fn freq(&self) -> FreqR {
        FreqR::new(((self.bits >> 8) & 7) as u8)
    }
    #[doc = "Bits 11:12 - RTC_TAMPx filter count setting"]
    #[inline(always)]
    pub fn flt(&self) -> FltR {
        FltR::new(((self.bits >> 11) & 3) as u8)
    }
    #[doc = "Bits 13:14 - Precharge duration time of RTC_TAMPx"]
    #[inline(always)]
    pub fn prch(&self) -> PrchR {
        PrchR::new(((self.bits >> 13) & 3) as u8)
    }
    #[doc = "Bit 15 - RTC_TAMPx pull up disable bit"]
    #[inline(always)]
    pub fn dispu(&self) -> DispuR {
        DispuR::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 18 - Alarm output type control/PC13 output value"]
    #[inline(always)]
    pub fn pc13val(&self) -> Pc13valR {
        Pc13valR::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - PC13 mode"]
    #[inline(always)]
    pub fn pc13mde(&self) -> Pc13mdeR {
        Pc13mdeR::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - PC14 value"]
    #[inline(always)]
    pub fn pc14val(&self) -> Pc14valR {
        Pc14valR::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - PC14 mode"]
    #[inline(always)]
    pub fn pc14mde(&self) -> Pc14mdeR {
        Pc14mdeR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - PC15 value"]
    #[inline(always)]
    pub fn pc15val(&self) -> Pc15valR {
        Pc15valR::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - PC15 mode"]
    #[inline(always)]
    pub fn pc15mde(&self) -> Pc15mdeR {
        Pc15mdeR::new(((self.bits >> 23) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - RTC_TAMP1 input detection enable"]
    #[inline(always)]
    #[must_use]
    pub fn tp0en(&mut self) -> Tp0enW<TampSpec> {
        Tp0enW::new(self, 0)
    }
    #[doc = "Bit 1 - Tamper 0 event trigger edge for RTC_TAMP0 input"]
    #[inline(always)]
    #[must_use]
    pub fn tp0eg(&mut self) -> Tp0egW<TampSpec> {
        Tp0egW::new(self, 1)
    }
    #[doc = "Bit 2 - Tamper detection interrupt enable"]
    #[inline(always)]
    #[must_use]
    pub fn tpie(&mut self) -> TpieW<TampSpec> {
        TpieW::new(self, 2)
    }
    #[doc = "Bit 3 - Tamper 1 detection enable"]
    #[inline(always)]
    #[must_use]
    pub fn tp1en(&mut self) -> Tp1enW<TampSpec> {
        Tp1enW::new(self, 3)
    }
    #[doc = "Bit 4 - Tamper 1 event trigger edge for RTC_TAMP1 input"]
    #[inline(always)]
    #[must_use]
    pub fn tp1eg(&mut self) -> Tp1egW<TampSpec> {
        Tp1egW::new(self, 4)
    }
    #[doc = "Bit 7 - Make tamper function used for timestamp function"]
    #[inline(always)]
    #[must_use]
    pub fn tpts(&mut self) -> TptsW<TampSpec> {
        TptsW::new(self, 7)
    }
    #[doc = "Bits 8:10 - Sample frequency of tamper event detection"]
    #[inline(always)]
    #[must_use]
    pub fn freq(&mut self) -> FreqW<TampSpec> {
        FreqW::new(self, 8)
    }
    #[doc = "Bits 11:12 - RTC_TAMPx filter count setting"]
    #[inline(always)]
    #[must_use]
    pub fn flt(&mut self) -> FltW<TampSpec> {
        FltW::new(self, 11)
    }
    #[doc = "Bits 13:14 - Precharge duration time of RTC_TAMPx"]
    #[inline(always)]
    #[must_use]
    pub fn prch(&mut self) -> PrchW<TampSpec> {
        PrchW::new(self, 13)
    }
    #[doc = "Bit 15 - RTC_TAMPx pull up disable bit"]
    #[inline(always)]
    #[must_use]
    pub fn dispu(&mut self) -> DispuW<TampSpec> {
        DispuW::new(self, 15)
    }
    #[doc = "Bit 18 - Alarm output type control/PC13 output value"]
    #[inline(always)]
    #[must_use]
    pub fn pc13val(&mut self) -> Pc13valW<TampSpec> {
        Pc13valW::new(self, 18)
    }
    #[doc = "Bit 19 - PC13 mode"]
    #[inline(always)]
    #[must_use]
    pub fn pc13mde(&mut self) -> Pc13mdeW<TampSpec> {
        Pc13mdeW::new(self, 19)
    }
    #[doc = "Bit 20 - PC14 value"]
    #[inline(always)]
    #[must_use]
    pub fn pc14val(&mut self) -> Pc14valW<TampSpec> {
        Pc14valW::new(self, 20)
    }
    #[doc = "Bit 21 - PC14 mode"]
    #[inline(always)]
    #[must_use]
    pub fn pc14mde(&mut self) -> Pc14mdeW<TampSpec> {
        Pc14mdeW::new(self, 21)
    }
    #[doc = "Bit 22 - PC15 value"]
    #[inline(always)]
    #[must_use]
    pub fn pc15val(&mut self) -> Pc15valW<TampSpec> {
        Pc15valW::new(self, 22)
    }
    #[doc = "Bit 23 - PC15 mode"]
    #[inline(always)]
    #[must_use]
    pub fn pc15mde(&mut self) -> Pc15mdeW<TampSpec> {
        Pc15mdeW::new(self, 23)
    }
}
#[doc = "Tamper register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tamp::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 [`tamp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct TampSpec;
impl crate::RegisterSpec for TampSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`tamp::R`](R) reader structure"]
impl crate::Readable for TampSpec {}
#[doc = "`write(|w| ..)` method takes [`tamp::W`](W) writer structure"]
impl crate::Writable for TampSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets TAMP to value 0"]
impl crate::Resettable for TampSpec {
    const RESET_VALUE: u32 = 0;
}