1#[doc = "Register `GPIO_CFGCTL3` reader"]
2pub struct R(crate::R<GPIO_CFGCTL3_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<GPIO_CFGCTL3_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<GPIO_CFGCTL3_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<GPIO_CFGCTL3_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `GPIO_CFGCTL3` writer"]
17pub struct W(crate::W<GPIO_CFGCTL3_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<GPIO_CFGCTL3_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<GPIO_CFGCTL3_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<GPIO_CFGCTL3_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `reg_gpio_6_ie` reader - Input enable for GPIO6."]
38pub type REG_GPIO_6_IE_R = crate::BitReader<GPIO6INPUT_ENABLED_A>;
39#[doc = "Input enable for GPIO6.\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum GPIO6INPUT_ENABLED_A {
42 #[doc = "0: `0`"]
43 DISABLED = 0,
44 #[doc = "1: `1`"]
45 ENABLED = 1,
46}
47impl From<GPIO6INPUT_ENABLED_A> for bool {
48 #[inline(always)]
49 fn from(variant: GPIO6INPUT_ENABLED_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl REG_GPIO_6_IE_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> GPIO6INPUT_ENABLED_A {
57 match self.bits {
58 false => GPIO6INPUT_ENABLED_A::DISABLED,
59 true => GPIO6INPUT_ENABLED_A::ENABLED,
60 }
61 }
62 #[doc = "Checks if the value of the field is `DISABLED`"]
63 #[inline(always)]
64 pub fn is_disabled(&self) -> bool {
65 *self == GPIO6INPUT_ENABLED_A::DISABLED
66 }
67 #[doc = "Checks if the value of the field is `ENABLED`"]
68 #[inline(always)]
69 pub fn is_enabled(&self) -> bool {
70 *self == GPIO6INPUT_ENABLED_A::ENABLED
71 }
72}
73#[doc = "Field `reg_gpio_6_ie` writer - Input enable for GPIO6."]
74pub type REG_GPIO_6_IE_W<'a, const O: u8> =
75 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO6INPUT_ENABLED_A, O>;
76impl<'a, const O: u8> REG_GPIO_6_IE_W<'a, O> {
77 #[doc = "`0`"]
78 #[inline(always)]
79 pub fn disabled(self) -> &'a mut W {
80 self.variant(GPIO6INPUT_ENABLED_A::DISABLED)
81 }
82 #[doc = "`1`"]
83 #[inline(always)]
84 pub fn enabled(self) -> &'a mut W {
85 self.variant(GPIO6INPUT_ENABLED_A::ENABLED)
86 }
87}
88#[doc = "Field `reg_gpio_6_smt` reader - Schmitt trigger enabled for GPIO6."]
89pub type REG_GPIO_6_SMT_R = crate::BitReader<GPIO6SCHMITT_A>;
90#[doc = "Schmitt trigger enabled for GPIO6.\n\nValue on reset: 1"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum GPIO6SCHMITT_A {
93 #[doc = "0: `0`"]
94 DISABLED = 0,
95 #[doc = "1: `1`"]
96 ENABLED = 1,
97}
98impl From<GPIO6SCHMITT_A> for bool {
99 #[inline(always)]
100 fn from(variant: GPIO6SCHMITT_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl REG_GPIO_6_SMT_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> GPIO6SCHMITT_A {
108 match self.bits {
109 false => GPIO6SCHMITT_A::DISABLED,
110 true => GPIO6SCHMITT_A::ENABLED,
111 }
112 }
113 #[doc = "Checks if the value of the field is `DISABLED`"]
114 #[inline(always)]
115 pub fn is_disabled(&self) -> bool {
116 *self == GPIO6SCHMITT_A::DISABLED
117 }
118 #[doc = "Checks if the value of the field is `ENABLED`"]
119 #[inline(always)]
120 pub fn is_enabled(&self) -> bool {
121 *self == GPIO6SCHMITT_A::ENABLED
122 }
123}
124#[doc = "Field `reg_gpio_6_smt` writer - Schmitt trigger enabled for GPIO6."]
125pub type REG_GPIO_6_SMT_W<'a, const O: u8> =
126 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO6SCHMITT_A, O>;
127impl<'a, const O: u8> REG_GPIO_6_SMT_W<'a, O> {
128 #[doc = "`0`"]
129 #[inline(always)]
130 pub fn disabled(self) -> &'a mut W {
131 self.variant(GPIO6SCHMITT_A::DISABLED)
132 }
133 #[doc = "`1`"]
134 #[inline(always)]
135 pub fn enabled(self) -> &'a mut W {
136 self.variant(GPIO6SCHMITT_A::ENABLED)
137 }
138}
139#[doc = "Field `reg_gpio_6_drv` reader - Driving control enabled for GPIO6."]
140pub type REG_GPIO_6_DRV_R = crate::FieldReader<u8, GPIO6DRIVING_A>;
141#[doc = "Driving control enabled for GPIO6.\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143#[repr(u8)]
144pub enum GPIO6DRIVING_A {
145 #[doc = "0: `0`"]
146 DISABLED = 0,
147 #[doc = "1: `1`"]
148 ENABLED = 1,
149}
150impl From<GPIO6DRIVING_A> for u8 {
151 #[inline(always)]
152 fn from(variant: GPIO6DRIVING_A) -> Self {
153 variant as _
154 }
155}
156impl REG_GPIO_6_DRV_R {
157 #[doc = "Get enumerated values variant"]
158 #[inline(always)]
159 pub fn variant(&self) -> Option<GPIO6DRIVING_A> {
160 match self.bits {
161 0 => Some(GPIO6DRIVING_A::DISABLED),
162 1 => Some(GPIO6DRIVING_A::ENABLED),
163 _ => None,
164 }
165 }
166 #[doc = "Checks if the value of the field is `DISABLED`"]
167 #[inline(always)]
168 pub fn is_disabled(&self) -> bool {
169 *self == GPIO6DRIVING_A::DISABLED
170 }
171 #[doc = "Checks if the value of the field is `ENABLED`"]
172 #[inline(always)]
173 pub fn is_enabled(&self) -> bool {
174 *self == GPIO6DRIVING_A::ENABLED
175 }
176}
177#[doc = "Field `reg_gpio_6_drv` writer - Driving control enabled for GPIO6."]
178pub type REG_GPIO_6_DRV_W<'a, const O: u8> =
179 crate::FieldWriter<'a, u32, GPIO_CFGCTL3_SPEC, u8, GPIO6DRIVING_A, 2, O>;
180impl<'a, const O: u8> REG_GPIO_6_DRV_W<'a, O> {
181 #[doc = "`0`"]
182 #[inline(always)]
183 pub fn disabled(self) -> &'a mut W {
184 self.variant(GPIO6DRIVING_A::DISABLED)
185 }
186 #[doc = "`1`"]
187 #[inline(always)]
188 pub fn enabled(self) -> &'a mut W {
189 self.variant(GPIO6DRIVING_A::ENABLED)
190 }
191}
192#[doc = "Field `reg_gpio_6_pu` reader - Pull Up Resistor for GPIO6."]
193pub type REG_GPIO_6_PU_R = crate::BitReader<GPIO6PULL_UP_RESISTOR_A>;
194#[doc = "Pull Up Resistor for GPIO6.\n\nValue on reset: 0"]
195#[derive(Clone, Copy, Debug, PartialEq, Eq)]
196pub enum GPIO6PULL_UP_RESISTOR_A {
197 #[doc = "0: `0`"]
198 DISABLED = 0,
199 #[doc = "1: `1`"]
200 ENABLED = 1,
201}
202impl From<GPIO6PULL_UP_RESISTOR_A> for bool {
203 #[inline(always)]
204 fn from(variant: GPIO6PULL_UP_RESISTOR_A) -> Self {
205 variant as u8 != 0
206 }
207}
208impl REG_GPIO_6_PU_R {
209 #[doc = "Get enumerated values variant"]
210 #[inline(always)]
211 pub fn variant(&self) -> GPIO6PULL_UP_RESISTOR_A {
212 match self.bits {
213 false => GPIO6PULL_UP_RESISTOR_A::DISABLED,
214 true => GPIO6PULL_UP_RESISTOR_A::ENABLED,
215 }
216 }
217 #[doc = "Checks if the value of the field is `DISABLED`"]
218 #[inline(always)]
219 pub fn is_disabled(&self) -> bool {
220 *self == GPIO6PULL_UP_RESISTOR_A::DISABLED
221 }
222 #[doc = "Checks if the value of the field is `ENABLED`"]
223 #[inline(always)]
224 pub fn is_enabled(&self) -> bool {
225 *self == GPIO6PULL_UP_RESISTOR_A::ENABLED
226 }
227}
228#[doc = "Field `reg_gpio_6_pu` writer - Pull Up Resistor for GPIO6."]
229pub type REG_GPIO_6_PU_W<'a, const O: u8> =
230 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO6PULL_UP_RESISTOR_A, O>;
231impl<'a, const O: u8> REG_GPIO_6_PU_W<'a, O> {
232 #[doc = "`0`"]
233 #[inline(always)]
234 pub fn disabled(self) -> &'a mut W {
235 self.variant(GPIO6PULL_UP_RESISTOR_A::DISABLED)
236 }
237 #[doc = "`1`"]
238 #[inline(always)]
239 pub fn enabled(self) -> &'a mut W {
240 self.variant(GPIO6PULL_UP_RESISTOR_A::ENABLED)
241 }
242}
243#[doc = "Field `reg_gpio_6_pd` reader - Pull Down Resistor for GPIO6."]
244pub type REG_GPIO_6_PD_R = crate::BitReader<GPIO6PULL_DOWN_RESISTOR_A>;
245#[doc = "Pull Down Resistor for GPIO6.\n\nValue on reset: 0"]
246#[derive(Clone, Copy, Debug, PartialEq, Eq)]
247pub enum GPIO6PULL_DOWN_RESISTOR_A {
248 #[doc = "0: `0`"]
249 DISABLED = 0,
250 #[doc = "1: `1`"]
251 ENABLED = 1,
252}
253impl From<GPIO6PULL_DOWN_RESISTOR_A> for bool {
254 #[inline(always)]
255 fn from(variant: GPIO6PULL_DOWN_RESISTOR_A) -> Self {
256 variant as u8 != 0
257 }
258}
259impl REG_GPIO_6_PD_R {
260 #[doc = "Get enumerated values variant"]
261 #[inline(always)]
262 pub fn variant(&self) -> GPIO6PULL_DOWN_RESISTOR_A {
263 match self.bits {
264 false => GPIO6PULL_DOWN_RESISTOR_A::DISABLED,
265 true => GPIO6PULL_DOWN_RESISTOR_A::ENABLED,
266 }
267 }
268 #[doc = "Checks if the value of the field is `DISABLED`"]
269 #[inline(always)]
270 pub fn is_disabled(&self) -> bool {
271 *self == GPIO6PULL_DOWN_RESISTOR_A::DISABLED
272 }
273 #[doc = "Checks if the value of the field is `ENABLED`"]
274 #[inline(always)]
275 pub fn is_enabled(&self) -> bool {
276 *self == GPIO6PULL_DOWN_RESISTOR_A::ENABLED
277 }
278}
279#[doc = "Field `reg_gpio_6_pd` writer - Pull Down Resistor for GPIO6."]
280pub type REG_GPIO_6_PD_W<'a, const O: u8> =
281 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO6PULL_DOWN_RESISTOR_A, O>;
282impl<'a, const O: u8> REG_GPIO_6_PD_W<'a, O> {
283 #[doc = "`0`"]
284 #[inline(always)]
285 pub fn disabled(self) -> &'a mut W {
286 self.variant(GPIO6PULL_DOWN_RESISTOR_A::DISABLED)
287 }
288 #[doc = "`1`"]
289 #[inline(always)]
290 pub fn enabled(self) -> &'a mut W {
291 self.variant(GPIO6PULL_DOWN_RESISTOR_A::ENABLED)
292 }
293}
294#[doc = "Field `reg_gpio_6_func_sel` reader - Function select for GPIO6."]
295pub type REG_GPIO_6_FUNC_SEL_R = crate::FieldReader<u8, GPIO6FUNCTION_SELECT_A>;
296#[doc = "Function select for GPIO6.\n\nValue on reset: 11"]
297#[derive(Clone, Copy, Debug, PartialEq, Eq)]
298#[repr(u8)]
299pub enum GPIO6FUNCTION_SELECT_A {
300 #[doc = "4: `100`"]
301 SPI_SS = 4,
302 #[doc = "6: `110`"]
303 I2C_SCL = 6,
304 #[doc = "7: `111`"]
305 UART_SIG6 = 7,
306 #[doc = "8: `1000`"]
307 PWM_CH1 = 8,
308 #[doc = "9: `1001`"]
309 FEM_GPIO_2 = 9,
310 #[doc = "10: `1010`"]
311 GPIP_CH5 = 10,
312 #[doc = "11: `1011`"]
313 SWGPIO_6 = 11,
314 #[doc = "14: `1110`"]
315 E21_TCK = 14,
316}
317impl From<GPIO6FUNCTION_SELECT_A> for u8 {
318 #[inline(always)]
319 fn from(variant: GPIO6FUNCTION_SELECT_A) -> Self {
320 variant as _
321 }
322}
323impl REG_GPIO_6_FUNC_SEL_R {
324 #[doc = "Get enumerated values variant"]
325 #[inline(always)]
326 pub fn variant(&self) -> Option<GPIO6FUNCTION_SELECT_A> {
327 match self.bits {
328 4 => Some(GPIO6FUNCTION_SELECT_A::SPI_SS),
329 6 => Some(GPIO6FUNCTION_SELECT_A::I2C_SCL),
330 7 => Some(GPIO6FUNCTION_SELECT_A::UART_SIG6),
331 8 => Some(GPIO6FUNCTION_SELECT_A::PWM_CH1),
332 9 => Some(GPIO6FUNCTION_SELECT_A::FEM_GPIO_2),
333 10 => Some(GPIO6FUNCTION_SELECT_A::GPIP_CH5),
334 11 => Some(GPIO6FUNCTION_SELECT_A::SWGPIO_6),
335 14 => Some(GPIO6FUNCTION_SELECT_A::E21_TCK),
336 _ => None,
337 }
338 }
339 #[doc = "Checks if the value of the field is `SPI_SS`"]
340 #[inline(always)]
341 pub fn is_spi_ss(&self) -> bool {
342 *self == GPIO6FUNCTION_SELECT_A::SPI_SS
343 }
344 #[doc = "Checks if the value of the field is `I2C_SCL`"]
345 #[inline(always)]
346 pub fn is_i2c_scl(&self) -> bool {
347 *self == GPIO6FUNCTION_SELECT_A::I2C_SCL
348 }
349 #[doc = "Checks if the value of the field is `UART_SIG6`"]
350 #[inline(always)]
351 pub fn is_uart_sig6(&self) -> bool {
352 *self == GPIO6FUNCTION_SELECT_A::UART_SIG6
353 }
354 #[doc = "Checks if the value of the field is `PWM_CH1`"]
355 #[inline(always)]
356 pub fn is_pwm_ch1(&self) -> bool {
357 *self == GPIO6FUNCTION_SELECT_A::PWM_CH1
358 }
359 #[doc = "Checks if the value of the field is `FEM_GPIO_2`"]
360 #[inline(always)]
361 pub fn is_fem_gpio_2(&self) -> bool {
362 *self == GPIO6FUNCTION_SELECT_A::FEM_GPIO_2
363 }
364 #[doc = "Checks if the value of the field is `GPIP_CH5`"]
365 #[inline(always)]
366 pub fn is_gpip_ch5(&self) -> bool {
367 *self == GPIO6FUNCTION_SELECT_A::GPIP_CH5
368 }
369 #[doc = "Checks if the value of the field is `SWGPIO_6`"]
370 #[inline(always)]
371 pub fn is_swgpio_6(&self) -> bool {
372 *self == GPIO6FUNCTION_SELECT_A::SWGPIO_6
373 }
374 #[doc = "Checks if the value of the field is `E21_TCK`"]
375 #[inline(always)]
376 pub fn is_e21_tck(&self) -> bool {
377 *self == GPIO6FUNCTION_SELECT_A::E21_TCK
378 }
379}
380#[doc = "Field `reg_gpio_6_func_sel` writer - Function select for GPIO6."]
381pub type REG_GPIO_6_FUNC_SEL_W<'a, const O: u8> =
382 crate::FieldWriter<'a, u32, GPIO_CFGCTL3_SPEC, u8, GPIO6FUNCTION_SELECT_A, 4, O>;
383impl<'a, const O: u8> REG_GPIO_6_FUNC_SEL_W<'a, O> {
384 #[doc = "`100`"]
385 #[inline(always)]
386 pub fn spi_ss(self) -> &'a mut W {
387 self.variant(GPIO6FUNCTION_SELECT_A::SPI_SS)
388 }
389 #[doc = "`110`"]
390 #[inline(always)]
391 pub fn i2c_scl(self) -> &'a mut W {
392 self.variant(GPIO6FUNCTION_SELECT_A::I2C_SCL)
393 }
394 #[doc = "`111`"]
395 #[inline(always)]
396 pub fn uart_sig6(self) -> &'a mut W {
397 self.variant(GPIO6FUNCTION_SELECT_A::UART_SIG6)
398 }
399 #[doc = "`1000`"]
400 #[inline(always)]
401 pub fn pwm_ch1(self) -> &'a mut W {
402 self.variant(GPIO6FUNCTION_SELECT_A::PWM_CH1)
403 }
404 #[doc = "`1001`"]
405 #[inline(always)]
406 pub fn fem_gpio_2(self) -> &'a mut W {
407 self.variant(GPIO6FUNCTION_SELECT_A::FEM_GPIO_2)
408 }
409 #[doc = "`1010`"]
410 #[inline(always)]
411 pub fn gpip_ch5(self) -> &'a mut W {
412 self.variant(GPIO6FUNCTION_SELECT_A::GPIP_CH5)
413 }
414 #[doc = "`1011`"]
415 #[inline(always)]
416 pub fn swgpio_6(self) -> &'a mut W {
417 self.variant(GPIO6FUNCTION_SELECT_A::SWGPIO_6)
418 }
419 #[doc = "`1110`"]
420 #[inline(always)]
421 pub fn e21_tck(self) -> &'a mut W {
422 self.variant(GPIO6FUNCTION_SELECT_A::E21_TCK)
423 }
424}
425#[doc = "Field `reg_gpio_7_ie` reader - Input enable for GPIO7."]
426pub type REG_GPIO_7_IE_R = crate::BitReader<GPIO7INPUT_ENABLED_A>;
427#[doc = "Input enable for GPIO7.\n\nValue on reset: 1"]
428#[derive(Clone, Copy, Debug, PartialEq, Eq)]
429pub enum GPIO7INPUT_ENABLED_A {
430 #[doc = "0: `0`"]
431 DISABLED = 0,
432 #[doc = "1: `1`"]
433 ENABLED = 1,
434}
435impl From<GPIO7INPUT_ENABLED_A> for bool {
436 #[inline(always)]
437 fn from(variant: GPIO7INPUT_ENABLED_A) -> Self {
438 variant as u8 != 0
439 }
440}
441impl REG_GPIO_7_IE_R {
442 #[doc = "Get enumerated values variant"]
443 #[inline(always)]
444 pub fn variant(&self) -> GPIO7INPUT_ENABLED_A {
445 match self.bits {
446 false => GPIO7INPUT_ENABLED_A::DISABLED,
447 true => GPIO7INPUT_ENABLED_A::ENABLED,
448 }
449 }
450 #[doc = "Checks if the value of the field is `DISABLED`"]
451 #[inline(always)]
452 pub fn is_disabled(&self) -> bool {
453 *self == GPIO7INPUT_ENABLED_A::DISABLED
454 }
455 #[doc = "Checks if the value of the field is `ENABLED`"]
456 #[inline(always)]
457 pub fn is_enabled(&self) -> bool {
458 *self == GPIO7INPUT_ENABLED_A::ENABLED
459 }
460}
461#[doc = "Field `reg_gpio_7_ie` writer - Input enable for GPIO7."]
462pub type REG_GPIO_7_IE_W<'a, const O: u8> =
463 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO7INPUT_ENABLED_A, O>;
464impl<'a, const O: u8> REG_GPIO_7_IE_W<'a, O> {
465 #[doc = "`0`"]
466 #[inline(always)]
467 pub fn disabled(self) -> &'a mut W {
468 self.variant(GPIO7INPUT_ENABLED_A::DISABLED)
469 }
470 #[doc = "`1`"]
471 #[inline(always)]
472 pub fn enabled(self) -> &'a mut W {
473 self.variant(GPIO7INPUT_ENABLED_A::ENABLED)
474 }
475}
476#[doc = "Field `reg_gpio_7_smt` reader - Schmitt trigger enabled for GPIO7."]
477pub type REG_GPIO_7_SMT_R = crate::BitReader<GPIO7SCHMITT_A>;
478#[doc = "Schmitt trigger enabled for GPIO7.\n\nValue on reset: 1"]
479#[derive(Clone, Copy, Debug, PartialEq, Eq)]
480pub enum GPIO7SCHMITT_A {
481 #[doc = "0: `0`"]
482 DISABLED = 0,
483 #[doc = "1: `1`"]
484 ENABLED = 1,
485}
486impl From<GPIO7SCHMITT_A> for bool {
487 #[inline(always)]
488 fn from(variant: GPIO7SCHMITT_A) -> Self {
489 variant as u8 != 0
490 }
491}
492impl REG_GPIO_7_SMT_R {
493 #[doc = "Get enumerated values variant"]
494 #[inline(always)]
495 pub fn variant(&self) -> GPIO7SCHMITT_A {
496 match self.bits {
497 false => GPIO7SCHMITT_A::DISABLED,
498 true => GPIO7SCHMITT_A::ENABLED,
499 }
500 }
501 #[doc = "Checks if the value of the field is `DISABLED`"]
502 #[inline(always)]
503 pub fn is_disabled(&self) -> bool {
504 *self == GPIO7SCHMITT_A::DISABLED
505 }
506 #[doc = "Checks if the value of the field is `ENABLED`"]
507 #[inline(always)]
508 pub fn is_enabled(&self) -> bool {
509 *self == GPIO7SCHMITT_A::ENABLED
510 }
511}
512#[doc = "Field `reg_gpio_7_smt` writer - Schmitt trigger enabled for GPIO7."]
513pub type REG_GPIO_7_SMT_W<'a, const O: u8> =
514 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO7SCHMITT_A, O>;
515impl<'a, const O: u8> REG_GPIO_7_SMT_W<'a, O> {
516 #[doc = "`0`"]
517 #[inline(always)]
518 pub fn disabled(self) -> &'a mut W {
519 self.variant(GPIO7SCHMITT_A::DISABLED)
520 }
521 #[doc = "`1`"]
522 #[inline(always)]
523 pub fn enabled(self) -> &'a mut W {
524 self.variant(GPIO7SCHMITT_A::ENABLED)
525 }
526}
527#[doc = "Field `reg_gpio_7_drv` reader - Driving control enabled for GPIO7."]
528pub type REG_GPIO_7_DRV_R = crate::FieldReader<u8, GPIO7DRIVING_A>;
529#[doc = "Driving control enabled for GPIO7.\n\nValue on reset: 0"]
530#[derive(Clone, Copy, Debug, PartialEq, Eq)]
531#[repr(u8)]
532pub enum GPIO7DRIVING_A {
533 #[doc = "0: `0`"]
534 DISABLED = 0,
535 #[doc = "1: `1`"]
536 ENABLED = 1,
537}
538impl From<GPIO7DRIVING_A> for u8 {
539 #[inline(always)]
540 fn from(variant: GPIO7DRIVING_A) -> Self {
541 variant as _
542 }
543}
544impl REG_GPIO_7_DRV_R {
545 #[doc = "Get enumerated values variant"]
546 #[inline(always)]
547 pub fn variant(&self) -> Option<GPIO7DRIVING_A> {
548 match self.bits {
549 0 => Some(GPIO7DRIVING_A::DISABLED),
550 1 => Some(GPIO7DRIVING_A::ENABLED),
551 _ => None,
552 }
553 }
554 #[doc = "Checks if the value of the field is `DISABLED`"]
555 #[inline(always)]
556 pub fn is_disabled(&self) -> bool {
557 *self == GPIO7DRIVING_A::DISABLED
558 }
559 #[doc = "Checks if the value of the field is `ENABLED`"]
560 #[inline(always)]
561 pub fn is_enabled(&self) -> bool {
562 *self == GPIO7DRIVING_A::ENABLED
563 }
564}
565#[doc = "Field `reg_gpio_7_drv` writer - Driving control enabled for GPIO7."]
566pub type REG_GPIO_7_DRV_W<'a, const O: u8> =
567 crate::FieldWriter<'a, u32, GPIO_CFGCTL3_SPEC, u8, GPIO7DRIVING_A, 2, O>;
568impl<'a, const O: u8> REG_GPIO_7_DRV_W<'a, O> {
569 #[doc = "`0`"]
570 #[inline(always)]
571 pub fn disabled(self) -> &'a mut W {
572 self.variant(GPIO7DRIVING_A::DISABLED)
573 }
574 #[doc = "`1`"]
575 #[inline(always)]
576 pub fn enabled(self) -> &'a mut W {
577 self.variant(GPIO7DRIVING_A::ENABLED)
578 }
579}
580#[doc = "Field `reg_gpio_7_pu` reader - Pull Up Resistor for GPIO7."]
581pub type REG_GPIO_7_PU_R = crate::BitReader<GPIO7PULL_UP_RESISTOR_A>;
582#[doc = "Pull Up Resistor for GPIO7.\n\nValue on reset: 0"]
583#[derive(Clone, Copy, Debug, PartialEq, Eq)]
584pub enum GPIO7PULL_UP_RESISTOR_A {
585 #[doc = "0: `0`"]
586 DISABLED = 0,
587 #[doc = "1: `1`"]
588 ENABLED = 1,
589}
590impl From<GPIO7PULL_UP_RESISTOR_A> for bool {
591 #[inline(always)]
592 fn from(variant: GPIO7PULL_UP_RESISTOR_A) -> Self {
593 variant as u8 != 0
594 }
595}
596impl REG_GPIO_7_PU_R {
597 #[doc = "Get enumerated values variant"]
598 #[inline(always)]
599 pub fn variant(&self) -> GPIO7PULL_UP_RESISTOR_A {
600 match self.bits {
601 false => GPIO7PULL_UP_RESISTOR_A::DISABLED,
602 true => GPIO7PULL_UP_RESISTOR_A::ENABLED,
603 }
604 }
605 #[doc = "Checks if the value of the field is `DISABLED`"]
606 #[inline(always)]
607 pub fn is_disabled(&self) -> bool {
608 *self == GPIO7PULL_UP_RESISTOR_A::DISABLED
609 }
610 #[doc = "Checks if the value of the field is `ENABLED`"]
611 #[inline(always)]
612 pub fn is_enabled(&self) -> bool {
613 *self == GPIO7PULL_UP_RESISTOR_A::ENABLED
614 }
615}
616#[doc = "Field `reg_gpio_7_pu` writer - Pull Up Resistor for GPIO7."]
617pub type REG_GPIO_7_PU_W<'a, const O: u8> =
618 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO7PULL_UP_RESISTOR_A, O>;
619impl<'a, const O: u8> REG_GPIO_7_PU_W<'a, O> {
620 #[doc = "`0`"]
621 #[inline(always)]
622 pub fn disabled(self) -> &'a mut W {
623 self.variant(GPIO7PULL_UP_RESISTOR_A::DISABLED)
624 }
625 #[doc = "`1`"]
626 #[inline(always)]
627 pub fn enabled(self) -> &'a mut W {
628 self.variant(GPIO7PULL_UP_RESISTOR_A::ENABLED)
629 }
630}
631#[doc = "Field `reg_gpio_7_pd` reader - Pull Down Resistor for GPIO7."]
632pub type REG_GPIO_7_PD_R = crate::BitReader<GPIO7PULL_DOWN_RESISTOR_A>;
633#[doc = "Pull Down Resistor for GPIO7.\n\nValue on reset: 0"]
634#[derive(Clone, Copy, Debug, PartialEq, Eq)]
635pub enum GPIO7PULL_DOWN_RESISTOR_A {
636 #[doc = "0: `0`"]
637 DISABLED = 0,
638 #[doc = "1: `1`"]
639 ENABLED = 1,
640}
641impl From<GPIO7PULL_DOWN_RESISTOR_A> for bool {
642 #[inline(always)]
643 fn from(variant: GPIO7PULL_DOWN_RESISTOR_A) -> Self {
644 variant as u8 != 0
645 }
646}
647impl REG_GPIO_7_PD_R {
648 #[doc = "Get enumerated values variant"]
649 #[inline(always)]
650 pub fn variant(&self) -> GPIO7PULL_DOWN_RESISTOR_A {
651 match self.bits {
652 false => GPIO7PULL_DOWN_RESISTOR_A::DISABLED,
653 true => GPIO7PULL_DOWN_RESISTOR_A::ENABLED,
654 }
655 }
656 #[doc = "Checks if the value of the field is `DISABLED`"]
657 #[inline(always)]
658 pub fn is_disabled(&self) -> bool {
659 *self == GPIO7PULL_DOWN_RESISTOR_A::DISABLED
660 }
661 #[doc = "Checks if the value of the field is `ENABLED`"]
662 #[inline(always)]
663 pub fn is_enabled(&self) -> bool {
664 *self == GPIO7PULL_DOWN_RESISTOR_A::ENABLED
665 }
666}
667#[doc = "Field `reg_gpio_7_pd` writer - Pull Down Resistor for GPIO7."]
668pub type REG_GPIO_7_PD_W<'a, const O: u8> =
669 crate::BitWriter<'a, u32, GPIO_CFGCTL3_SPEC, GPIO7PULL_DOWN_RESISTOR_A, O>;
670impl<'a, const O: u8> REG_GPIO_7_PD_W<'a, O> {
671 #[doc = "`0`"]
672 #[inline(always)]
673 pub fn disabled(self) -> &'a mut W {
674 self.variant(GPIO7PULL_DOWN_RESISTOR_A::DISABLED)
675 }
676 #[doc = "`1`"]
677 #[inline(always)]
678 pub fn enabled(self) -> &'a mut W {
679 self.variant(GPIO7PULL_DOWN_RESISTOR_A::ENABLED)
680 }
681}
682#[doc = "Field `reg_gpio_7_func_sel` reader - Function select for GPIO7."]
683pub type REG_GPIO_7_FUNC_SEL_R = crate::FieldReader<u8, GPIO7FUNCTION_SELECT_A>;
684#[doc = "Function select for GPIO7.\n\nValue on reset: 11"]
685#[derive(Clone, Copy, Debug, PartialEq, Eq)]
686#[repr(u8)]
687pub enum GPIO7FUNCTION_SELECT_A {
688 #[doc = "4: `100`"]
689 SPI_SCLK = 4,
690 #[doc = "6: `110`"]
691 I2C_SDA = 6,
692 #[doc = "7: `111`"]
693 UART_SIG7 = 7,
694 #[doc = "8: `1000`"]
695 PWM_CH2 = 8,
696 #[doc = "9: `1001`"]
697 FEM_GPIO_3 = 9,
698 #[doc = "11: `1011`"]
699 SWGPIO_7 = 11,
700 #[doc = "14: `1110`"]
701 E21_TDO = 14,
702}
703impl From<GPIO7FUNCTION_SELECT_A> for u8 {
704 #[inline(always)]
705 fn from(variant: GPIO7FUNCTION_SELECT_A) -> Self {
706 variant as _
707 }
708}
709impl REG_GPIO_7_FUNC_SEL_R {
710 #[doc = "Get enumerated values variant"]
711 #[inline(always)]
712 pub fn variant(&self) -> Option<GPIO7FUNCTION_SELECT_A> {
713 match self.bits {
714 4 => Some(GPIO7FUNCTION_SELECT_A::SPI_SCLK),
715 6 => Some(GPIO7FUNCTION_SELECT_A::I2C_SDA),
716 7 => Some(GPIO7FUNCTION_SELECT_A::UART_SIG7),
717 8 => Some(GPIO7FUNCTION_SELECT_A::PWM_CH2),
718 9 => Some(GPIO7FUNCTION_SELECT_A::FEM_GPIO_3),
719 11 => Some(GPIO7FUNCTION_SELECT_A::SWGPIO_7),
720 14 => Some(GPIO7FUNCTION_SELECT_A::E21_TDO),
721 _ => None,
722 }
723 }
724 #[doc = "Checks if the value of the field is `SPI_SCLK`"]
725 #[inline(always)]
726 pub fn is_spi_sclk(&self) -> bool {
727 *self == GPIO7FUNCTION_SELECT_A::SPI_SCLK
728 }
729 #[doc = "Checks if the value of the field is `I2C_SDA`"]
730 #[inline(always)]
731 pub fn is_i2c_sda(&self) -> bool {
732 *self == GPIO7FUNCTION_SELECT_A::I2C_SDA
733 }
734 #[doc = "Checks if the value of the field is `UART_SIG7`"]
735 #[inline(always)]
736 pub fn is_uart_sig7(&self) -> bool {
737 *self == GPIO7FUNCTION_SELECT_A::UART_SIG7
738 }
739 #[doc = "Checks if the value of the field is `PWM_CH2`"]
740 #[inline(always)]
741 pub fn is_pwm_ch2(&self) -> bool {
742 *self == GPIO7FUNCTION_SELECT_A::PWM_CH2
743 }
744 #[doc = "Checks if the value of the field is `FEM_GPIO_3`"]
745 #[inline(always)]
746 pub fn is_fem_gpio_3(&self) -> bool {
747 *self == GPIO7FUNCTION_SELECT_A::FEM_GPIO_3
748 }
749 #[doc = "Checks if the value of the field is `SWGPIO_7`"]
750 #[inline(always)]
751 pub fn is_swgpio_7(&self) -> bool {
752 *self == GPIO7FUNCTION_SELECT_A::SWGPIO_7
753 }
754 #[doc = "Checks if the value of the field is `E21_TDO`"]
755 #[inline(always)]
756 pub fn is_e21_tdo(&self) -> bool {
757 *self == GPIO7FUNCTION_SELECT_A::E21_TDO
758 }
759}
760#[doc = "Field `reg_gpio_7_func_sel` writer - Function select for GPIO7."]
761pub type REG_GPIO_7_FUNC_SEL_W<'a, const O: u8> =
762 crate::FieldWriter<'a, u32, GPIO_CFGCTL3_SPEC, u8, GPIO7FUNCTION_SELECT_A, 4, O>;
763impl<'a, const O: u8> REG_GPIO_7_FUNC_SEL_W<'a, O> {
764 #[doc = "`100`"]
765 #[inline(always)]
766 pub fn spi_sclk(self) -> &'a mut W {
767 self.variant(GPIO7FUNCTION_SELECT_A::SPI_SCLK)
768 }
769 #[doc = "`110`"]
770 #[inline(always)]
771 pub fn i2c_sda(self) -> &'a mut W {
772 self.variant(GPIO7FUNCTION_SELECT_A::I2C_SDA)
773 }
774 #[doc = "`111`"]
775 #[inline(always)]
776 pub fn uart_sig7(self) -> &'a mut W {
777 self.variant(GPIO7FUNCTION_SELECT_A::UART_SIG7)
778 }
779 #[doc = "`1000`"]
780 #[inline(always)]
781 pub fn pwm_ch2(self) -> &'a mut W {
782 self.variant(GPIO7FUNCTION_SELECT_A::PWM_CH2)
783 }
784 #[doc = "`1001`"]
785 #[inline(always)]
786 pub fn fem_gpio_3(self) -> &'a mut W {
787 self.variant(GPIO7FUNCTION_SELECT_A::FEM_GPIO_3)
788 }
789 #[doc = "`1011`"]
790 #[inline(always)]
791 pub fn swgpio_7(self) -> &'a mut W {
792 self.variant(GPIO7FUNCTION_SELECT_A::SWGPIO_7)
793 }
794 #[doc = "`1110`"]
795 #[inline(always)]
796 pub fn e21_tdo(self) -> &'a mut W {
797 self.variant(GPIO7FUNCTION_SELECT_A::E21_TDO)
798 }
799}
800impl R {
801 #[doc = "Bit 0 - Input enable for GPIO6."]
802 #[inline(always)]
803 pub fn reg_gpio_6_ie(&self) -> REG_GPIO_6_IE_R {
804 REG_GPIO_6_IE_R::new((self.bits & 1) != 0)
805 }
806 #[doc = "Bit 1 - Schmitt trigger enabled for GPIO6."]
807 #[inline(always)]
808 pub fn reg_gpio_6_smt(&self) -> REG_GPIO_6_SMT_R {
809 REG_GPIO_6_SMT_R::new(((self.bits >> 1) & 1) != 0)
810 }
811 #[doc = "Bits 2:3 - Driving control enabled for GPIO6."]
812 #[inline(always)]
813 pub fn reg_gpio_6_drv(&self) -> REG_GPIO_6_DRV_R {
814 REG_GPIO_6_DRV_R::new(((self.bits >> 2) & 3) as u8)
815 }
816 #[doc = "Bit 4 - Pull Up Resistor for GPIO6."]
817 #[inline(always)]
818 pub fn reg_gpio_6_pu(&self) -> REG_GPIO_6_PU_R {
819 REG_GPIO_6_PU_R::new(((self.bits >> 4) & 1) != 0)
820 }
821 #[doc = "Bit 5 - Pull Down Resistor for GPIO6."]
822 #[inline(always)]
823 pub fn reg_gpio_6_pd(&self) -> REG_GPIO_6_PD_R {
824 REG_GPIO_6_PD_R::new(((self.bits >> 5) & 1) != 0)
825 }
826 #[doc = "Bits 8:11 - Function select for GPIO6."]
827 #[inline(always)]
828 pub fn reg_gpio_6_func_sel(&self) -> REG_GPIO_6_FUNC_SEL_R {
829 REG_GPIO_6_FUNC_SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
830 }
831 #[doc = "Bit 16 - Input enable for GPIO7."]
832 #[inline(always)]
833 pub fn reg_gpio_7_ie(&self) -> REG_GPIO_7_IE_R {
834 REG_GPIO_7_IE_R::new(((self.bits >> 16) & 1) != 0)
835 }
836 #[doc = "Bit 17 - Schmitt trigger enabled for GPIO7."]
837 #[inline(always)]
838 pub fn reg_gpio_7_smt(&self) -> REG_GPIO_7_SMT_R {
839 REG_GPIO_7_SMT_R::new(((self.bits >> 17) & 1) != 0)
840 }
841 #[doc = "Bits 18:19 - Driving control enabled for GPIO7."]
842 #[inline(always)]
843 pub fn reg_gpio_7_drv(&self) -> REG_GPIO_7_DRV_R {
844 REG_GPIO_7_DRV_R::new(((self.bits >> 18) & 3) as u8)
845 }
846 #[doc = "Bit 20 - Pull Up Resistor for GPIO7."]
847 #[inline(always)]
848 pub fn reg_gpio_7_pu(&self) -> REG_GPIO_7_PU_R {
849 REG_GPIO_7_PU_R::new(((self.bits >> 20) & 1) != 0)
850 }
851 #[doc = "Bit 21 - Pull Down Resistor for GPIO7."]
852 #[inline(always)]
853 pub fn reg_gpio_7_pd(&self) -> REG_GPIO_7_PD_R {
854 REG_GPIO_7_PD_R::new(((self.bits >> 21) & 1) != 0)
855 }
856 #[doc = "Bits 24:27 - Function select for GPIO7."]
857 #[inline(always)]
858 pub fn reg_gpio_7_func_sel(&self) -> REG_GPIO_7_FUNC_SEL_R {
859 REG_GPIO_7_FUNC_SEL_R::new(((self.bits >> 24) & 0x0f) as u8)
860 }
861}
862impl W {
863 #[doc = "Bit 0 - Input enable for GPIO6."]
864 #[inline(always)]
865 #[must_use]
866 pub fn reg_gpio_6_ie(&mut self) -> REG_GPIO_6_IE_W<0> {
867 REG_GPIO_6_IE_W::new(self)
868 }
869 #[doc = "Bit 1 - Schmitt trigger enabled for GPIO6."]
870 #[inline(always)]
871 #[must_use]
872 pub fn reg_gpio_6_smt(&mut self) -> REG_GPIO_6_SMT_W<1> {
873 REG_GPIO_6_SMT_W::new(self)
874 }
875 #[doc = "Bits 2:3 - Driving control enabled for GPIO6."]
876 #[inline(always)]
877 #[must_use]
878 pub fn reg_gpio_6_drv(&mut self) -> REG_GPIO_6_DRV_W<2> {
879 REG_GPIO_6_DRV_W::new(self)
880 }
881 #[doc = "Bit 4 - Pull Up Resistor for GPIO6."]
882 #[inline(always)]
883 #[must_use]
884 pub fn reg_gpio_6_pu(&mut self) -> REG_GPIO_6_PU_W<4> {
885 REG_GPIO_6_PU_W::new(self)
886 }
887 #[doc = "Bit 5 - Pull Down Resistor for GPIO6."]
888 #[inline(always)]
889 #[must_use]
890 pub fn reg_gpio_6_pd(&mut self) -> REG_GPIO_6_PD_W<5> {
891 REG_GPIO_6_PD_W::new(self)
892 }
893 #[doc = "Bits 8:11 - Function select for GPIO6."]
894 #[inline(always)]
895 #[must_use]
896 pub fn reg_gpio_6_func_sel(&mut self) -> REG_GPIO_6_FUNC_SEL_W<8> {
897 REG_GPIO_6_FUNC_SEL_W::new(self)
898 }
899 #[doc = "Bit 16 - Input enable for GPIO7."]
900 #[inline(always)]
901 #[must_use]
902 pub fn reg_gpio_7_ie(&mut self) -> REG_GPIO_7_IE_W<16> {
903 REG_GPIO_7_IE_W::new(self)
904 }
905 #[doc = "Bit 17 - Schmitt trigger enabled for GPIO7."]
906 #[inline(always)]
907 #[must_use]
908 pub fn reg_gpio_7_smt(&mut self) -> REG_GPIO_7_SMT_W<17> {
909 REG_GPIO_7_SMT_W::new(self)
910 }
911 #[doc = "Bits 18:19 - Driving control enabled for GPIO7."]
912 #[inline(always)]
913 #[must_use]
914 pub fn reg_gpio_7_drv(&mut self) -> REG_GPIO_7_DRV_W<18> {
915 REG_GPIO_7_DRV_W::new(self)
916 }
917 #[doc = "Bit 20 - Pull Up Resistor for GPIO7."]
918 #[inline(always)]
919 #[must_use]
920 pub fn reg_gpio_7_pu(&mut self) -> REG_GPIO_7_PU_W<20> {
921 REG_GPIO_7_PU_W::new(self)
922 }
923 #[doc = "Bit 21 - Pull Down Resistor for GPIO7."]
924 #[inline(always)]
925 #[must_use]
926 pub fn reg_gpio_7_pd(&mut self) -> REG_GPIO_7_PD_W<21> {
927 REG_GPIO_7_PD_W::new(self)
928 }
929 #[doc = "Bits 24:27 - Function select for GPIO7."]
930 #[inline(always)]
931 #[must_use]
932 pub fn reg_gpio_7_func_sel(&mut self) -> REG_GPIO_7_FUNC_SEL_W<24> {
933 REG_GPIO_7_FUNC_SEL_W::new(self)
934 }
935 #[doc = "Writes raw bits to the register."]
936 #[inline(always)]
937 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
938 self.0.bits(bits);
939 self
940 }
941}
942#[doc = "GPIO6, GPIO7 configuration\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 [gpio_cfgctl3](index.html) module"]
943pub struct GPIO_CFGCTL3_SPEC;
944impl crate::RegisterSpec for GPIO_CFGCTL3_SPEC {
945 type Ux = u32;
946}
947#[doc = "`read()` method returns [gpio_cfgctl3::R](R) reader structure"]
948impl crate::Readable for GPIO_CFGCTL3_SPEC {
949 type Reader = R;
950}
951#[doc = "`write(|w| ..)` method takes [gpio_cfgctl3::W](W) writer structure"]
952impl crate::Writable for GPIO_CFGCTL3_SPEC {
953 type Writer = W;
954 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
955 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
956}
957#[doc = "`reset()` method sets GPIO_CFGCTL3 to value 0x0b03_0b03"]
958impl crate::Resettable for GPIO_CFGCTL3_SPEC {
959 const RESET_VALUE: Self::Ux = 0x0b03_0b03;
960}