1#[doc = "Register `GPIO_CFGCTL11` reader"]
2pub struct R(crate::R<GPIO_CFGCTL11_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<GPIO_CFGCTL11_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<GPIO_CFGCTL11_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<GPIO_CFGCTL11_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `GPIO_CFGCTL11` writer"]
17pub struct W(crate::W<GPIO_CFGCTL11_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<GPIO_CFGCTL11_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_CFGCTL11_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<GPIO_CFGCTL11_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `reg_gpio_22_ie` reader - Input enable for GPIO22."]
38pub type REG_GPIO_22_IE_R = crate::BitReader<GPIO22INPUT_ENABLED_A>;
39#[doc = "Input enable for GPIO22.\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum GPIO22INPUT_ENABLED_A {
42 #[doc = "0: `0`"]
43 DISABLED = 0,
44 #[doc = "1: `1`"]
45 ENABLED = 1,
46}
47impl From<GPIO22INPUT_ENABLED_A> for bool {
48 #[inline(always)]
49 fn from(variant: GPIO22INPUT_ENABLED_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl REG_GPIO_22_IE_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> GPIO22INPUT_ENABLED_A {
57 match self.bits {
58 false => GPIO22INPUT_ENABLED_A::DISABLED,
59 true => GPIO22INPUT_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 == GPIO22INPUT_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 == GPIO22INPUT_ENABLED_A::ENABLED
71 }
72}
73#[doc = "Field `reg_gpio_22_ie` writer - Input enable for GPIO22."]
74pub type REG_GPIO_22_IE_W<'a, const O: u8> =
75 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO22INPUT_ENABLED_A, O>;
76impl<'a, const O: u8> REG_GPIO_22_IE_W<'a, O> {
77 #[doc = "`0`"]
78 #[inline(always)]
79 pub fn disabled(self) -> &'a mut W {
80 self.variant(GPIO22INPUT_ENABLED_A::DISABLED)
81 }
82 #[doc = "`1`"]
83 #[inline(always)]
84 pub fn enabled(self) -> &'a mut W {
85 self.variant(GPIO22INPUT_ENABLED_A::ENABLED)
86 }
87}
88#[doc = "Field `reg_gpio_22_smt` reader - Schmitt trigger enabled for GPIO22."]
89pub type REG_GPIO_22_SMT_R = crate::BitReader<GPIO22SCHMITT_A>;
90#[doc = "Schmitt trigger enabled for GPIO22.\n\nValue on reset: 1"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum GPIO22SCHMITT_A {
93 #[doc = "0: `0`"]
94 DISABLED = 0,
95 #[doc = "1: `1`"]
96 ENABLED = 1,
97}
98impl From<GPIO22SCHMITT_A> for bool {
99 #[inline(always)]
100 fn from(variant: GPIO22SCHMITT_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl REG_GPIO_22_SMT_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> GPIO22SCHMITT_A {
108 match self.bits {
109 false => GPIO22SCHMITT_A::DISABLED,
110 true => GPIO22SCHMITT_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 == GPIO22SCHMITT_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 == GPIO22SCHMITT_A::ENABLED
122 }
123}
124#[doc = "Field `reg_gpio_22_smt` writer - Schmitt trigger enabled for GPIO22."]
125pub type REG_GPIO_22_SMT_W<'a, const O: u8> =
126 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO22SCHMITT_A, O>;
127impl<'a, const O: u8> REG_GPIO_22_SMT_W<'a, O> {
128 #[doc = "`0`"]
129 #[inline(always)]
130 pub fn disabled(self) -> &'a mut W {
131 self.variant(GPIO22SCHMITT_A::DISABLED)
132 }
133 #[doc = "`1`"]
134 #[inline(always)]
135 pub fn enabled(self) -> &'a mut W {
136 self.variant(GPIO22SCHMITT_A::ENABLED)
137 }
138}
139#[doc = "Field `reg_gpio_22_drv` reader - Driving control enabled for GPIO22."]
140pub type REG_GPIO_22_DRV_R = crate::FieldReader<u8, GPIO22DRIVING_A>;
141#[doc = "Driving control enabled for GPIO22.\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143#[repr(u8)]
144pub enum GPIO22DRIVING_A {
145 #[doc = "0: `0`"]
146 DISABLED = 0,
147 #[doc = "1: `1`"]
148 ENABLED = 1,
149}
150impl From<GPIO22DRIVING_A> for u8 {
151 #[inline(always)]
152 fn from(variant: GPIO22DRIVING_A) -> Self {
153 variant as _
154 }
155}
156impl REG_GPIO_22_DRV_R {
157 #[doc = "Get enumerated values variant"]
158 #[inline(always)]
159 pub fn variant(&self) -> Option<GPIO22DRIVING_A> {
160 match self.bits {
161 0 => Some(GPIO22DRIVING_A::DISABLED),
162 1 => Some(GPIO22DRIVING_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 == GPIO22DRIVING_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 == GPIO22DRIVING_A::ENABLED
175 }
176}
177#[doc = "Field `reg_gpio_22_drv` writer - Driving control enabled for GPIO22."]
178pub type REG_GPIO_22_DRV_W<'a, const O: u8> =
179 crate::FieldWriter<'a, u32, GPIO_CFGCTL11_SPEC, u8, GPIO22DRIVING_A, 2, O>;
180impl<'a, const O: u8> REG_GPIO_22_DRV_W<'a, O> {
181 #[doc = "`0`"]
182 #[inline(always)]
183 pub fn disabled(self) -> &'a mut W {
184 self.variant(GPIO22DRIVING_A::DISABLED)
185 }
186 #[doc = "`1`"]
187 #[inline(always)]
188 pub fn enabled(self) -> &'a mut W {
189 self.variant(GPIO22DRIVING_A::ENABLED)
190 }
191}
192#[doc = "Field `reg_gpio_22_pu` reader - Pull Up Resistor for GPIO22."]
193pub type REG_GPIO_22_PU_R = crate::BitReader<GPIO22PULL_UP_RESISTOR_A>;
194#[doc = "Pull Up Resistor for GPIO22.\n\nValue on reset: 0"]
195#[derive(Clone, Copy, Debug, PartialEq, Eq)]
196pub enum GPIO22PULL_UP_RESISTOR_A {
197 #[doc = "0: `0`"]
198 DISABLED = 0,
199 #[doc = "1: `1`"]
200 ENABLED = 1,
201}
202impl From<GPIO22PULL_UP_RESISTOR_A> for bool {
203 #[inline(always)]
204 fn from(variant: GPIO22PULL_UP_RESISTOR_A) -> Self {
205 variant as u8 != 0
206 }
207}
208impl REG_GPIO_22_PU_R {
209 #[doc = "Get enumerated values variant"]
210 #[inline(always)]
211 pub fn variant(&self) -> GPIO22PULL_UP_RESISTOR_A {
212 match self.bits {
213 false => GPIO22PULL_UP_RESISTOR_A::DISABLED,
214 true => GPIO22PULL_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 == GPIO22PULL_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 == GPIO22PULL_UP_RESISTOR_A::ENABLED
226 }
227}
228#[doc = "Field `reg_gpio_22_pu` writer - Pull Up Resistor for GPIO22."]
229pub type REG_GPIO_22_PU_W<'a, const O: u8> =
230 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO22PULL_UP_RESISTOR_A, O>;
231impl<'a, const O: u8> REG_GPIO_22_PU_W<'a, O> {
232 #[doc = "`0`"]
233 #[inline(always)]
234 pub fn disabled(self) -> &'a mut W {
235 self.variant(GPIO22PULL_UP_RESISTOR_A::DISABLED)
236 }
237 #[doc = "`1`"]
238 #[inline(always)]
239 pub fn enabled(self) -> &'a mut W {
240 self.variant(GPIO22PULL_UP_RESISTOR_A::ENABLED)
241 }
242}
243#[doc = "Field `reg_gpio_22_pd` reader - Pull Down Resistor for GPIO22."]
244pub type REG_GPIO_22_PD_R = crate::BitReader<GPIO22PULL_DOWN_RESISTOR_A>;
245#[doc = "Pull Down Resistor for GPIO22.\n\nValue on reset: 0"]
246#[derive(Clone, Copy, Debug, PartialEq, Eq)]
247pub enum GPIO22PULL_DOWN_RESISTOR_A {
248 #[doc = "0: `0`"]
249 DISABLED = 0,
250 #[doc = "1: `1`"]
251 ENABLED = 1,
252}
253impl From<GPIO22PULL_DOWN_RESISTOR_A> for bool {
254 #[inline(always)]
255 fn from(variant: GPIO22PULL_DOWN_RESISTOR_A) -> Self {
256 variant as u8 != 0
257 }
258}
259impl REG_GPIO_22_PD_R {
260 #[doc = "Get enumerated values variant"]
261 #[inline(always)]
262 pub fn variant(&self) -> GPIO22PULL_DOWN_RESISTOR_A {
263 match self.bits {
264 false => GPIO22PULL_DOWN_RESISTOR_A::DISABLED,
265 true => GPIO22PULL_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 == GPIO22PULL_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 == GPIO22PULL_DOWN_RESISTOR_A::ENABLED
277 }
278}
279#[doc = "Field `reg_gpio_22_pd` writer - Pull Down Resistor for GPIO22."]
280pub type REG_GPIO_22_PD_W<'a, const O: u8> =
281 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO22PULL_DOWN_RESISTOR_A, O>;
282impl<'a, const O: u8> REG_GPIO_22_PD_W<'a, O> {
283 #[doc = "`0`"]
284 #[inline(always)]
285 pub fn disabled(self) -> &'a mut W {
286 self.variant(GPIO22PULL_DOWN_RESISTOR_A::DISABLED)
287 }
288 #[doc = "`1`"]
289 #[inline(always)]
290 pub fn enabled(self) -> &'a mut W {
291 self.variant(GPIO22PULL_DOWN_RESISTOR_A::ENABLED)
292 }
293}
294#[doc = "Field `reg_gpio_22_func_sel` reader - Function select for GPIO22."]
295pub type REG_GPIO_22_FUNC_SEL_R = crate::FieldReader<u8, GPIO22FUNCTION_SELECT_A>;
296#[doc = "Function select for GPIO22.\n\nValue on reset: 11"]
297#[derive(Clone, Copy, Debug, PartialEq, Eq)]
298#[repr(u8)]
299pub enum GPIO22FUNCTION_SELECT_A {
300 #[doc = "2: `10`"]
301 SF_CLK_OUT = 2,
302 #[doc = "4: `100`"]
303 SPI_SS = 4,
304 #[doc = "6: `110`"]
305 I2C_SCL = 6,
306 #[doc = "7: `111`"]
307 UART_SIG6 = 7,
308 #[doc = "8: `1000`"]
309 PWM_CH2 = 8,
310 #[doc = "9: `1001`"]
311 FEM_GPIO_2 = 9,
312 #[doc = "11: `1011`"]
313 SWGPIO_22 = 11,
314 #[doc = "14: `1110`"]
315 E21_TCK = 14,
316}
317impl From<GPIO22FUNCTION_SELECT_A> for u8 {
318 #[inline(always)]
319 fn from(variant: GPIO22FUNCTION_SELECT_A) -> Self {
320 variant as _
321 }
322}
323impl REG_GPIO_22_FUNC_SEL_R {
324 #[doc = "Get enumerated values variant"]
325 #[inline(always)]
326 pub fn variant(&self) -> Option<GPIO22FUNCTION_SELECT_A> {
327 match self.bits {
328 2 => Some(GPIO22FUNCTION_SELECT_A::SF_CLK_OUT),
329 4 => Some(GPIO22FUNCTION_SELECT_A::SPI_SS),
330 6 => Some(GPIO22FUNCTION_SELECT_A::I2C_SCL),
331 7 => Some(GPIO22FUNCTION_SELECT_A::UART_SIG6),
332 8 => Some(GPIO22FUNCTION_SELECT_A::PWM_CH2),
333 9 => Some(GPIO22FUNCTION_SELECT_A::FEM_GPIO_2),
334 11 => Some(GPIO22FUNCTION_SELECT_A::SWGPIO_22),
335 14 => Some(GPIO22FUNCTION_SELECT_A::E21_TCK),
336 _ => None,
337 }
338 }
339 #[doc = "Checks if the value of the field is `SF_CLK_OUT`"]
340 #[inline(always)]
341 pub fn is_sf_clk_out(&self) -> bool {
342 *self == GPIO22FUNCTION_SELECT_A::SF_CLK_OUT
343 }
344 #[doc = "Checks if the value of the field is `SPI_SS`"]
345 #[inline(always)]
346 pub fn is_spi_ss(&self) -> bool {
347 *self == GPIO22FUNCTION_SELECT_A::SPI_SS
348 }
349 #[doc = "Checks if the value of the field is `I2C_SCL`"]
350 #[inline(always)]
351 pub fn is_i2c_scl(&self) -> bool {
352 *self == GPIO22FUNCTION_SELECT_A::I2C_SCL
353 }
354 #[doc = "Checks if the value of the field is `UART_SIG6`"]
355 #[inline(always)]
356 pub fn is_uart_sig6(&self) -> bool {
357 *self == GPIO22FUNCTION_SELECT_A::UART_SIG6
358 }
359 #[doc = "Checks if the value of the field is `PWM_CH2`"]
360 #[inline(always)]
361 pub fn is_pwm_ch2(&self) -> bool {
362 *self == GPIO22FUNCTION_SELECT_A::PWM_CH2
363 }
364 #[doc = "Checks if the value of the field is `FEM_GPIO_2`"]
365 #[inline(always)]
366 pub fn is_fem_gpio_2(&self) -> bool {
367 *self == GPIO22FUNCTION_SELECT_A::FEM_GPIO_2
368 }
369 #[doc = "Checks if the value of the field is `SWGPIO_22`"]
370 #[inline(always)]
371 pub fn is_swgpio_22(&self) -> bool {
372 *self == GPIO22FUNCTION_SELECT_A::SWGPIO_22
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 == GPIO22FUNCTION_SELECT_A::E21_TCK
378 }
379}
380#[doc = "Field `reg_gpio_22_func_sel` writer - Function select for GPIO22."]
381pub type REG_GPIO_22_FUNC_SEL_W<'a, const O: u8> =
382 crate::FieldWriter<'a, u32, GPIO_CFGCTL11_SPEC, u8, GPIO22FUNCTION_SELECT_A, 4, O>;
383impl<'a, const O: u8> REG_GPIO_22_FUNC_SEL_W<'a, O> {
384 #[doc = "`10`"]
385 #[inline(always)]
386 pub fn sf_clk_out(self) -> &'a mut W {
387 self.variant(GPIO22FUNCTION_SELECT_A::SF_CLK_OUT)
388 }
389 #[doc = "`100`"]
390 #[inline(always)]
391 pub fn spi_ss(self) -> &'a mut W {
392 self.variant(GPIO22FUNCTION_SELECT_A::SPI_SS)
393 }
394 #[doc = "`110`"]
395 #[inline(always)]
396 pub fn i2c_scl(self) -> &'a mut W {
397 self.variant(GPIO22FUNCTION_SELECT_A::I2C_SCL)
398 }
399 #[doc = "`111`"]
400 #[inline(always)]
401 pub fn uart_sig6(self) -> &'a mut W {
402 self.variant(GPIO22FUNCTION_SELECT_A::UART_SIG6)
403 }
404 #[doc = "`1000`"]
405 #[inline(always)]
406 pub fn pwm_ch2(self) -> &'a mut W {
407 self.variant(GPIO22FUNCTION_SELECT_A::PWM_CH2)
408 }
409 #[doc = "`1001`"]
410 #[inline(always)]
411 pub fn fem_gpio_2(self) -> &'a mut W {
412 self.variant(GPIO22FUNCTION_SELECT_A::FEM_GPIO_2)
413 }
414 #[doc = "`1011`"]
415 #[inline(always)]
416 pub fn swgpio_22(self) -> &'a mut W {
417 self.variant(GPIO22FUNCTION_SELECT_A::SWGPIO_22)
418 }
419 #[doc = "`1110`"]
420 #[inline(always)]
421 pub fn e21_tck(self) -> &'a mut W {
422 self.variant(GPIO22FUNCTION_SELECT_A::E21_TCK)
423 }
424}
425#[doc = "Field `reg_gpio_23_ie` reader - Input enable for GPIO23."]
426pub type REG_GPIO_23_IE_R = crate::BitReader<GPIO23INPUT_ENABLED_A>;
427#[doc = "Input enable for GPIO23.\n\nValue on reset: 1"]
428#[derive(Clone, Copy, Debug, PartialEq, Eq)]
429pub enum GPIO23INPUT_ENABLED_A {
430 #[doc = "0: `0`"]
431 DISABLED = 0,
432 #[doc = "1: `1`"]
433 ENABLED = 1,
434}
435impl From<GPIO23INPUT_ENABLED_A> for bool {
436 #[inline(always)]
437 fn from(variant: GPIO23INPUT_ENABLED_A) -> Self {
438 variant as u8 != 0
439 }
440}
441impl REG_GPIO_23_IE_R {
442 #[doc = "Get enumerated values variant"]
443 #[inline(always)]
444 pub fn variant(&self) -> GPIO23INPUT_ENABLED_A {
445 match self.bits {
446 false => GPIO23INPUT_ENABLED_A::DISABLED,
447 true => GPIO23INPUT_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 == GPIO23INPUT_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 == GPIO23INPUT_ENABLED_A::ENABLED
459 }
460}
461#[doc = "Field `reg_gpio_23_ie` writer - Input enable for GPIO23."]
462pub type REG_GPIO_23_IE_W<'a, const O: u8> =
463 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO23INPUT_ENABLED_A, O>;
464impl<'a, const O: u8> REG_GPIO_23_IE_W<'a, O> {
465 #[doc = "`0`"]
466 #[inline(always)]
467 pub fn disabled(self) -> &'a mut W {
468 self.variant(GPIO23INPUT_ENABLED_A::DISABLED)
469 }
470 #[doc = "`1`"]
471 #[inline(always)]
472 pub fn enabled(self) -> &'a mut W {
473 self.variant(GPIO23INPUT_ENABLED_A::ENABLED)
474 }
475}
476#[doc = "Field `reg_gpio_23_smt` reader - Schmitt trigger enabled for GPIO23."]
477pub type REG_GPIO_23_SMT_R = crate::BitReader<GPIO23SCHMITT_A>;
478#[doc = "Schmitt trigger enabled for GPIO23.\n\nValue on reset: 1"]
479#[derive(Clone, Copy, Debug, PartialEq, Eq)]
480pub enum GPIO23SCHMITT_A {
481 #[doc = "0: `0`"]
482 DISABLED = 0,
483 #[doc = "1: `1`"]
484 ENABLED = 1,
485}
486impl From<GPIO23SCHMITT_A> for bool {
487 #[inline(always)]
488 fn from(variant: GPIO23SCHMITT_A) -> Self {
489 variant as u8 != 0
490 }
491}
492impl REG_GPIO_23_SMT_R {
493 #[doc = "Get enumerated values variant"]
494 #[inline(always)]
495 pub fn variant(&self) -> GPIO23SCHMITT_A {
496 match self.bits {
497 false => GPIO23SCHMITT_A::DISABLED,
498 true => GPIO23SCHMITT_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 == GPIO23SCHMITT_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 == GPIO23SCHMITT_A::ENABLED
510 }
511}
512#[doc = "Field `reg_gpio_23_smt` writer - Schmitt trigger enabled for GPIO23."]
513pub type REG_GPIO_23_SMT_W<'a, const O: u8> =
514 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO23SCHMITT_A, O>;
515impl<'a, const O: u8> REG_GPIO_23_SMT_W<'a, O> {
516 #[doc = "`0`"]
517 #[inline(always)]
518 pub fn disabled(self) -> &'a mut W {
519 self.variant(GPIO23SCHMITT_A::DISABLED)
520 }
521 #[doc = "`1`"]
522 #[inline(always)]
523 pub fn enabled(self) -> &'a mut W {
524 self.variant(GPIO23SCHMITT_A::ENABLED)
525 }
526}
527#[doc = "Field `reg_gpio_23_drv` reader - Driving control enabled for GPIO23."]
528pub type REG_GPIO_23_DRV_R = crate::FieldReader<u8, GPIO23DRIVING_A>;
529#[doc = "Driving control enabled for GPIO23.\n\nValue on reset: 0"]
530#[derive(Clone, Copy, Debug, PartialEq, Eq)]
531#[repr(u8)]
532pub enum GPIO23DRIVING_A {
533 #[doc = "0: `0`"]
534 DISABLED = 0,
535 #[doc = "1: `1`"]
536 ENABLED = 1,
537}
538impl From<GPIO23DRIVING_A> for u8 {
539 #[inline(always)]
540 fn from(variant: GPIO23DRIVING_A) -> Self {
541 variant as _
542 }
543}
544impl REG_GPIO_23_DRV_R {
545 #[doc = "Get enumerated values variant"]
546 #[inline(always)]
547 pub fn variant(&self) -> Option<GPIO23DRIVING_A> {
548 match self.bits {
549 0 => Some(GPIO23DRIVING_A::DISABLED),
550 1 => Some(GPIO23DRIVING_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 == GPIO23DRIVING_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 == GPIO23DRIVING_A::ENABLED
563 }
564}
565#[doc = "Field `reg_gpio_23_drv` writer - Driving control enabled for GPIO23."]
566pub type REG_GPIO_23_DRV_W<'a, const O: u8> =
567 crate::FieldWriter<'a, u32, GPIO_CFGCTL11_SPEC, u8, GPIO23DRIVING_A, 2, O>;
568impl<'a, const O: u8> REG_GPIO_23_DRV_W<'a, O> {
569 #[doc = "`0`"]
570 #[inline(always)]
571 pub fn disabled(self) -> &'a mut W {
572 self.variant(GPIO23DRIVING_A::DISABLED)
573 }
574 #[doc = "`1`"]
575 #[inline(always)]
576 pub fn enabled(self) -> &'a mut W {
577 self.variant(GPIO23DRIVING_A::ENABLED)
578 }
579}
580#[doc = "Field `reg_gpio_23_pu` reader - Pull Up Resistor for GPIO23."]
581pub type REG_GPIO_23_PU_R = crate::BitReader<GPIO23PULL_UP_RESISTOR_A>;
582#[doc = "Pull Up Resistor for GPIO23.\n\nValue on reset: 0"]
583#[derive(Clone, Copy, Debug, PartialEq, Eq)]
584pub enum GPIO23PULL_UP_RESISTOR_A {
585 #[doc = "0: `0`"]
586 DISABLED = 0,
587 #[doc = "1: `1`"]
588 ENABLED = 1,
589}
590impl From<GPIO23PULL_UP_RESISTOR_A> for bool {
591 #[inline(always)]
592 fn from(variant: GPIO23PULL_UP_RESISTOR_A) -> Self {
593 variant as u8 != 0
594 }
595}
596impl REG_GPIO_23_PU_R {
597 #[doc = "Get enumerated values variant"]
598 #[inline(always)]
599 pub fn variant(&self) -> GPIO23PULL_UP_RESISTOR_A {
600 match self.bits {
601 false => GPIO23PULL_UP_RESISTOR_A::DISABLED,
602 true => GPIO23PULL_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 == GPIO23PULL_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 == GPIO23PULL_UP_RESISTOR_A::ENABLED
614 }
615}
616#[doc = "Field `reg_gpio_23_pu` writer - Pull Up Resistor for GPIO23."]
617pub type REG_GPIO_23_PU_W<'a, const O: u8> =
618 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO23PULL_UP_RESISTOR_A, O>;
619impl<'a, const O: u8> REG_GPIO_23_PU_W<'a, O> {
620 #[doc = "`0`"]
621 #[inline(always)]
622 pub fn disabled(self) -> &'a mut W {
623 self.variant(GPIO23PULL_UP_RESISTOR_A::DISABLED)
624 }
625 #[doc = "`1`"]
626 #[inline(always)]
627 pub fn enabled(self) -> &'a mut W {
628 self.variant(GPIO23PULL_UP_RESISTOR_A::ENABLED)
629 }
630}
631#[doc = "Field `reg_gpio_23_pd` reader - Pull Down Resistor for GPIO23."]
632pub type REG_GPIO_23_PD_R = crate::BitReader<GPIO23PULL_DOWN_RESISTOR_A>;
633#[doc = "Pull Down Resistor for GPIO23.\n\nValue on reset: 0"]
634#[derive(Clone, Copy, Debug, PartialEq, Eq)]
635pub enum GPIO23PULL_DOWN_RESISTOR_A {
636 #[doc = "0: `0`"]
637 DISABLED = 0,
638 #[doc = "1: `1`"]
639 ENABLED = 1,
640}
641impl From<GPIO23PULL_DOWN_RESISTOR_A> for bool {
642 #[inline(always)]
643 fn from(variant: GPIO23PULL_DOWN_RESISTOR_A) -> Self {
644 variant as u8 != 0
645 }
646}
647impl REG_GPIO_23_PD_R {
648 #[doc = "Get enumerated values variant"]
649 #[inline(always)]
650 pub fn variant(&self) -> GPIO23PULL_DOWN_RESISTOR_A {
651 match self.bits {
652 false => GPIO23PULL_DOWN_RESISTOR_A::DISABLED,
653 true => GPIO23PULL_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 == GPIO23PULL_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 == GPIO23PULL_DOWN_RESISTOR_A::ENABLED
665 }
666}
667#[doc = "Field `reg_gpio_23_pd` writer - Pull Down Resistor for GPIO23."]
668pub type REG_GPIO_23_PD_W<'a, const O: u8> =
669 crate::BitWriter<'a, u32, GPIO_CFGCTL11_SPEC, GPIO23PULL_DOWN_RESISTOR_A, O>;
670impl<'a, const O: u8> REG_GPIO_23_PD_W<'a, O> {
671 #[doc = "`0`"]
672 #[inline(always)]
673 pub fn disabled(self) -> &'a mut W {
674 self.variant(GPIO23PULL_DOWN_RESISTOR_A::DISABLED)
675 }
676 #[doc = "`1`"]
677 #[inline(always)]
678 pub fn enabled(self) -> &'a mut W {
679 self.variant(GPIO23PULL_DOWN_RESISTOR_A::ENABLED)
680 }
681}
682impl R {
683 #[doc = "Bit 0 - Input enable for GPIO22."]
684 #[inline(always)]
685 pub fn reg_gpio_22_ie(&self) -> REG_GPIO_22_IE_R {
686 REG_GPIO_22_IE_R::new((self.bits & 1) != 0)
687 }
688 #[doc = "Bit 1 - Schmitt trigger enabled for GPIO22."]
689 #[inline(always)]
690 pub fn reg_gpio_22_smt(&self) -> REG_GPIO_22_SMT_R {
691 REG_GPIO_22_SMT_R::new(((self.bits >> 1) & 1) != 0)
692 }
693 #[doc = "Bits 2:3 - Driving control enabled for GPIO22."]
694 #[inline(always)]
695 pub fn reg_gpio_22_drv(&self) -> REG_GPIO_22_DRV_R {
696 REG_GPIO_22_DRV_R::new(((self.bits >> 2) & 3) as u8)
697 }
698 #[doc = "Bit 4 - Pull Up Resistor for GPIO22."]
699 #[inline(always)]
700 pub fn reg_gpio_22_pu(&self) -> REG_GPIO_22_PU_R {
701 REG_GPIO_22_PU_R::new(((self.bits >> 4) & 1) != 0)
702 }
703 #[doc = "Bit 5 - Pull Down Resistor for GPIO22."]
704 #[inline(always)]
705 pub fn reg_gpio_22_pd(&self) -> REG_GPIO_22_PD_R {
706 REG_GPIO_22_PD_R::new(((self.bits >> 5) & 1) != 0)
707 }
708 #[doc = "Bits 8:11 - Function select for GPIO22."]
709 #[inline(always)]
710 pub fn reg_gpio_22_func_sel(&self) -> REG_GPIO_22_FUNC_SEL_R {
711 REG_GPIO_22_FUNC_SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
712 }
713 #[doc = "Bit 16 - Input enable for GPIO23."]
714 #[inline(always)]
715 pub fn reg_gpio_23_ie(&self) -> REG_GPIO_23_IE_R {
716 REG_GPIO_23_IE_R::new(((self.bits >> 16) & 1) != 0)
717 }
718 #[doc = "Bit 17 - Schmitt trigger enabled for GPIO23."]
719 #[inline(always)]
720 pub fn reg_gpio_23_smt(&self) -> REG_GPIO_23_SMT_R {
721 REG_GPIO_23_SMT_R::new(((self.bits >> 17) & 1) != 0)
722 }
723 #[doc = "Bits 18:19 - Driving control enabled for GPIO23."]
724 #[inline(always)]
725 pub fn reg_gpio_23_drv(&self) -> REG_GPIO_23_DRV_R {
726 REG_GPIO_23_DRV_R::new(((self.bits >> 18) & 3) as u8)
727 }
728 #[doc = "Bit 20 - Pull Up Resistor for GPIO23."]
729 #[inline(always)]
730 pub fn reg_gpio_23_pu(&self) -> REG_GPIO_23_PU_R {
731 REG_GPIO_23_PU_R::new(((self.bits >> 20) & 1) != 0)
732 }
733 #[doc = "Bit 21 - Pull Down Resistor for GPIO23."]
734 #[inline(always)]
735 pub fn reg_gpio_23_pd(&self) -> REG_GPIO_23_PD_R {
736 REG_GPIO_23_PD_R::new(((self.bits >> 21) & 1) != 0)
737 }
738}
739impl W {
740 #[doc = "Bit 0 - Input enable for GPIO22."]
741 #[inline(always)]
742 #[must_use]
743 pub fn reg_gpio_22_ie(&mut self) -> REG_GPIO_22_IE_W<0> {
744 REG_GPIO_22_IE_W::new(self)
745 }
746 #[doc = "Bit 1 - Schmitt trigger enabled for GPIO22."]
747 #[inline(always)]
748 #[must_use]
749 pub fn reg_gpio_22_smt(&mut self) -> REG_GPIO_22_SMT_W<1> {
750 REG_GPIO_22_SMT_W::new(self)
751 }
752 #[doc = "Bits 2:3 - Driving control enabled for GPIO22."]
753 #[inline(always)]
754 #[must_use]
755 pub fn reg_gpio_22_drv(&mut self) -> REG_GPIO_22_DRV_W<2> {
756 REG_GPIO_22_DRV_W::new(self)
757 }
758 #[doc = "Bit 4 - Pull Up Resistor for GPIO22."]
759 #[inline(always)]
760 #[must_use]
761 pub fn reg_gpio_22_pu(&mut self) -> REG_GPIO_22_PU_W<4> {
762 REG_GPIO_22_PU_W::new(self)
763 }
764 #[doc = "Bit 5 - Pull Down Resistor for GPIO22."]
765 #[inline(always)]
766 #[must_use]
767 pub fn reg_gpio_22_pd(&mut self) -> REG_GPIO_22_PD_W<5> {
768 REG_GPIO_22_PD_W::new(self)
769 }
770 #[doc = "Bits 8:11 - Function select for GPIO22."]
771 #[inline(always)]
772 #[must_use]
773 pub fn reg_gpio_22_func_sel(&mut self) -> REG_GPIO_22_FUNC_SEL_W<8> {
774 REG_GPIO_22_FUNC_SEL_W::new(self)
775 }
776 #[doc = "Bit 16 - Input enable for GPIO23."]
777 #[inline(always)]
778 #[must_use]
779 pub fn reg_gpio_23_ie(&mut self) -> REG_GPIO_23_IE_W<16> {
780 REG_GPIO_23_IE_W::new(self)
781 }
782 #[doc = "Bit 17 - Schmitt trigger enabled for GPIO23."]
783 #[inline(always)]
784 #[must_use]
785 pub fn reg_gpio_23_smt(&mut self) -> REG_GPIO_23_SMT_W<17> {
786 REG_GPIO_23_SMT_W::new(self)
787 }
788 #[doc = "Bits 18:19 - Driving control enabled for GPIO23."]
789 #[inline(always)]
790 #[must_use]
791 pub fn reg_gpio_23_drv(&mut self) -> REG_GPIO_23_DRV_W<18> {
792 REG_GPIO_23_DRV_W::new(self)
793 }
794 #[doc = "Bit 20 - Pull Up Resistor for GPIO23."]
795 #[inline(always)]
796 #[must_use]
797 pub fn reg_gpio_23_pu(&mut self) -> REG_GPIO_23_PU_W<20> {
798 REG_GPIO_23_PU_W::new(self)
799 }
800 #[doc = "Bit 21 - Pull Down Resistor for GPIO23."]
801 #[inline(always)]
802 #[must_use]
803 pub fn reg_gpio_23_pd(&mut self) -> REG_GPIO_23_PD_W<21> {
804 REG_GPIO_23_PD_W::new(self)
805 }
806 #[doc = "Writes raw bits to the register."]
807 #[inline(always)]
808 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
809 self.0.bits(bits);
810 self
811 }
812}
813#[doc = "GPIO22, GPIO23 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_cfgctl11](index.html) module"]
814pub struct GPIO_CFGCTL11_SPEC;
815impl crate::RegisterSpec for GPIO_CFGCTL11_SPEC {
816 type Ux = u32;
817}
818#[doc = "`read()` method returns [gpio_cfgctl11::R](R) reader structure"]
819impl crate::Readable for GPIO_CFGCTL11_SPEC {
820 type Reader = R;
821}
822#[doc = "`write(|w| ..)` method takes [gpio_cfgctl11::W](W) writer structure"]
823impl crate::Writable for GPIO_CFGCTL11_SPEC {
824 type Writer = W;
825 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
826 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
827}
828#[doc = "`reset()` method sets GPIO_CFGCTL11 to value 0x0003_0b03"]
829impl crate::Resettable for GPIO_CFGCTL11_SPEC {
830 const RESET_VALUE: Self::Ux = 0x0003_0b03;
831}