d1_pac/gpio/
pio_pow_vol_sel_ctl.rs1#[doc = "Register `pio_pow_vol_sel_ctl` reader"]
2pub type R = crate::R<PIO_POW_VOL_SEL_CTL_SPEC>;
3#[doc = "Register `pio_pow_vol_sel_ctl` writer"]
4pub type W = crate::W<PIO_POW_VOL_SEL_CTL_SPEC>;
5#[doc = "Field `vcc_pf_pwr_vol_sel` reader - VCC_PF Power Voltage Select Control"]
6pub type VCC_PF_PWR_VOL_SEL_R = crate::BitReader<VCC_PF_PWR_VOL_SEL_A>;
7#[doc = "VCC_PF Power Voltage Select Control\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum VCC_PF_PWR_VOL_SEL_A {
10 #[doc = "0: 1.8V"]
11 V18 = 0,
12 #[doc = "1: 3.3V"]
13 V33 = 1,
14}
15impl From<VCC_PF_PWR_VOL_SEL_A> for bool {
16 #[inline(always)]
17 fn from(variant: VCC_PF_PWR_VOL_SEL_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl VCC_PF_PWR_VOL_SEL_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> VCC_PF_PWR_VOL_SEL_A {
25 match self.bits {
26 false => VCC_PF_PWR_VOL_SEL_A::V18,
27 true => VCC_PF_PWR_VOL_SEL_A::V33,
28 }
29 }
30 #[doc = "1.8V"]
31 #[inline(always)]
32 pub fn is_v18(&self) -> bool {
33 *self == VCC_PF_PWR_VOL_SEL_A::V18
34 }
35 #[doc = "3.3V"]
36 #[inline(always)]
37 pub fn is_v33(&self) -> bool {
38 *self == VCC_PF_PWR_VOL_SEL_A::V33
39 }
40}
41#[doc = "Field `vcc_pf_pwr_vol_sel` writer - VCC_PF Power Voltage Select Control"]
42pub type VCC_PF_PWR_VOL_SEL_W<'a, REG> = crate::BitWriter<'a, REG, VCC_PF_PWR_VOL_SEL_A>;
43impl<'a, REG> VCC_PF_PWR_VOL_SEL_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "1.8V"]
48 #[inline(always)]
49 pub fn v18(self) -> &'a mut crate::W<REG> {
50 self.variant(VCC_PF_PWR_VOL_SEL_A::V18)
51 }
52 #[doc = "3.3V"]
53 #[inline(always)]
54 pub fn v33(self) -> &'a mut crate::W<REG> {
55 self.variant(VCC_PF_PWR_VOL_SEL_A::V33)
56 }
57}
58impl R {
59 #[doc = "Bit 0 - VCC_PF Power Voltage Select Control"]
60 #[inline(always)]
61 pub fn vcc_pf_pwr_vol_sel(&self) -> VCC_PF_PWR_VOL_SEL_R {
62 VCC_PF_PWR_VOL_SEL_R::new((self.bits & 1) != 0)
63 }
64}
65impl W {
66 #[doc = "Bit 0 - VCC_PF Power Voltage Select Control"]
67 #[inline(always)]
68 #[must_use]
69 pub fn vcc_pf_pwr_vol_sel(&mut self) -> VCC_PF_PWR_VOL_SEL_W<PIO_POW_VOL_SEL_CTL_SPEC> {
70 VCC_PF_PWR_VOL_SEL_W::new(self, 0)
71 }
72 #[doc = r" Writes raw bits to the register."]
73 #[doc = r""]
74 #[doc = r" # Safety"]
75 #[doc = r""]
76 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
77 #[inline(always)]
78 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
79 self.bits = bits;
80 self
81 }
82}
83#[doc = "PIO Group Power Voltage Select Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pio_pow_vol_sel_ctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pio_pow_vol_sel_ctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
84pub struct PIO_POW_VOL_SEL_CTL_SPEC;
85impl crate::RegisterSpec for PIO_POW_VOL_SEL_CTL_SPEC {
86 type Ux = u32;
87}
88#[doc = "`read()` method returns [`pio_pow_vol_sel_ctl::R`](R) reader structure"]
89impl crate::Readable for PIO_POW_VOL_SEL_CTL_SPEC {}
90#[doc = "`write(|w| ..)` method takes [`pio_pow_vol_sel_ctl::W`](W) writer structure"]
91impl crate::Writable for PIO_POW_VOL_SEL_CTL_SPEC {
92 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
93 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
94}
95#[doc = "`reset()` method sets pio_pow_vol_sel_ctl to value 0"]
96impl crate::Resettable for PIO_POW_VOL_SEL_CTL_SPEC {
97 const RESET_VALUE: Self::Ux = 0;
98}