stm32f1_staging/stm32f107/sdio/
clkcr.rs1pub type R = crate::R<CLKCRrs>;
3pub type W = crate::W<CLKCRrs>;
5pub type CLKDIV_R = crate::FieldReader;
7pub type CLKDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9pub type CLKEN_R = crate::BitReader;
11pub type CLKEN_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type PWRSAV_R = crate::BitReader;
15pub type PWRSAV_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type BYPASS_R = crate::BitReader;
19pub type BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type WIDBUS_R = crate::FieldReader;
23pub type WIDBUS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25pub type NEGEDGE_R = crate::BitReader;
27pub type NEGEDGE_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type HWFC_EN_R = crate::BitReader;
31pub type HWFC_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
33impl R {
34 #[inline(always)]
36 pub fn clkdiv(&self) -> CLKDIV_R {
37 CLKDIV_R::new((self.bits & 0xff) as u8)
38 }
39 #[inline(always)]
41 pub fn clken(&self) -> CLKEN_R {
42 CLKEN_R::new(((self.bits >> 8) & 1) != 0)
43 }
44 #[inline(always)]
46 pub fn pwrsav(&self) -> PWRSAV_R {
47 PWRSAV_R::new(((self.bits >> 9) & 1) != 0)
48 }
49 #[inline(always)]
51 pub fn bypass(&self) -> BYPASS_R {
52 BYPASS_R::new(((self.bits >> 10) & 1) != 0)
53 }
54 #[inline(always)]
56 pub fn widbus(&self) -> WIDBUS_R {
57 WIDBUS_R::new(((self.bits >> 11) & 3) as u8)
58 }
59 #[inline(always)]
61 pub fn negedge(&self) -> NEGEDGE_R {
62 NEGEDGE_R::new(((self.bits >> 13) & 1) != 0)
63 }
64 #[inline(always)]
66 pub fn hwfc_en(&self) -> HWFC_EN_R {
67 HWFC_EN_R::new(((self.bits >> 14) & 1) != 0)
68 }
69}
70impl core::fmt::Debug for R {
71 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
72 f.debug_struct("CLKCR")
73 .field("hwfc_en", &self.hwfc_en())
74 .field("negedge", &self.negedge())
75 .field("widbus", &self.widbus())
76 .field("bypass", &self.bypass())
77 .field("pwrsav", &self.pwrsav())
78 .field("clken", &self.clken())
79 .field("clkdiv", &self.clkdiv())
80 .finish()
81 }
82}
83impl W {
84 #[inline(always)]
86 pub fn clkdiv(&mut self) -> CLKDIV_W<CLKCRrs> {
87 CLKDIV_W::new(self, 0)
88 }
89 #[inline(always)]
91 pub fn clken(&mut self) -> CLKEN_W<CLKCRrs> {
92 CLKEN_W::new(self, 8)
93 }
94 #[inline(always)]
96 pub fn pwrsav(&mut self) -> PWRSAV_W<CLKCRrs> {
97 PWRSAV_W::new(self, 9)
98 }
99 #[inline(always)]
101 pub fn bypass(&mut self) -> BYPASS_W<CLKCRrs> {
102 BYPASS_W::new(self, 10)
103 }
104 #[inline(always)]
106 pub fn widbus(&mut self) -> WIDBUS_W<CLKCRrs> {
107 WIDBUS_W::new(self, 11)
108 }
109 #[inline(always)]
111 pub fn negedge(&mut self) -> NEGEDGE_W<CLKCRrs> {
112 NEGEDGE_W::new(self, 13)
113 }
114 #[inline(always)]
116 pub fn hwfc_en(&mut self) -> HWFC_EN_W<CLKCRrs> {
117 HWFC_EN_W::new(self, 14)
118 }
119}
120pub struct CLKCRrs;
126impl crate::RegisterSpec for CLKCRrs {
127 type Ux = u32;
128}
129impl crate::Readable for CLKCRrs {}
131impl crate::Writable for CLKCRrs {
133 type Safety = crate::Unsafe;
134}
135impl crate::Resettable for CLKCRrs {}