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
#[doc = "Register `SYNC_LATCH_CONFIG` reader"]
pub type R = crate::R<SYNC_LATCH_CONFIG_SPEC>;
#[doc = "SYNC0 output driver/polarity\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SYNC0_POL_A {
    #[doc = "0: Push-Pull active low"]
    VALUE1 = 0,
    #[doc = "1: Open Drain (active low)"]
    VALUE2 = 1,
    #[doc = "2: Push-Pull active high"]
    VALUE3 = 2,
    #[doc = "3: Open Source (active high)"]
    VALUE4 = 3,
}
impl From<SYNC0_POL_A> for u8 {
    #[inline(always)]
    fn from(variant: SYNC0_POL_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SYNC0_POL_A {
    type Ux = u8;
}
impl crate::IsEnum for SYNC0_POL_A {}
#[doc = "Field `SYNC0_POL` reader - SYNC0 output driver/polarity"]
pub type SYNC0_POL_R = crate::FieldReader<SYNC0_POL_A>;
impl SYNC0_POL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SYNC0_POL_A {
        match self.bits {
            0 => SYNC0_POL_A::VALUE1,
            1 => SYNC0_POL_A::VALUE2,
            2 => SYNC0_POL_A::VALUE3,
            3 => SYNC0_POL_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Push-Pull active low"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SYNC0_POL_A::VALUE1
    }
    #[doc = "Open Drain (active low)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SYNC0_POL_A::VALUE2
    }
    #[doc = "Push-Pull active high"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == SYNC0_POL_A::VALUE3
    }
    #[doc = "Open Source (active high)"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == SYNC0_POL_A::VALUE4
    }
}
#[doc = "SYNC0/LATCH0 configuration\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SL0_CNF_A {
    #[doc = "0: LATCH0 Input"]
    VALUE1 = 0,
    #[doc = "1: SYNC0 Output"]
    VALUE2 = 1,
}
impl From<SL0_CNF_A> for bool {
    #[inline(always)]
    fn from(variant: SL0_CNF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SL0_CNF` reader - SYNC0/LATCH0 configuration"]
pub type SL0_CNF_R = crate::BitReader<SL0_CNF_A>;
impl SL0_CNF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SL0_CNF_A {
        match self.bits {
            false => SL0_CNF_A::VALUE1,
            true => SL0_CNF_A::VALUE2,
        }
    }
    #[doc = "LATCH0 Input"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SL0_CNF_A::VALUE1
    }
    #[doc = "SYNC0 Output"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SL0_CNF_A::VALUE2
    }
}
#[doc = "SYNC0 mapped to registerECAT0_AL_EVENT_REQ. ST_S0\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum S0_MAP_A {
    #[doc = "0: Disabled"]
    VALUE1 = 0,
    #[doc = "1: Enabled"]
    VALUE2 = 1,
}
impl From<S0_MAP_A> for bool {
    #[inline(always)]
    fn from(variant: S0_MAP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `S0_MAP` reader - SYNC0 mapped to registerECAT0_AL_EVENT_REQ. ST_S0"]
pub type S0_MAP_R = crate::BitReader<S0_MAP_A>;
impl S0_MAP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> S0_MAP_A {
        match self.bits {
            false => S0_MAP_A::VALUE1,
            true => S0_MAP_A::VALUE2,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == S0_MAP_A::VALUE1
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == S0_MAP_A::VALUE2
    }
}
#[doc = "SYNC1 output driver/polarity\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SYNC1_POL_A {
    #[doc = "0: Push-Pull active low"]
    VALUE1 = 0,
    #[doc = "1: Open Drain (active low)"]
    VALUE2 = 1,
    #[doc = "2: Push-Pull active high"]
    VALUE3 = 2,
    #[doc = "3: Open Source (active high)"]
    VALUE4 = 3,
}
impl From<SYNC1_POL_A> for u8 {
    #[inline(always)]
    fn from(variant: SYNC1_POL_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SYNC1_POL_A {
    type Ux = u8;
}
impl crate::IsEnum for SYNC1_POL_A {}
#[doc = "Field `SYNC1_POL` reader - SYNC1 output driver/polarity"]
pub type SYNC1_POL_R = crate::FieldReader<SYNC1_POL_A>;
impl SYNC1_POL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SYNC1_POL_A {
        match self.bits {
            0 => SYNC1_POL_A::VALUE1,
            1 => SYNC1_POL_A::VALUE2,
            2 => SYNC1_POL_A::VALUE3,
            3 => SYNC1_POL_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Push-Pull active low"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SYNC1_POL_A::VALUE1
    }
    #[doc = "Open Drain (active low)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SYNC1_POL_A::VALUE2
    }
    #[doc = "Push-Pull active high"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == SYNC1_POL_A::VALUE3
    }
    #[doc = "Open Source (active high)"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == SYNC1_POL_A::VALUE4
    }
}
#[doc = "SYNC1/LATCH1 configuration\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SL1_CNF_A {
    #[doc = "0: LATCH1 Input"]
    VALUE1 = 0,
    #[doc = "1: SYNC1 Output"]
    VALUE2 = 1,
}
impl From<SL1_CNF_A> for bool {
    #[inline(always)]
    fn from(variant: SL1_CNF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SL1_CNF` reader - SYNC1/LATCH1 configuration"]
pub type SL1_CNF_R = crate::BitReader<SL1_CNF_A>;
impl SL1_CNF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SL1_CNF_A {
        match self.bits {
            false => SL1_CNF_A::VALUE1,
            true => SL1_CNF_A::VALUE2,
        }
    }
    #[doc = "LATCH1 Input"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SL1_CNF_A::VALUE1
    }
    #[doc = "SYNC1 Output"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SL1_CNF_A::VALUE2
    }
}
#[doc = "SYNC1 mapped to registerECAT0_AL_EVENT_REQ. ST_S1\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum S1_MAP_A {
    #[doc = "0: Disabled"]
    VALUE1 = 0,
    #[doc = "1: Enabled"]
    VALUE2 = 1,
}
impl From<S1_MAP_A> for bool {
    #[inline(always)]
    fn from(variant: S1_MAP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `S1_MAP` reader - SYNC1 mapped to registerECAT0_AL_EVENT_REQ. ST_S1"]
pub type S1_MAP_R = crate::BitReader<S1_MAP_A>;
impl S1_MAP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> S1_MAP_A {
        match self.bits {
            false => S1_MAP_A::VALUE1,
            true => S1_MAP_A::VALUE2,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == S1_MAP_A::VALUE1
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == S1_MAP_A::VALUE2
    }
}
impl R {
    #[doc = "Bits 0:1 - SYNC0 output driver/polarity"]
    #[inline(always)]
    pub fn sync0_pol(&self) -> SYNC0_POL_R {
        SYNC0_POL_R::new(self.bits & 3)
    }
    #[doc = "Bit 2 - SYNC0/LATCH0 configuration"]
    #[inline(always)]
    pub fn sl0_cnf(&self) -> SL0_CNF_R {
        SL0_CNF_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - SYNC0 mapped to registerECAT0_AL_EVENT_REQ. ST_S0"]
    #[inline(always)]
    pub fn s0_map(&self) -> S0_MAP_R {
        S0_MAP_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bits 4:5 - SYNC1 output driver/polarity"]
    #[inline(always)]
    pub fn sync1_pol(&self) -> SYNC1_POL_R {
        SYNC1_POL_R::new((self.bits >> 4) & 3)
    }
    #[doc = "Bit 6 - SYNC1/LATCH1 configuration"]
    #[inline(always)]
    pub fn sl1_cnf(&self) -> SL1_CNF_R {
        SL1_CNF_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - SYNC1 mapped to registerECAT0_AL_EVENT_REQ. ST_S1"]
    #[inline(always)]
    pub fn s1_map(&self) -> S1_MAP_R {
        S1_MAP_R::new(((self.bits >> 7) & 1) != 0)
    }
}
#[doc = "Sync/Latch\\[1:0\\]
PDI Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sync_latch_config::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct SYNC_LATCH_CONFIG_SPEC;
impl crate::RegisterSpec for SYNC_LATCH_CONFIG_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [`sync_latch_config::R`](R) reader structure"]
impl crate::Readable for SYNC_LATCH_CONFIG_SPEC {}
#[doc = "`reset()` method sets SYNC_LATCH_CONFIG to value 0xee"]
impl crate::Resettable for SYNC_LATCH_CONFIG_SPEC {
    const RESET_VALUE: u8 = 0xee;
}