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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
#[doc = "Register `EXTISS0` reader"]
pub type R = crate::R<Extiss0Spec>;
#[doc = "Register `EXTISS0` writer"]
pub type W = crate::W<Extiss0Spec>;
#[doc = "EXTI 0 sources selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Exti0Ss {
    #[doc = "0: PA0 pin"]
    Pa0 = 0,
    #[doc = "1: PB0 pin"]
    Pb0 = 1,
    #[doc = "2: PC0 pin"]
    Pc0 = 2,
    #[doc = "5: PF0 pin"]
    Pf0 = 5,
}
impl From<Exti0Ss> for u8 {
    #[inline(always)]
    fn from(variant: Exti0Ss) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Exti0Ss {
    type Ux = u8;
}
#[doc = "Field `EXTI0_SS` reader - EXTI 0 sources selection"]
pub type Exti0SsR = crate::FieldReader<Exti0Ss>;
impl Exti0SsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Exti0Ss> {
        match self.bits {
            0 => Some(Exti0Ss::Pa0),
            1 => Some(Exti0Ss::Pb0),
            2 => Some(Exti0Ss::Pc0),
            5 => Some(Exti0Ss::Pf0),
            _ => None,
        }
    }
    #[doc = "PA0 pin"]
    #[inline(always)]
    pub fn is_pa0(&self) -> bool {
        *self == Exti0Ss::Pa0
    }
    #[doc = "PB0 pin"]
    #[inline(always)]
    pub fn is_pb0(&self) -> bool {
        *self == Exti0Ss::Pb0
    }
    #[doc = "PC0 pin"]
    #[inline(always)]
    pub fn is_pc0(&self) -> bool {
        *self == Exti0Ss::Pc0
    }
    #[doc = "PF0 pin"]
    #[inline(always)]
    pub fn is_pf0(&self) -> bool {
        *self == Exti0Ss::Pf0
    }
}
#[doc = "Field `EXTI0_SS` writer - EXTI 0 sources selection"]
pub type Exti0SsW<'a, REG> = crate::FieldWriter<'a, REG, 4, Exti0Ss>;
impl<'a, REG> Exti0SsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PA0 pin"]
    #[inline(always)]
    pub fn pa0(self) -> &'a mut crate::W<REG> {
        self.variant(Exti0Ss::Pa0)
    }
    #[doc = "PB0 pin"]
    #[inline(always)]
    pub fn pb0(self) -> &'a mut crate::W<REG> {
        self.variant(Exti0Ss::Pb0)
    }
    #[doc = "PC0 pin"]
    #[inline(always)]
    pub fn pc0(self) -> &'a mut crate::W<REG> {
        self.variant(Exti0Ss::Pc0)
    }
    #[doc = "PF0 pin"]
    #[inline(always)]
    pub fn pf0(self) -> &'a mut crate::W<REG> {
        self.variant(Exti0Ss::Pf0)
    }
}
#[doc = "EXTI 1 sources selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Exti1Ss {
    #[doc = "0: PA1 pin"]
    Pa1 = 0,
    #[doc = "1: PB1 pin"]
    Pb1 = 1,
    #[doc = "2: PC1 pin"]
    Pc1 = 2,
    #[doc = "5: PF1 pin"]
    Pf1 = 5,
}
impl From<Exti1Ss> for u8 {
    #[inline(always)]
    fn from(variant: Exti1Ss) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Exti1Ss {
    type Ux = u8;
}
#[doc = "Field `EXTI1_SS` reader - EXTI 1 sources selection"]
pub type Exti1SsR = crate::FieldReader<Exti1Ss>;
impl Exti1SsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Exti1Ss> {
        match self.bits {
            0 => Some(Exti1Ss::Pa1),
            1 => Some(Exti1Ss::Pb1),
            2 => Some(Exti1Ss::Pc1),
            5 => Some(Exti1Ss::Pf1),
            _ => None,
        }
    }
    #[doc = "PA1 pin"]
    #[inline(always)]
    pub fn is_pa1(&self) -> bool {
        *self == Exti1Ss::Pa1
    }
    #[doc = "PB1 pin"]
    #[inline(always)]
    pub fn is_pb1(&self) -> bool {
        *self == Exti1Ss::Pb1
    }
    #[doc = "PC1 pin"]
    #[inline(always)]
    pub fn is_pc1(&self) -> bool {
        *self == Exti1Ss::Pc1
    }
    #[doc = "PF1 pin"]
    #[inline(always)]
    pub fn is_pf1(&self) -> bool {
        *self == Exti1Ss::Pf1
    }
}
#[doc = "Field `EXTI1_SS` writer - EXTI 1 sources selection"]
pub type Exti1SsW<'a, REG> = crate::FieldWriter<'a, REG, 4, Exti1Ss>;
impl<'a, REG> Exti1SsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PA1 pin"]
    #[inline(always)]
    pub fn pa1(self) -> &'a mut crate::W<REG> {
        self.variant(Exti1Ss::Pa1)
    }
    #[doc = "PB1 pin"]
    #[inline(always)]
    pub fn pb1(self) -> &'a mut crate::W<REG> {
        self.variant(Exti1Ss::Pb1)
    }
    #[doc = "PC1 pin"]
    #[inline(always)]
    pub fn pc1(self) -> &'a mut crate::W<REG> {
        self.variant(Exti1Ss::Pc1)
    }
    #[doc = "PF1 pin"]
    #[inline(always)]
    pub fn pf1(self) -> &'a mut crate::W<REG> {
        self.variant(Exti1Ss::Pf1)
    }
}
#[doc = "EXTI 2 sources selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Exti2Ss {
    #[doc = "0: PA2 pin"]
    Pa2 = 0,
    #[doc = "1: PB2 pin"]
    Pb2 = 1,
    #[doc = "2: PC2 pin"]
    Pc2 = 2,
    #[doc = "3: PD2 pin"]
    Pd2 = 3,
}
impl From<Exti2Ss> for u8 {
    #[inline(always)]
    fn from(variant: Exti2Ss) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Exti2Ss {
    type Ux = u8;
}
#[doc = "Field `EXTI2_SS` reader - EXTI 2 sources selection"]
pub type Exti2SsR = crate::FieldReader<Exti2Ss>;
impl Exti2SsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Exti2Ss> {
        match self.bits {
            0 => Some(Exti2Ss::Pa2),
            1 => Some(Exti2Ss::Pb2),
            2 => Some(Exti2Ss::Pc2),
            3 => Some(Exti2Ss::Pd2),
            _ => None,
        }
    }
    #[doc = "PA2 pin"]
    #[inline(always)]
    pub fn is_pa2(&self) -> bool {
        *self == Exti2Ss::Pa2
    }
    #[doc = "PB2 pin"]
    #[inline(always)]
    pub fn is_pb2(&self) -> bool {
        *self == Exti2Ss::Pb2
    }
    #[doc = "PC2 pin"]
    #[inline(always)]
    pub fn is_pc2(&self) -> bool {
        *self == Exti2Ss::Pc2
    }
    #[doc = "PD2 pin"]
    #[inline(always)]
    pub fn is_pd2(&self) -> bool {
        *self == Exti2Ss::Pd2
    }
}
#[doc = "Field `EXTI2_SS` writer - EXTI 2 sources selection"]
pub type Exti2SsW<'a, REG> = crate::FieldWriter<'a, REG, 4, Exti2Ss>;
impl<'a, REG> Exti2SsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PA2 pin"]
    #[inline(always)]
    pub fn pa2(self) -> &'a mut crate::W<REG> {
        self.variant(Exti2Ss::Pa2)
    }
    #[doc = "PB2 pin"]
    #[inline(always)]
    pub fn pb2(self) -> &'a mut crate::W<REG> {
        self.variant(Exti2Ss::Pb2)
    }
    #[doc = "PC2 pin"]
    #[inline(always)]
    pub fn pc2(self) -> &'a mut crate::W<REG> {
        self.variant(Exti2Ss::Pc2)
    }
    #[doc = "PD2 pin"]
    #[inline(always)]
    pub fn pd2(self) -> &'a mut crate::W<REG> {
        self.variant(Exti2Ss::Pd2)
    }
}
#[doc = "EXTI 3 sources selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Exti3Ss {
    #[doc = "0: PA3 pin"]
    Pa3 = 0,
    #[doc = "1: PB3 pin"]
    Pb3 = 1,
    #[doc = "2: PC3 pin"]
    Pc3 = 2,
}
impl From<Exti3Ss> for u8 {
    #[inline(always)]
    fn from(variant: Exti3Ss) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Exti3Ss {
    type Ux = u8;
}
#[doc = "Field `EXTI3_SS` reader - EXTI 3 sources selection"]
pub type Exti3SsR = crate::FieldReader<Exti3Ss>;
impl Exti3SsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Exti3Ss> {
        match self.bits {
            0 => Some(Exti3Ss::Pa3),
            1 => Some(Exti3Ss::Pb3),
            2 => Some(Exti3Ss::Pc3),
            _ => None,
        }
    }
    #[doc = "PA3 pin"]
    #[inline(always)]
    pub fn is_pa3(&self) -> bool {
        *self == Exti3Ss::Pa3
    }
    #[doc = "PB3 pin"]
    #[inline(always)]
    pub fn is_pb3(&self) -> bool {
        *self == Exti3Ss::Pb3
    }
    #[doc = "PC3 pin"]
    #[inline(always)]
    pub fn is_pc3(&self) -> bool {
        *self == Exti3Ss::Pc3
    }
}
#[doc = "Field `EXTI3_SS` writer - EXTI 3 sources selection"]
pub type Exti3SsW<'a, REG> = crate::FieldWriter<'a, REG, 4, Exti3Ss>;
impl<'a, REG> Exti3SsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PA3 pin"]
    #[inline(always)]
    pub fn pa3(self) -> &'a mut crate::W<REG> {
        self.variant(Exti3Ss::Pa3)
    }
    #[doc = "PB3 pin"]
    #[inline(always)]
    pub fn pb3(self) -> &'a mut crate::W<REG> {
        self.variant(Exti3Ss::Pb3)
    }
    #[doc = "PC3 pin"]
    #[inline(always)]
    pub fn pc3(self) -> &'a mut crate::W<REG> {
        self.variant(Exti3Ss::Pc3)
    }
}
impl R {
    #[doc = "Bits 0:3 - EXTI 0 sources selection"]
    #[inline(always)]
    pub fn exti0_ss(&self) -> Exti0SsR {
        Exti0SsR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bits 4:7 - EXTI 1 sources selection"]
    #[inline(always)]
    pub fn exti1_ss(&self) -> Exti1SsR {
        Exti1SsR::new(((self.bits >> 4) & 0x0f) as u8)
    }
    #[doc = "Bits 8:11 - EXTI 2 sources selection"]
    #[inline(always)]
    pub fn exti2_ss(&self) -> Exti2SsR {
        Exti2SsR::new(((self.bits >> 8) & 0x0f) as u8)
    }
    #[doc = "Bits 12:15 - EXTI 3 sources selection"]
    #[inline(always)]
    pub fn exti3_ss(&self) -> Exti3SsR {
        Exti3SsR::new(((self.bits >> 12) & 0x0f) as u8)
    }
}
impl W {
    #[doc = "Bits 0:3 - EXTI 0 sources selection"]
    #[inline(always)]
    #[must_use]
    pub fn exti0_ss(&mut self) -> Exti0SsW<Extiss0Spec> {
        Exti0SsW::new(self, 0)
    }
    #[doc = "Bits 4:7 - EXTI 1 sources selection"]
    #[inline(always)]
    #[must_use]
    pub fn exti1_ss(&mut self) -> Exti1SsW<Extiss0Spec> {
        Exti1SsW::new(self, 4)
    }
    #[doc = "Bits 8:11 - EXTI 2 sources selection"]
    #[inline(always)]
    #[must_use]
    pub fn exti2_ss(&mut self) -> Exti2SsW<Extiss0Spec> {
        Exti2SsW::new(self, 8)
    }
    #[doc = "Bits 12:15 - EXTI 3 sources selection"]
    #[inline(always)]
    #[must_use]
    pub fn exti3_ss(&mut self) -> Exti3SsW<Extiss0Spec> {
        Exti3SsW::new(self, 12)
    }
}
#[doc = "EXTI sources selection register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`extiss0::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 [`extiss0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Extiss0Spec;
impl crate::RegisterSpec for Extiss0Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`extiss0::R`](R) reader structure"]
impl crate::Readable for Extiss0Spec {}
#[doc = "`write(|w| ..)` method takes [`extiss0::W`](W) writer structure"]
impl crate::Writable for Extiss0Spec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets EXTISS0 to value 0"]
impl crate::Resettable for Extiss0Spec {
    const RESET_VALUE: u32 = 0;
}