d1_pac/gpio/
pio_pow_val.rs

1#[doc = "Register `pio_pow_val` reader"]
2pub type R = crate::R<PIO_POW_VAL_SPEC>;
3#[doc = "Field `p_pwr_val[C,D,E,F,G]` reader - PX_Port Power Value"]
4pub type P_PWR_VAL_R = crate::BitReader;
5#[doc = "Field `vccio_pws_val` reader - VCC_IO Power Value"]
6pub type VCCIO_PWS_VAL_R = crate::BitReader;
7impl R {
8    #[doc = "PX_Port Power Value\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `pC_pwr_val` field"]
9    #[inline(always)]
10    pub fn p_pwr_val(&self, n: u8) -> P_PWR_VAL_R {
11        #[allow(clippy::no_effect)]
12        [(); 5][n as usize];
13        P_PWR_VAL_R::new(((self.bits >> (n + 2)) & 1) != 0)
14    }
15    #[doc = "Bit 2 - PX_Port Power Value"]
16    #[inline(always)]
17    pub fn p_c_pwr_val(&self) -> P_PWR_VAL_R {
18        P_PWR_VAL_R::new(((self.bits >> 2) & 1) != 0)
19    }
20    #[doc = "Bit 3 - PX_Port Power Value"]
21    #[inline(always)]
22    pub fn p_d_pwr_val(&self) -> P_PWR_VAL_R {
23        P_PWR_VAL_R::new(((self.bits >> 3) & 1) != 0)
24    }
25    #[doc = "Bit 4 - PX_Port Power Value"]
26    #[inline(always)]
27    pub fn p_e_pwr_val(&self) -> P_PWR_VAL_R {
28        P_PWR_VAL_R::new(((self.bits >> 4) & 1) != 0)
29    }
30    #[doc = "Bit 5 - PX_Port Power Value"]
31    #[inline(always)]
32    pub fn p_f_pwr_val(&self) -> P_PWR_VAL_R {
33        P_PWR_VAL_R::new(((self.bits >> 5) & 1) != 0)
34    }
35    #[doc = "Bit 6 - PX_Port Power Value"]
36    #[inline(always)]
37    pub fn p_g_pwr_val(&self) -> P_PWR_VAL_R {
38        P_PWR_VAL_R::new(((self.bits >> 6) & 1) != 0)
39    }
40    #[doc = "Bit 12 - VCC_IO Power Value"]
41    #[inline(always)]
42    pub fn vccio_pws_val(&self) -> VCCIO_PWS_VAL_R {
43        VCCIO_PWS_VAL_R::new(((self.bits >> 12) & 1) != 0)
44    }
45}
46#[doc = "PIO Group Power Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pio_pow_val::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct PIO_POW_VAL_SPEC;
48impl crate::RegisterSpec for PIO_POW_VAL_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`pio_pow_val::R`](R) reader structure"]
52impl crate::Readable for PIO_POW_VAL_SPEC {}
53#[doc = "`reset()` method sets pio_pow_val to value 0"]
54impl crate::Resettable for PIO_POW_VAL_SPEC {
55    const RESET_VALUE: Self::Ux = 0;
56}