bl61x_pac/pds/
pds_ctl5.rs

1#[doc = "Register `PDS_CTL5` reader"]
2pub type R = crate::R<PDS_CTL5_SPEC>;
3#[doc = "Register `PDS_CTL5` writer"]
4pub type W = crate::W<PDS_CTL5_SPEC>;
5#[doc = "Field `cr_np_wfi_mask` reader - "]
6pub type CR_NP_WFI_MASK_R = crate::BitReader;
7#[doc = "Field `cr_np_wfi_mask` writer - "]
8pub type CR_NP_WFI_MASK_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `cr_pds_pad_od_en` reader - "]
10pub type CR_PDS_PAD_OD_EN_R = crate::BitReader;
11#[doc = "Field `cr_pds_pad_od_en` writer - "]
12pub type CR_PDS_PAD_OD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `cr_pds_ctrl_usb33` reader - "]
14pub type CR_PDS_CTRL_USB33_R = crate::BitReader;
15#[doc = "Field `cr_pds_ctrl_usb33` writer - "]
16pub type CR_PDS_CTRL_USB33_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `cr_pds_pd_ldo18io` reader - "]
18pub type CR_PDS_PD_LDO18IO_R = crate::BitReader;
19#[doc = "Field `cr_pds_pd_ldo18io` writer - "]
20pub type CR_PDS_PD_LDO18IO_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `cr_pds_gpio_keep_en` reader - "]
22pub type CR_PDS_GPIO_KEEP_EN_R = crate::FieldReader;
23#[doc = "Field `cr_pds_gpio_keep_en` writer - "]
24pub type CR_PDS_GPIO_KEEP_EN_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
25impl R {
26    #[doc = "Bit 0"]
27    #[inline(always)]
28    pub fn cr_np_wfi_mask(&self) -> CR_NP_WFI_MASK_R {
29        CR_NP_WFI_MASK_R::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1"]
32    #[inline(always)]
33    pub fn cr_pds_pad_od_en(&self) -> CR_PDS_PAD_OD_EN_R {
34        CR_PDS_PAD_OD_EN_R::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 8"]
37    #[inline(always)]
38    pub fn cr_pds_ctrl_usb33(&self) -> CR_PDS_CTRL_USB33_R {
39        CR_PDS_CTRL_USB33_R::new(((self.bits >> 8) & 1) != 0)
40    }
41    #[doc = "Bit 9"]
42    #[inline(always)]
43    pub fn cr_pds_pd_ldo18io(&self) -> CR_PDS_PD_LDO18IO_R {
44        CR_PDS_PD_LDO18IO_R::new(((self.bits >> 9) & 1) != 0)
45    }
46    #[doc = "Bits 16:18"]
47    #[inline(always)]
48    pub fn cr_pds_gpio_keep_en(&self) -> CR_PDS_GPIO_KEEP_EN_R {
49        CR_PDS_GPIO_KEEP_EN_R::new(((self.bits >> 16) & 7) as u8)
50    }
51}
52impl W {
53    #[doc = "Bit 0"]
54    #[inline(always)]
55    #[must_use]
56    pub fn cr_np_wfi_mask(&mut self) -> CR_NP_WFI_MASK_W<PDS_CTL5_SPEC> {
57        CR_NP_WFI_MASK_W::new(self, 0)
58    }
59    #[doc = "Bit 1"]
60    #[inline(always)]
61    #[must_use]
62    pub fn cr_pds_pad_od_en(&mut self) -> CR_PDS_PAD_OD_EN_W<PDS_CTL5_SPEC> {
63        CR_PDS_PAD_OD_EN_W::new(self, 1)
64    }
65    #[doc = "Bit 8"]
66    #[inline(always)]
67    #[must_use]
68    pub fn cr_pds_ctrl_usb33(&mut self) -> CR_PDS_CTRL_USB33_W<PDS_CTL5_SPEC> {
69        CR_PDS_CTRL_USB33_W::new(self, 8)
70    }
71    #[doc = "Bit 9"]
72    #[inline(always)]
73    #[must_use]
74    pub fn cr_pds_pd_ldo18io(&mut self) -> CR_PDS_PD_LDO18IO_W<PDS_CTL5_SPEC> {
75        CR_PDS_PD_LDO18IO_W::new(self, 9)
76    }
77    #[doc = "Bits 16:18"]
78    #[inline(always)]
79    #[must_use]
80    pub fn cr_pds_gpio_keep_en(&mut self) -> CR_PDS_GPIO_KEEP_EN_W<PDS_CTL5_SPEC> {
81        CR_PDS_GPIO_KEEP_EN_W::new(self, 16)
82    }
83    #[doc = r" Writes raw bits to the register."]
84    #[doc = r""]
85    #[doc = r" # Safety"]
86    #[doc = r""]
87    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
88    #[inline(always)]
89    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
90        self.bits = bits;
91        self
92    }
93}
94#[doc = "PDS_CTL5.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pds_ctl5::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 [`pds_ctl5::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
95pub struct PDS_CTL5_SPEC;
96impl crate::RegisterSpec for PDS_CTL5_SPEC {
97    type Ux = u32;
98}
99#[doc = "`read()` method returns [`pds_ctl5::R`](R) reader structure"]
100impl crate::Readable for PDS_CTL5_SPEC {}
101#[doc = "`write(|w| ..)` method takes [`pds_ctl5::W`](W) writer structure"]
102impl crate::Writable for PDS_CTL5_SPEC {
103    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
104    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
105}
106#[doc = "`reset()` method sets PDS_CTL5 to value 0"]
107impl crate::Resettable for PDS_CTL5_SPEC {
108    const RESET_VALUE: Self::Ux = 0;
109}