stm32mp1/stm32mp157/ddrctrl/
pwrctl.rs1pub type R = crate::R<PWRCTLrs>;
3pub type W = crate::W<PWRCTLrs>;
5pub type SELFREF_EN_R = crate::BitReader;
7pub type SELFREF_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type POWERDOWN_EN_R = crate::BitReader;
11pub type POWERDOWN_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type DEEPPOWERDOWN_EN_R = crate::BitReader;
15pub type DEEPPOWERDOWN_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type EN_DFI_DRAM_CLK_DISABLE_R = crate::BitReader;
19pub type EN_DFI_DRAM_CLK_DISABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type SELFREF_SW_R = crate::BitReader;
23pub type SELFREF_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type DIS_CAM_DRAIN_SELFREF_R = crate::BitReader;
27pub type DIS_CAM_DRAIN_SELFREF_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[inline(always)]
32 pub fn selfref_en(&self) -> SELFREF_EN_R {
33 SELFREF_EN_R::new((self.bits & 1) != 0)
34 }
35 #[inline(always)]
37 pub fn powerdown_en(&self) -> POWERDOWN_EN_R {
38 POWERDOWN_EN_R::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[inline(always)]
42 pub fn deeppowerdown_en(&self) -> DEEPPOWERDOWN_EN_R {
43 DEEPPOWERDOWN_EN_R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[inline(always)]
47 pub fn en_dfi_dram_clk_disable(&self) -> EN_DFI_DRAM_CLK_DISABLE_R {
48 EN_DFI_DRAM_CLK_DISABLE_R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[inline(always)]
52 pub fn selfref_sw(&self) -> SELFREF_SW_R {
53 SELFREF_SW_R::new(((self.bits >> 5) & 1) != 0)
54 }
55 #[inline(always)]
57 pub fn dis_cam_drain_selfref(&self) -> DIS_CAM_DRAIN_SELFREF_R {
58 DIS_CAM_DRAIN_SELFREF_R::new(((self.bits >> 7) & 1) != 0)
59 }
60}
61impl core::fmt::Debug for R {
62 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
63 f.debug_struct("PWRCTL")
64 .field("selfref_en", &self.selfref_en())
65 .field("powerdown_en", &self.powerdown_en())
66 .field("deeppowerdown_en", &self.deeppowerdown_en())
67 .field("en_dfi_dram_clk_disable", &self.en_dfi_dram_clk_disable())
68 .field("selfref_sw", &self.selfref_sw())
69 .field("dis_cam_drain_selfref", &self.dis_cam_drain_selfref())
70 .finish()
71 }
72}
73impl W {
74 #[inline(always)]
76 pub fn selfref_en(&mut self) -> SELFREF_EN_W<PWRCTLrs> {
77 SELFREF_EN_W::new(self, 0)
78 }
79 #[inline(always)]
81 pub fn powerdown_en(&mut self) -> POWERDOWN_EN_W<PWRCTLrs> {
82 POWERDOWN_EN_W::new(self, 1)
83 }
84 #[inline(always)]
86 pub fn deeppowerdown_en(&mut self) -> DEEPPOWERDOWN_EN_W<PWRCTLrs> {
87 DEEPPOWERDOWN_EN_W::new(self, 2)
88 }
89 #[inline(always)]
91 pub fn en_dfi_dram_clk_disable(&mut self) -> EN_DFI_DRAM_CLK_DISABLE_W<PWRCTLrs> {
92 EN_DFI_DRAM_CLK_DISABLE_W::new(self, 3)
93 }
94 #[inline(always)]
96 pub fn selfref_sw(&mut self) -> SELFREF_SW_W<PWRCTLrs> {
97 SELFREF_SW_W::new(self, 5)
98 }
99 #[inline(always)]
101 pub fn dis_cam_drain_selfref(&mut self) -> DIS_CAM_DRAIN_SELFREF_W<PWRCTLrs> {
102 DIS_CAM_DRAIN_SELFREF_W::new(self, 7)
103 }
104}
105pub struct PWRCTLrs;
111impl crate::RegisterSpec for PWRCTLrs {
112 type Ux = u32;
113}
114impl crate::Readable for PWRCTLrs {}
116impl crate::Writable for PWRCTLrs {
118 type Safety = crate::Unsafe;
119}
120impl crate::Resettable for PWRCTLrs {}