bl602_pac/glb/
gpio_cfgctl4.rs

1#[doc = "Register `GPIO_CFGCTL4` reader"]
2pub struct R(crate::R<GPIO_CFGCTL4_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<GPIO_CFGCTL4_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<GPIO_CFGCTL4_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<GPIO_CFGCTL4_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `GPIO_CFGCTL4` writer"]
17pub struct W(crate::W<GPIO_CFGCTL4_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<GPIO_CFGCTL4_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_CFGCTL4_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<GPIO_CFGCTL4_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `reg_gpio_8_ie` reader - Input enable for GPIO8."]
38pub type REG_GPIO_8_IE_R = crate::BitReader<GPIO8INPUT_ENABLED_A>;
39#[doc = "Input enable for GPIO8.\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum GPIO8INPUT_ENABLED_A {
42    #[doc = "0: `0`"]
43    DISABLED = 0,
44    #[doc = "1: `1`"]
45    ENABLED = 1,
46}
47impl From<GPIO8INPUT_ENABLED_A> for bool {
48    #[inline(always)]
49    fn from(variant: GPIO8INPUT_ENABLED_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl REG_GPIO_8_IE_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> GPIO8INPUT_ENABLED_A {
57        match self.bits {
58            false => GPIO8INPUT_ENABLED_A::DISABLED,
59            true => GPIO8INPUT_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 == GPIO8INPUT_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 == GPIO8INPUT_ENABLED_A::ENABLED
71    }
72}
73#[doc = "Field `reg_gpio_8_ie` writer - Input enable for GPIO8."]
74pub type REG_GPIO_8_IE_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO8INPUT_ENABLED_A, O>;
76impl<'a, const O: u8> REG_GPIO_8_IE_W<'a, O> {
77    #[doc = "`0`"]
78    #[inline(always)]
79    pub fn disabled(self) -> &'a mut W {
80        self.variant(GPIO8INPUT_ENABLED_A::DISABLED)
81    }
82    #[doc = "`1`"]
83    #[inline(always)]
84    pub fn enabled(self) -> &'a mut W {
85        self.variant(GPIO8INPUT_ENABLED_A::ENABLED)
86    }
87}
88#[doc = "Field `reg_gpio_8_smt` reader - Schmitt trigger enabled for GPIO8."]
89pub type REG_GPIO_8_SMT_R = crate::BitReader<GPIO8SCHMITT_A>;
90#[doc = "Schmitt trigger enabled for GPIO8.\n\nValue on reset: 1"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum GPIO8SCHMITT_A {
93    #[doc = "0: `0`"]
94    DISABLED = 0,
95    #[doc = "1: `1`"]
96    ENABLED = 1,
97}
98impl From<GPIO8SCHMITT_A> for bool {
99    #[inline(always)]
100    fn from(variant: GPIO8SCHMITT_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl REG_GPIO_8_SMT_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> GPIO8SCHMITT_A {
108        match self.bits {
109            false => GPIO8SCHMITT_A::DISABLED,
110            true => GPIO8SCHMITT_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 == GPIO8SCHMITT_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 == GPIO8SCHMITT_A::ENABLED
122    }
123}
124#[doc = "Field `reg_gpio_8_smt` writer - Schmitt trigger enabled for GPIO8."]
125pub type REG_GPIO_8_SMT_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO8SCHMITT_A, O>;
127impl<'a, const O: u8> REG_GPIO_8_SMT_W<'a, O> {
128    #[doc = "`0`"]
129    #[inline(always)]
130    pub fn disabled(self) -> &'a mut W {
131        self.variant(GPIO8SCHMITT_A::DISABLED)
132    }
133    #[doc = "`1`"]
134    #[inline(always)]
135    pub fn enabled(self) -> &'a mut W {
136        self.variant(GPIO8SCHMITT_A::ENABLED)
137    }
138}
139#[doc = "Field `reg_gpio_8_drv` reader - Driving control enabled for GPIO8."]
140pub type REG_GPIO_8_DRV_R = crate::FieldReader<u8, GPIO8DRIVING_A>;
141#[doc = "Driving control enabled for GPIO8.\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143#[repr(u8)]
144pub enum GPIO8DRIVING_A {
145    #[doc = "0: `0`"]
146    DISABLED = 0,
147    #[doc = "1: `1`"]
148    ENABLED = 1,
149}
150impl From<GPIO8DRIVING_A> for u8 {
151    #[inline(always)]
152    fn from(variant: GPIO8DRIVING_A) -> Self {
153        variant as _
154    }
155}
156impl REG_GPIO_8_DRV_R {
157    #[doc = "Get enumerated values variant"]
158    #[inline(always)]
159    pub fn variant(&self) -> Option<GPIO8DRIVING_A> {
160        match self.bits {
161            0 => Some(GPIO8DRIVING_A::DISABLED),
162            1 => Some(GPIO8DRIVING_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 == GPIO8DRIVING_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 == GPIO8DRIVING_A::ENABLED
175    }
176}
177#[doc = "Field `reg_gpio_8_drv` writer - Driving control enabled for GPIO8."]
178pub type REG_GPIO_8_DRV_W<'a, const O: u8> =
179    crate::FieldWriter<'a, u32, GPIO_CFGCTL4_SPEC, u8, GPIO8DRIVING_A, 2, O>;
180impl<'a, const O: u8> REG_GPIO_8_DRV_W<'a, O> {
181    #[doc = "`0`"]
182    #[inline(always)]
183    pub fn disabled(self) -> &'a mut W {
184        self.variant(GPIO8DRIVING_A::DISABLED)
185    }
186    #[doc = "`1`"]
187    #[inline(always)]
188    pub fn enabled(self) -> &'a mut W {
189        self.variant(GPIO8DRIVING_A::ENABLED)
190    }
191}
192#[doc = "Field `reg_gpio_8_pu` reader - Pull Up Resistor for GPIO8."]
193pub type REG_GPIO_8_PU_R = crate::BitReader<GPIO8PULL_UP_RESISTOR_A>;
194#[doc = "Pull Up Resistor for GPIO8.\n\nValue on reset: 0"]
195#[derive(Clone, Copy, Debug, PartialEq, Eq)]
196pub enum GPIO8PULL_UP_RESISTOR_A {
197    #[doc = "0: `0`"]
198    DISABLED = 0,
199    #[doc = "1: `1`"]
200    ENABLED = 1,
201}
202impl From<GPIO8PULL_UP_RESISTOR_A> for bool {
203    #[inline(always)]
204    fn from(variant: GPIO8PULL_UP_RESISTOR_A) -> Self {
205        variant as u8 != 0
206    }
207}
208impl REG_GPIO_8_PU_R {
209    #[doc = "Get enumerated values variant"]
210    #[inline(always)]
211    pub fn variant(&self) -> GPIO8PULL_UP_RESISTOR_A {
212        match self.bits {
213            false => GPIO8PULL_UP_RESISTOR_A::DISABLED,
214            true => GPIO8PULL_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 == GPIO8PULL_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 == GPIO8PULL_UP_RESISTOR_A::ENABLED
226    }
227}
228#[doc = "Field `reg_gpio_8_pu` writer - Pull Up Resistor for GPIO8."]
229pub type REG_GPIO_8_PU_W<'a, const O: u8> =
230    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO8PULL_UP_RESISTOR_A, O>;
231impl<'a, const O: u8> REG_GPIO_8_PU_W<'a, O> {
232    #[doc = "`0`"]
233    #[inline(always)]
234    pub fn disabled(self) -> &'a mut W {
235        self.variant(GPIO8PULL_UP_RESISTOR_A::DISABLED)
236    }
237    #[doc = "`1`"]
238    #[inline(always)]
239    pub fn enabled(self) -> &'a mut W {
240        self.variant(GPIO8PULL_UP_RESISTOR_A::ENABLED)
241    }
242}
243#[doc = "Field `reg_gpio_8_pd` reader - Pull Down Resistor for GPIO8."]
244pub type REG_GPIO_8_PD_R = crate::BitReader<GPIO8PULL_DOWN_RESISTOR_A>;
245#[doc = "Pull Down Resistor for GPIO8.\n\nValue on reset: 0"]
246#[derive(Clone, Copy, Debug, PartialEq, Eq)]
247pub enum GPIO8PULL_DOWN_RESISTOR_A {
248    #[doc = "0: `0`"]
249    DISABLED = 0,
250    #[doc = "1: `1`"]
251    ENABLED = 1,
252}
253impl From<GPIO8PULL_DOWN_RESISTOR_A> for bool {
254    #[inline(always)]
255    fn from(variant: GPIO8PULL_DOWN_RESISTOR_A) -> Self {
256        variant as u8 != 0
257    }
258}
259impl REG_GPIO_8_PD_R {
260    #[doc = "Get enumerated values variant"]
261    #[inline(always)]
262    pub fn variant(&self) -> GPIO8PULL_DOWN_RESISTOR_A {
263        match self.bits {
264            false => GPIO8PULL_DOWN_RESISTOR_A::DISABLED,
265            true => GPIO8PULL_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 == GPIO8PULL_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 == GPIO8PULL_DOWN_RESISTOR_A::ENABLED
277    }
278}
279#[doc = "Field `reg_gpio_8_pd` writer - Pull Down Resistor for GPIO8."]
280pub type REG_GPIO_8_PD_W<'a, const O: u8> =
281    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO8PULL_DOWN_RESISTOR_A, O>;
282impl<'a, const O: u8> REG_GPIO_8_PD_W<'a, O> {
283    #[doc = "`0`"]
284    #[inline(always)]
285    pub fn disabled(self) -> &'a mut W {
286        self.variant(GPIO8PULL_DOWN_RESISTOR_A::DISABLED)
287    }
288    #[doc = "`1`"]
289    #[inline(always)]
290    pub fn enabled(self) -> &'a mut W {
291        self.variant(GPIO8PULL_DOWN_RESISTOR_A::ENABLED)
292    }
293}
294#[doc = "Field `reg_gpio_8_func_sel` reader - Function select for GPIO8."]
295pub type REG_GPIO_8_FUNC_SEL_R = crate::FieldReader<u8, GPIO8FUNCTION_SELECT_A>;
296#[doc = "Function select for GPIO8.\n\nValue on reset: 11"]
297#[derive(Clone, Copy, Debug, PartialEq, Eq)]
298#[repr(u8)]
299pub enum GPIO8FUNCTION_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_CH3 = 8,
308    #[doc = "9: `1001`"]
309    FEM_GPIO_0 = 9,
310    #[doc = "11: `1011`"]
311    SWGPIO_8 = 11,
312    #[doc = "14: `1110`"]
313    E21_TMS = 14,
314}
315impl From<GPIO8FUNCTION_SELECT_A> for u8 {
316    #[inline(always)]
317    fn from(variant: GPIO8FUNCTION_SELECT_A) -> Self {
318        variant as _
319    }
320}
321impl REG_GPIO_8_FUNC_SEL_R {
322    #[doc = "Get enumerated values variant"]
323    #[inline(always)]
324    pub fn variant(&self) -> Option<GPIO8FUNCTION_SELECT_A> {
325        match self.bits {
326            4 => Some(GPIO8FUNCTION_SELECT_A::SPI_MISO_SPI_MOSI),
327            6 => Some(GPIO8FUNCTION_SELECT_A::I2C_SCL),
328            7 => Some(GPIO8FUNCTION_SELECT_A::UART_SIG0),
329            8 => Some(GPIO8FUNCTION_SELECT_A::PWM_CH3),
330            9 => Some(GPIO8FUNCTION_SELECT_A::FEM_GPIO_0),
331            11 => Some(GPIO8FUNCTION_SELECT_A::SWGPIO_8),
332            14 => Some(GPIO8FUNCTION_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 == GPIO8FUNCTION_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 == GPIO8FUNCTION_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 == GPIO8FUNCTION_SELECT_A::UART_SIG0
350    }
351    #[doc = "Checks if the value of the field is `PWM_CH3`"]
352    #[inline(always)]
353    pub fn is_pwm_ch3(&self) -> bool {
354        *self == GPIO8FUNCTION_SELECT_A::PWM_CH3
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 == GPIO8FUNCTION_SELECT_A::FEM_GPIO_0
360    }
361    #[doc = "Checks if the value of the field is `SWGPIO_8`"]
362    #[inline(always)]
363    pub fn is_swgpio_8(&self) -> bool {
364        *self == GPIO8FUNCTION_SELECT_A::SWGPIO_8
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 == GPIO8FUNCTION_SELECT_A::E21_TMS
370    }
371}
372#[doc = "Field `reg_gpio_8_func_sel` writer - Function select for GPIO8."]
373pub type REG_GPIO_8_FUNC_SEL_W<'a, const O: u8> =
374    crate::FieldWriter<'a, u32, GPIO_CFGCTL4_SPEC, u8, GPIO8FUNCTION_SELECT_A, 4, O>;
375impl<'a, const O: u8> REG_GPIO_8_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(GPIO8FUNCTION_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(GPIO8FUNCTION_SELECT_A::I2C_SCL)
385    }
386    #[doc = "`111`"]
387    #[inline(always)]
388    pub fn uart_sig0(self) -> &'a mut W {
389        self.variant(GPIO8FUNCTION_SELECT_A::UART_SIG0)
390    }
391    #[doc = "`1000`"]
392    #[inline(always)]
393    pub fn pwm_ch3(self) -> &'a mut W {
394        self.variant(GPIO8FUNCTION_SELECT_A::PWM_CH3)
395    }
396    #[doc = "`1001`"]
397    #[inline(always)]
398    pub fn fem_gpio_0(self) -> &'a mut W {
399        self.variant(GPIO8FUNCTION_SELECT_A::FEM_GPIO_0)
400    }
401    #[doc = "`1011`"]
402    #[inline(always)]
403    pub fn swgpio_8(self) -> &'a mut W {
404        self.variant(GPIO8FUNCTION_SELECT_A::SWGPIO_8)
405    }
406    #[doc = "`1110`"]
407    #[inline(always)]
408    pub fn e21_tms(self) -> &'a mut W {
409        self.variant(GPIO8FUNCTION_SELECT_A::E21_TMS)
410    }
411}
412#[doc = "Field `reg_gpio_9_ie` reader - Input enable for GPIO9."]
413pub type REG_GPIO_9_IE_R = crate::BitReader<GPIO9INPUT_ENABLED_A>;
414#[doc = "Input enable for GPIO9.\n\nValue on reset: 1"]
415#[derive(Clone, Copy, Debug, PartialEq, Eq)]
416pub enum GPIO9INPUT_ENABLED_A {
417    #[doc = "0: `0`"]
418    DISABLED = 0,
419    #[doc = "1: `1`"]
420    ENABLED = 1,
421}
422impl From<GPIO9INPUT_ENABLED_A> for bool {
423    #[inline(always)]
424    fn from(variant: GPIO9INPUT_ENABLED_A) -> Self {
425        variant as u8 != 0
426    }
427}
428impl REG_GPIO_9_IE_R {
429    #[doc = "Get enumerated values variant"]
430    #[inline(always)]
431    pub fn variant(&self) -> GPIO9INPUT_ENABLED_A {
432        match self.bits {
433            false => GPIO9INPUT_ENABLED_A::DISABLED,
434            true => GPIO9INPUT_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 == GPIO9INPUT_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 == GPIO9INPUT_ENABLED_A::ENABLED
446    }
447}
448#[doc = "Field `reg_gpio_9_ie` writer - Input enable for GPIO9."]
449pub type REG_GPIO_9_IE_W<'a, const O: u8> =
450    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO9INPUT_ENABLED_A, O>;
451impl<'a, const O: u8> REG_GPIO_9_IE_W<'a, O> {
452    #[doc = "`0`"]
453    #[inline(always)]
454    pub fn disabled(self) -> &'a mut W {
455        self.variant(GPIO9INPUT_ENABLED_A::DISABLED)
456    }
457    #[doc = "`1`"]
458    #[inline(always)]
459    pub fn enabled(self) -> &'a mut W {
460        self.variant(GPIO9INPUT_ENABLED_A::ENABLED)
461    }
462}
463#[doc = "Field `reg_gpio_9_smt` reader - Schmitt trigger enabled for GPIO9."]
464pub type REG_GPIO_9_SMT_R = crate::BitReader<GPIO9SCHMITT_A>;
465#[doc = "Schmitt trigger enabled for GPIO9.\n\nValue on reset: 1"]
466#[derive(Clone, Copy, Debug, PartialEq, Eq)]
467pub enum GPIO9SCHMITT_A {
468    #[doc = "0: `0`"]
469    DISABLED = 0,
470    #[doc = "1: `1`"]
471    ENABLED = 1,
472}
473impl From<GPIO9SCHMITT_A> for bool {
474    #[inline(always)]
475    fn from(variant: GPIO9SCHMITT_A) -> Self {
476        variant as u8 != 0
477    }
478}
479impl REG_GPIO_9_SMT_R {
480    #[doc = "Get enumerated values variant"]
481    #[inline(always)]
482    pub fn variant(&self) -> GPIO9SCHMITT_A {
483        match self.bits {
484            false => GPIO9SCHMITT_A::DISABLED,
485            true => GPIO9SCHMITT_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 == GPIO9SCHMITT_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 == GPIO9SCHMITT_A::ENABLED
497    }
498}
499#[doc = "Field `reg_gpio_9_smt` writer - Schmitt trigger enabled for GPIO9."]
500pub type REG_GPIO_9_SMT_W<'a, const O: u8> =
501    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO9SCHMITT_A, O>;
502impl<'a, const O: u8> REG_GPIO_9_SMT_W<'a, O> {
503    #[doc = "`0`"]
504    #[inline(always)]
505    pub fn disabled(self) -> &'a mut W {
506        self.variant(GPIO9SCHMITT_A::DISABLED)
507    }
508    #[doc = "`1`"]
509    #[inline(always)]
510    pub fn enabled(self) -> &'a mut W {
511        self.variant(GPIO9SCHMITT_A::ENABLED)
512    }
513}
514#[doc = "Field `reg_gpio_9_drv` reader - Driving control enabled for GPIO9."]
515pub type REG_GPIO_9_DRV_R = crate::FieldReader<u8, GPIO9DRIVING_A>;
516#[doc = "Driving control enabled for GPIO9.\n\nValue on reset: 0"]
517#[derive(Clone, Copy, Debug, PartialEq, Eq)]
518#[repr(u8)]
519pub enum GPIO9DRIVING_A {
520    #[doc = "0: `0`"]
521    DISABLED = 0,
522    #[doc = "1: `1`"]
523    ENABLED = 1,
524}
525impl From<GPIO9DRIVING_A> for u8 {
526    #[inline(always)]
527    fn from(variant: GPIO9DRIVING_A) -> Self {
528        variant as _
529    }
530}
531impl REG_GPIO_9_DRV_R {
532    #[doc = "Get enumerated values variant"]
533    #[inline(always)]
534    pub fn variant(&self) -> Option<GPIO9DRIVING_A> {
535        match self.bits {
536            0 => Some(GPIO9DRIVING_A::DISABLED),
537            1 => Some(GPIO9DRIVING_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 == GPIO9DRIVING_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 == GPIO9DRIVING_A::ENABLED
550    }
551}
552#[doc = "Field `reg_gpio_9_drv` writer - Driving control enabled for GPIO9."]
553pub type REG_GPIO_9_DRV_W<'a, const O: u8> =
554    crate::FieldWriter<'a, u32, GPIO_CFGCTL4_SPEC, u8, GPIO9DRIVING_A, 2, O>;
555impl<'a, const O: u8> REG_GPIO_9_DRV_W<'a, O> {
556    #[doc = "`0`"]
557    #[inline(always)]
558    pub fn disabled(self) -> &'a mut W {
559        self.variant(GPIO9DRIVING_A::DISABLED)
560    }
561    #[doc = "`1`"]
562    #[inline(always)]
563    pub fn enabled(self) -> &'a mut W {
564        self.variant(GPIO9DRIVING_A::ENABLED)
565    }
566}
567#[doc = "Field `reg_gpio_9_pu` reader - Pull Up Resistor for GPIO9."]
568pub type REG_GPIO_9_PU_R = crate::BitReader<GPIO9PULL_UP_RESISTOR_A>;
569#[doc = "Pull Up Resistor for GPIO9.\n\nValue on reset: 0"]
570#[derive(Clone, Copy, Debug, PartialEq, Eq)]
571pub enum GPIO9PULL_UP_RESISTOR_A {
572    #[doc = "0: `0`"]
573    DISABLED = 0,
574    #[doc = "1: `1`"]
575    ENABLED = 1,
576}
577impl From<GPIO9PULL_UP_RESISTOR_A> for bool {
578    #[inline(always)]
579    fn from(variant: GPIO9PULL_UP_RESISTOR_A) -> Self {
580        variant as u8 != 0
581    }
582}
583impl REG_GPIO_9_PU_R {
584    #[doc = "Get enumerated values variant"]
585    #[inline(always)]
586    pub fn variant(&self) -> GPIO9PULL_UP_RESISTOR_A {
587        match self.bits {
588            false => GPIO9PULL_UP_RESISTOR_A::DISABLED,
589            true => GPIO9PULL_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 == GPIO9PULL_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 == GPIO9PULL_UP_RESISTOR_A::ENABLED
601    }
602}
603#[doc = "Field `reg_gpio_9_pu` writer - Pull Up Resistor for GPIO9."]
604pub type REG_GPIO_9_PU_W<'a, const O: u8> =
605    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO9PULL_UP_RESISTOR_A, O>;
606impl<'a, const O: u8> REG_GPIO_9_PU_W<'a, O> {
607    #[doc = "`0`"]
608    #[inline(always)]
609    pub fn disabled(self) -> &'a mut W {
610        self.variant(GPIO9PULL_UP_RESISTOR_A::DISABLED)
611    }
612    #[doc = "`1`"]
613    #[inline(always)]
614    pub fn enabled(self) -> &'a mut W {
615        self.variant(GPIO9PULL_UP_RESISTOR_A::ENABLED)
616    }
617}
618#[doc = "Field `reg_gpio_9_pd` reader - Pull Down Resistor for GPIO9."]
619pub type REG_GPIO_9_PD_R = crate::BitReader<GPIO9PULL_DOWN_RESISTOR_A>;
620#[doc = "Pull Down Resistor for GPIO9.\n\nValue on reset: 0"]
621#[derive(Clone, Copy, Debug, PartialEq, Eq)]
622pub enum GPIO9PULL_DOWN_RESISTOR_A {
623    #[doc = "0: `0`"]
624    DISABLED = 0,
625    #[doc = "1: `1`"]
626    ENABLED = 1,
627}
628impl From<GPIO9PULL_DOWN_RESISTOR_A> for bool {
629    #[inline(always)]
630    fn from(variant: GPIO9PULL_DOWN_RESISTOR_A) -> Self {
631        variant as u8 != 0
632    }
633}
634impl REG_GPIO_9_PD_R {
635    #[doc = "Get enumerated values variant"]
636    #[inline(always)]
637    pub fn variant(&self) -> GPIO9PULL_DOWN_RESISTOR_A {
638        match self.bits {
639            false => GPIO9PULL_DOWN_RESISTOR_A::DISABLED,
640            true => GPIO9PULL_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 == GPIO9PULL_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 == GPIO9PULL_DOWN_RESISTOR_A::ENABLED
652    }
653}
654#[doc = "Field `reg_gpio_9_pd` writer - Pull Down Resistor for GPIO9."]
655pub type REG_GPIO_9_PD_W<'a, const O: u8> =
656    crate::BitWriter<'a, u32, GPIO_CFGCTL4_SPEC, GPIO9PULL_DOWN_RESISTOR_A, O>;
657impl<'a, const O: u8> REG_GPIO_9_PD_W<'a, O> {
658    #[doc = "`0`"]
659    #[inline(always)]
660    pub fn disabled(self) -> &'a mut W {
661        self.variant(GPIO9PULL_DOWN_RESISTOR_A::DISABLED)
662    }
663    #[doc = "`1`"]
664    #[inline(always)]
665    pub fn enabled(self) -> &'a mut W {
666        self.variant(GPIO9PULL_DOWN_RESISTOR_A::ENABLED)
667    }
668}
669#[doc = "Field `reg_gpio_9_func_sel` reader - Function select for GPIO9."]
670pub type REG_GPIO_9_FUNC_SEL_R = crate::FieldReader<u8, GPIO9FUNCTION_SELECT_A>;
671#[doc = "Function select for GPIO9.\n\nValue on reset: 11"]
672#[derive(Clone, Copy, Debug, PartialEq, Eq)]
673#[repr(u8)]
674pub enum GPIO9FUNCTION_SELECT_A {
675    #[doc = "4: `100`"]
676    SPI_MOSI_SPI_MISO = 4,
677    #[doc = "6: `110`"]
678    I2C_SDA = 6,
679    #[doc = "7: `111`"]
680    UART_SIG1 = 7,
681    #[doc = "8: `1000`"]
682    PWM_CH4 = 8,
683    #[doc = "9: `1001`"]
684    FEM_GPIO_1 = 9,
685    #[doc = "10: `1010`"]
686    GPIP_CH6_GPIP_CH7 = 10,
687    #[doc = "11: `1011`"]
688    SWGPIO_9 = 11,
689    #[doc = "14: `1110`"]
690    E21_TDI = 14,
691}
692impl From<GPIO9FUNCTION_SELECT_A> for u8 {
693    #[inline(always)]
694    fn from(variant: GPIO9FUNCTION_SELECT_A) -> Self {
695        variant as _
696    }
697}
698impl REG_GPIO_9_FUNC_SEL_R {
699    #[doc = "Get enumerated values variant"]
700    #[inline(always)]
701    pub fn variant(&self) -> Option<GPIO9FUNCTION_SELECT_A> {
702        match self.bits {
703            4 => Some(GPIO9FUNCTION_SELECT_A::SPI_MOSI_SPI_MISO),
704            6 => Some(GPIO9FUNCTION_SELECT_A::I2C_SDA),
705            7 => Some(GPIO9FUNCTION_SELECT_A::UART_SIG1),
706            8 => Some(GPIO9FUNCTION_SELECT_A::PWM_CH4),
707            9 => Some(GPIO9FUNCTION_SELECT_A::FEM_GPIO_1),
708            10 => Some(GPIO9FUNCTION_SELECT_A::GPIP_CH6_GPIP_CH7),
709            11 => Some(GPIO9FUNCTION_SELECT_A::SWGPIO_9),
710            14 => Some(GPIO9FUNCTION_SELECT_A::E21_TDI),
711            _ => None,
712        }
713    }
714    #[doc = "Checks if the value of the field is `SPI_MOSI_SPI_MISO`"]
715    #[inline(always)]
716    pub fn is_spi_mosi_spi_miso(&self) -> bool {
717        *self == GPIO9FUNCTION_SELECT_A::SPI_MOSI_SPI_MISO
718    }
719    #[doc = "Checks if the value of the field is `I2C_SDA`"]
720    #[inline(always)]
721    pub fn is_i2c_sda(&self) -> bool {
722        *self == GPIO9FUNCTION_SELECT_A::I2C_SDA
723    }
724    #[doc = "Checks if the value of the field is `UART_SIG1`"]
725    #[inline(always)]
726    pub fn is_uart_sig1(&self) -> bool {
727        *self == GPIO9FUNCTION_SELECT_A::UART_SIG1
728    }
729    #[doc = "Checks if the value of the field is `PWM_CH4`"]
730    #[inline(always)]
731    pub fn is_pwm_ch4(&self) -> bool {
732        *self == GPIO9FUNCTION_SELECT_A::PWM_CH4
733    }
734    #[doc = "Checks if the value of the field is `FEM_GPIO_1`"]
735    #[inline(always)]
736    pub fn is_fem_gpio_1(&self) -> bool {
737        *self == GPIO9FUNCTION_SELECT_A::FEM_GPIO_1
738    }
739    #[doc = "Checks if the value of the field is `GPIP_CH6_GPIP_CH7`"]
740    #[inline(always)]
741    pub fn is_gpip_ch6_gpip_ch7(&self) -> bool {
742        *self == GPIO9FUNCTION_SELECT_A::GPIP_CH6_GPIP_CH7
743    }
744    #[doc = "Checks if the value of the field is `SWGPIO_9`"]
745    #[inline(always)]
746    pub fn is_swgpio_9(&self) -> bool {
747        *self == GPIO9FUNCTION_SELECT_A::SWGPIO_9
748    }
749    #[doc = "Checks if the value of the field is `E21_TDI`"]
750    #[inline(always)]
751    pub fn is_e21_tdi(&self) -> bool {
752        *self == GPIO9FUNCTION_SELECT_A::E21_TDI
753    }
754}
755#[doc = "Field `reg_gpio_9_func_sel` writer - Function select for GPIO9."]
756pub type REG_GPIO_9_FUNC_SEL_W<'a, const O: u8> =
757    crate::FieldWriter<'a, u32, GPIO_CFGCTL4_SPEC, u8, GPIO9FUNCTION_SELECT_A, 4, O>;
758impl<'a, const O: u8> REG_GPIO_9_FUNC_SEL_W<'a, O> {
759    #[doc = "`100`"]
760    #[inline(always)]
761    pub fn spi_mosi_spi_miso(self) -> &'a mut W {
762        self.variant(GPIO9FUNCTION_SELECT_A::SPI_MOSI_SPI_MISO)
763    }
764    #[doc = "`110`"]
765    #[inline(always)]
766    pub fn i2c_sda(self) -> &'a mut W {
767        self.variant(GPIO9FUNCTION_SELECT_A::I2C_SDA)
768    }
769    #[doc = "`111`"]
770    #[inline(always)]
771    pub fn uart_sig1(self) -> &'a mut W {
772        self.variant(GPIO9FUNCTION_SELECT_A::UART_SIG1)
773    }
774    #[doc = "`1000`"]
775    #[inline(always)]
776    pub fn pwm_ch4(self) -> &'a mut W {
777        self.variant(GPIO9FUNCTION_SELECT_A::PWM_CH4)
778    }
779    #[doc = "`1001`"]
780    #[inline(always)]
781    pub fn fem_gpio_1(self) -> &'a mut W {
782        self.variant(GPIO9FUNCTION_SELECT_A::FEM_GPIO_1)
783    }
784    #[doc = "`1010`"]
785    #[inline(always)]
786    pub fn gpip_ch6_gpip_ch7(self) -> &'a mut W {
787        self.variant(GPIO9FUNCTION_SELECT_A::GPIP_CH6_GPIP_CH7)
788    }
789    #[doc = "`1011`"]
790    #[inline(always)]
791    pub fn swgpio_9(self) -> &'a mut W {
792        self.variant(GPIO9FUNCTION_SELECT_A::SWGPIO_9)
793    }
794    #[doc = "`1110`"]
795    #[inline(always)]
796    pub fn e21_tdi(self) -> &'a mut W {
797        self.variant(GPIO9FUNCTION_SELECT_A::E21_TDI)
798    }
799}
800impl R {
801    #[doc = "Bit 0 - Input enable for GPIO8."]
802    #[inline(always)]
803    pub fn reg_gpio_8_ie(&self) -> REG_GPIO_8_IE_R {
804        REG_GPIO_8_IE_R::new((self.bits & 1) != 0)
805    }
806    #[doc = "Bit 1 - Schmitt trigger enabled for GPIO8."]
807    #[inline(always)]
808    pub fn reg_gpio_8_smt(&self) -> REG_GPIO_8_SMT_R {
809        REG_GPIO_8_SMT_R::new(((self.bits >> 1) & 1) != 0)
810    }
811    #[doc = "Bits 2:3 - Driving control enabled for GPIO8."]
812    #[inline(always)]
813    pub fn reg_gpio_8_drv(&self) -> REG_GPIO_8_DRV_R {
814        REG_GPIO_8_DRV_R::new(((self.bits >> 2) & 3) as u8)
815    }
816    #[doc = "Bit 4 - Pull Up Resistor for GPIO8."]
817    #[inline(always)]
818    pub fn reg_gpio_8_pu(&self) -> REG_GPIO_8_PU_R {
819        REG_GPIO_8_PU_R::new(((self.bits >> 4) & 1) != 0)
820    }
821    #[doc = "Bit 5 - Pull Down Resistor for GPIO8."]
822    #[inline(always)]
823    pub fn reg_gpio_8_pd(&self) -> REG_GPIO_8_PD_R {
824        REG_GPIO_8_PD_R::new(((self.bits >> 5) & 1) != 0)
825    }
826    #[doc = "Bits 8:11 - Function select for GPIO8."]
827    #[inline(always)]
828    pub fn reg_gpio_8_func_sel(&self) -> REG_GPIO_8_FUNC_SEL_R {
829        REG_GPIO_8_FUNC_SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
830    }
831    #[doc = "Bit 16 - Input enable for GPIO9."]
832    #[inline(always)]
833    pub fn reg_gpio_9_ie(&self) -> REG_GPIO_9_IE_R {
834        REG_GPIO_9_IE_R::new(((self.bits >> 16) & 1) != 0)
835    }
836    #[doc = "Bit 17 - Schmitt trigger enabled for GPIO9."]
837    #[inline(always)]
838    pub fn reg_gpio_9_smt(&self) -> REG_GPIO_9_SMT_R {
839        REG_GPIO_9_SMT_R::new(((self.bits >> 17) & 1) != 0)
840    }
841    #[doc = "Bits 18:19 - Driving control enabled for GPIO9."]
842    #[inline(always)]
843    pub fn reg_gpio_9_drv(&self) -> REG_GPIO_9_DRV_R {
844        REG_GPIO_9_DRV_R::new(((self.bits >> 18) & 3) as u8)
845    }
846    #[doc = "Bit 20 - Pull Up Resistor for GPIO9."]
847    #[inline(always)]
848    pub fn reg_gpio_9_pu(&self) -> REG_GPIO_9_PU_R {
849        REG_GPIO_9_PU_R::new(((self.bits >> 20) & 1) != 0)
850    }
851    #[doc = "Bit 21 - Pull Down Resistor for GPIO9."]
852    #[inline(always)]
853    pub fn reg_gpio_9_pd(&self) -> REG_GPIO_9_PD_R {
854        REG_GPIO_9_PD_R::new(((self.bits >> 21) & 1) != 0)
855    }
856    #[doc = "Bits 24:27 - Function select for GPIO9."]
857    #[inline(always)]
858    pub fn reg_gpio_9_func_sel(&self) -> REG_GPIO_9_FUNC_SEL_R {
859        REG_GPIO_9_FUNC_SEL_R::new(((self.bits >> 24) & 0x0f) as u8)
860    }
861}
862impl W {
863    #[doc = "Bit 0 - Input enable for GPIO8."]
864    #[inline(always)]
865    #[must_use]
866    pub fn reg_gpio_8_ie(&mut self) -> REG_GPIO_8_IE_W<0> {
867        REG_GPIO_8_IE_W::new(self)
868    }
869    #[doc = "Bit 1 - Schmitt trigger enabled for GPIO8."]
870    #[inline(always)]
871    #[must_use]
872    pub fn reg_gpio_8_smt(&mut self) -> REG_GPIO_8_SMT_W<1> {
873        REG_GPIO_8_SMT_W::new(self)
874    }
875    #[doc = "Bits 2:3 - Driving control enabled for GPIO8."]
876    #[inline(always)]
877    #[must_use]
878    pub fn reg_gpio_8_drv(&mut self) -> REG_GPIO_8_DRV_W<2> {
879        REG_GPIO_8_DRV_W::new(self)
880    }
881    #[doc = "Bit 4 - Pull Up Resistor for GPIO8."]
882    #[inline(always)]
883    #[must_use]
884    pub fn reg_gpio_8_pu(&mut self) -> REG_GPIO_8_PU_W<4> {
885        REG_GPIO_8_PU_W::new(self)
886    }
887    #[doc = "Bit 5 - Pull Down Resistor for GPIO8."]
888    #[inline(always)]
889    #[must_use]
890    pub fn reg_gpio_8_pd(&mut self) -> REG_GPIO_8_PD_W<5> {
891        REG_GPIO_8_PD_W::new(self)
892    }
893    #[doc = "Bits 8:11 - Function select for GPIO8."]
894    #[inline(always)]
895    #[must_use]
896    pub fn reg_gpio_8_func_sel(&mut self) -> REG_GPIO_8_FUNC_SEL_W<8> {
897        REG_GPIO_8_FUNC_SEL_W::new(self)
898    }
899    #[doc = "Bit 16 - Input enable for GPIO9."]
900    #[inline(always)]
901    #[must_use]
902    pub fn reg_gpio_9_ie(&mut self) -> REG_GPIO_9_IE_W<16> {
903        REG_GPIO_9_IE_W::new(self)
904    }
905    #[doc = "Bit 17 - Schmitt trigger enabled for GPIO9."]
906    #[inline(always)]
907    #[must_use]
908    pub fn reg_gpio_9_smt(&mut self) -> REG_GPIO_9_SMT_W<17> {
909        REG_GPIO_9_SMT_W::new(self)
910    }
911    #[doc = "Bits 18:19 - Driving control enabled for GPIO9."]
912    #[inline(always)]
913    #[must_use]
914    pub fn reg_gpio_9_drv(&mut self) -> REG_GPIO_9_DRV_W<18> {
915        REG_GPIO_9_DRV_W::new(self)
916    }
917    #[doc = "Bit 20 - Pull Up Resistor for GPIO9."]
918    #[inline(always)]
919    #[must_use]
920    pub fn reg_gpio_9_pu(&mut self) -> REG_GPIO_9_PU_W<20> {
921        REG_GPIO_9_PU_W::new(self)
922    }
923    #[doc = "Bit 21 - Pull Down Resistor for GPIO9."]
924    #[inline(always)]
925    #[must_use]
926    pub fn reg_gpio_9_pd(&mut self) -> REG_GPIO_9_PD_W<21> {
927        REG_GPIO_9_PD_W::new(self)
928    }
929    #[doc = "Bits 24:27 - Function select for GPIO9."]
930    #[inline(always)]
931    #[must_use]
932    pub fn reg_gpio_9_func_sel(&mut self) -> REG_GPIO_9_FUNC_SEL_W<24> {
933        REG_GPIO_9_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 = "GPIO8, GPIO9 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_cfgctl4](index.html) module"]
943pub struct GPIO_CFGCTL4_SPEC;
944impl crate::RegisterSpec for GPIO_CFGCTL4_SPEC {
945    type Ux = u32;
946}
947#[doc = "`read()` method returns [gpio_cfgctl4::R](R) reader structure"]
948impl crate::Readable for GPIO_CFGCTL4_SPEC {
949    type Reader = R;
950}
951#[doc = "`write(|w| ..)` method takes [gpio_cfgctl4::W](W) writer structure"]
952impl crate::Writable for GPIO_CFGCTL4_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_CFGCTL4 to value 0x0b03_0b03"]
958impl crate::Resettable for GPIO_CFGCTL4_SPEC {
959    const RESET_VALUE: Self::Ux = 0x0b03_0b03;
960}