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