esp32p4/pvt/
pmup_drv_cfg.rs1#[doc = "Register `PMUP_DRV_CFG` reader"]
2pub type R = crate::R<PMUP_DRV_CFG_SPEC>;
3#[doc = "Register `PMUP_DRV_CFG` writer"]
4pub type W = crate::W<PMUP_DRV_CFG_SPEC>;
5#[doc = "Field `PUMP_EN` reader - configure pvt charge xpd"]
6pub type PUMP_EN_R = crate::BitReader;
7#[doc = "Field `PUMP_EN` writer - configure pvt charge xpd"]
8pub type PUMP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CLK_EN` reader - force register clken"]
10pub type CLK_EN_R = crate::BitReader;
11#[doc = "Field `CLK_EN` writer - force register clken"]
12pub type CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `PUMP_DRV4` reader - configure cmd4 drv"]
14pub type PUMP_DRV4_R = crate::FieldReader;
15#[doc = "Field `PUMP_DRV4` writer - configure cmd4 drv"]
16pub type PUMP_DRV4_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17#[doc = "Field `PUMP_DRV3` reader - configure cmd3 drv"]
18pub type PUMP_DRV3_R = crate::FieldReader;
19#[doc = "Field `PUMP_DRV3` writer - configure cmd3 drv"]
20pub type PUMP_DRV3_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
21#[doc = "Field `PUMP_DRV2` reader - configure cmd2 drv"]
22pub type PUMP_DRV2_R = crate::FieldReader;
23#[doc = "Field `PUMP_DRV2` writer - configure cmd2 drv"]
24pub type PUMP_DRV2_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25#[doc = "Field `PUMP_DRV1` reader - configure cmd1 drv"]
26pub type PUMP_DRV1_R = crate::FieldReader;
27#[doc = "Field `PUMP_DRV1` writer - configure cmd1 drv"]
28pub type PUMP_DRV1_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
29#[doc = "Field `PUMP_DRV0` reader - configure cmd0 drv"]
30pub type PUMP_DRV0_R = crate::FieldReader;
31#[doc = "Field `PUMP_DRV0` writer - configure cmd0 drv"]
32pub type PUMP_DRV0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
33impl R {
34 #[doc = "Bit 9 - configure pvt charge xpd"]
35 #[inline(always)]
36 pub fn pump_en(&self) -> PUMP_EN_R {
37 PUMP_EN_R::new(((self.bits >> 9) & 1) != 0)
38 }
39 #[doc = "Bit 10 - force register clken"]
40 #[inline(always)]
41 pub fn clk_en(&self) -> CLK_EN_R {
42 CLK_EN_R::new(((self.bits >> 10) & 1) != 0)
43 }
44 #[doc = "Bits 11:14 - configure cmd4 drv"]
45 #[inline(always)]
46 pub fn pump_drv4(&self) -> PUMP_DRV4_R {
47 PUMP_DRV4_R::new(((self.bits >> 11) & 0x0f) as u8)
48 }
49 #[doc = "Bits 15:18 - configure cmd3 drv"]
50 #[inline(always)]
51 pub fn pump_drv3(&self) -> PUMP_DRV3_R {
52 PUMP_DRV3_R::new(((self.bits >> 15) & 0x0f) as u8)
53 }
54 #[doc = "Bits 19:22 - configure cmd2 drv"]
55 #[inline(always)]
56 pub fn pump_drv2(&self) -> PUMP_DRV2_R {
57 PUMP_DRV2_R::new(((self.bits >> 19) & 0x0f) as u8)
58 }
59 #[doc = "Bits 23:26 - configure cmd1 drv"]
60 #[inline(always)]
61 pub fn pump_drv1(&self) -> PUMP_DRV1_R {
62 PUMP_DRV1_R::new(((self.bits >> 23) & 0x0f) as u8)
63 }
64 #[doc = "Bits 27:30 - configure cmd0 drv"]
65 #[inline(always)]
66 pub fn pump_drv0(&self) -> PUMP_DRV0_R {
67 PUMP_DRV0_R::new(((self.bits >> 27) & 0x0f) as u8)
68 }
69}
70#[cfg(feature = "impl-register-debug")]
71impl core::fmt::Debug for R {
72 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
73 f.debug_struct("PMUP_DRV_CFG")
74 .field("pump_en", &format_args!("{}", self.pump_en().bit()))
75 .field("clk_en", &format_args!("{}", self.clk_en().bit()))
76 .field("pump_drv4", &format_args!("{}", self.pump_drv4().bits()))
77 .field("pump_drv3", &format_args!("{}", self.pump_drv3().bits()))
78 .field("pump_drv2", &format_args!("{}", self.pump_drv2().bits()))
79 .field("pump_drv1", &format_args!("{}", self.pump_drv1().bits()))
80 .field("pump_drv0", &format_args!("{}", self.pump_drv0().bits()))
81 .finish()
82 }
83}
84#[cfg(feature = "impl-register-debug")]
85impl core::fmt::Debug for crate::generic::Reg<PMUP_DRV_CFG_SPEC> {
86 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
87 core::fmt::Debug::fmt(&self.read(), f)
88 }
89}
90impl W {
91 #[doc = "Bit 9 - configure pvt charge xpd"]
92 #[inline(always)]
93 #[must_use]
94 pub fn pump_en(&mut self) -> PUMP_EN_W<PMUP_DRV_CFG_SPEC> {
95 PUMP_EN_W::new(self, 9)
96 }
97 #[doc = "Bit 10 - force register clken"]
98 #[inline(always)]
99 #[must_use]
100 pub fn clk_en(&mut self) -> CLK_EN_W<PMUP_DRV_CFG_SPEC> {
101 CLK_EN_W::new(self, 10)
102 }
103 #[doc = "Bits 11:14 - configure cmd4 drv"]
104 #[inline(always)]
105 #[must_use]
106 pub fn pump_drv4(&mut self) -> PUMP_DRV4_W<PMUP_DRV_CFG_SPEC> {
107 PUMP_DRV4_W::new(self, 11)
108 }
109 #[doc = "Bits 15:18 - configure cmd3 drv"]
110 #[inline(always)]
111 #[must_use]
112 pub fn pump_drv3(&mut self) -> PUMP_DRV3_W<PMUP_DRV_CFG_SPEC> {
113 PUMP_DRV3_W::new(self, 15)
114 }
115 #[doc = "Bits 19:22 - configure cmd2 drv"]
116 #[inline(always)]
117 #[must_use]
118 pub fn pump_drv2(&mut self) -> PUMP_DRV2_W<PMUP_DRV_CFG_SPEC> {
119 PUMP_DRV2_W::new(self, 19)
120 }
121 #[doc = "Bits 23:26 - configure cmd1 drv"]
122 #[inline(always)]
123 #[must_use]
124 pub fn pump_drv1(&mut self) -> PUMP_DRV1_W<PMUP_DRV_CFG_SPEC> {
125 PUMP_DRV1_W::new(self, 23)
126 }
127 #[doc = "Bits 27:30 - configure cmd0 drv"]
128 #[inline(always)]
129 #[must_use]
130 pub fn pump_drv0(&mut self) -> PUMP_DRV0_W<PMUP_DRV_CFG_SPEC> {
131 PUMP_DRV0_W::new(self, 27)
132 }
133}
134#[doc = "configure pump drv\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmup_drv_cfg::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 [`pmup_drv_cfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
135pub struct PMUP_DRV_CFG_SPEC;
136impl crate::RegisterSpec for PMUP_DRV_CFG_SPEC {
137 type Ux = u32;
138}
139#[doc = "`read()` method returns [`pmup_drv_cfg::R`](R) reader structure"]
140impl crate::Readable for PMUP_DRV_CFG_SPEC {}
141#[doc = "`write(|w| ..)` method takes [`pmup_drv_cfg::W`](W) writer structure"]
142impl crate::Writable for PMUP_DRV_CFG_SPEC {
143 type Safety = crate::Unsafe;
144 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
145 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
146}
147#[doc = "`reset()` method sets PMUP_DRV_CFG to value 0"]
148impl crate::Resettable for PMUP_DRV_CFG_SPEC {
149 const RESET_VALUE: u32 = 0;
150}