stm32f1_staging/stm32f102/spi1/
i2scfgr.rs1pub type R = crate::R<I2SCFGRrs>;
3pub type W = crate::W<I2SCFGRrs>;
5pub type CHLEN_R = crate::BitReader;
7pub type CHLEN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type DATLEN_R = crate::FieldReader;
11pub type DATLEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13pub type CKPOL_R = crate::BitReader;
15pub type CKPOL_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type I2SSTD_R = crate::FieldReader;
19pub type I2SSTD_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21pub type PCMSYNC_R = crate::BitReader;
23pub type PCMSYNC_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type I2SCFG_R = crate::FieldReader;
27pub type I2SCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29pub type I2SE_R = crate::BitReader;
31pub type I2SE_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type I2SMOD_R = crate::BitReader;
35pub type I2SMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38 #[inline(always)]
40 pub fn chlen(&self) -> CHLEN_R {
41 CHLEN_R::new((self.bits & 1) != 0)
42 }
43 #[inline(always)]
45 pub fn datlen(&self) -> DATLEN_R {
46 DATLEN_R::new(((self.bits >> 1) & 3) as u8)
47 }
48 #[inline(always)]
50 pub fn ckpol(&self) -> CKPOL_R {
51 CKPOL_R::new(((self.bits >> 3) & 1) != 0)
52 }
53 #[inline(always)]
55 pub fn i2sstd(&self) -> I2SSTD_R {
56 I2SSTD_R::new(((self.bits >> 4) & 3) as u8)
57 }
58 #[inline(always)]
60 pub fn pcmsync(&self) -> PCMSYNC_R {
61 PCMSYNC_R::new(((self.bits >> 7) & 1) != 0)
62 }
63 #[inline(always)]
65 pub fn i2scfg(&self) -> I2SCFG_R {
66 I2SCFG_R::new(((self.bits >> 8) & 3) as u8)
67 }
68 #[inline(always)]
70 pub fn i2se(&self) -> I2SE_R {
71 I2SE_R::new(((self.bits >> 10) & 1) != 0)
72 }
73 #[inline(always)]
75 pub fn i2smod(&self) -> I2SMOD_R {
76 I2SMOD_R::new(((self.bits >> 11) & 1) != 0)
77 }
78}
79impl core::fmt::Debug for R {
80 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
81 f.debug_struct("I2SCFGR")
82 .field("i2smod", &self.i2smod())
83 .field("i2se", &self.i2se())
84 .field("i2scfg", &self.i2scfg())
85 .field("pcmsync", &self.pcmsync())
86 .field("i2sstd", &self.i2sstd())
87 .field("ckpol", &self.ckpol())
88 .field("datlen", &self.datlen())
89 .field("chlen", &self.chlen())
90 .finish()
91 }
92}
93impl W {
94 #[inline(always)]
96 pub fn chlen(&mut self) -> CHLEN_W<I2SCFGRrs> {
97 CHLEN_W::new(self, 0)
98 }
99 #[inline(always)]
101 pub fn datlen(&mut self) -> DATLEN_W<I2SCFGRrs> {
102 DATLEN_W::new(self, 1)
103 }
104 #[inline(always)]
106 pub fn ckpol(&mut self) -> CKPOL_W<I2SCFGRrs> {
107 CKPOL_W::new(self, 3)
108 }
109 #[inline(always)]
111 pub fn i2sstd(&mut self) -> I2SSTD_W<I2SCFGRrs> {
112 I2SSTD_W::new(self, 4)
113 }
114 #[inline(always)]
116 pub fn pcmsync(&mut self) -> PCMSYNC_W<I2SCFGRrs> {
117 PCMSYNC_W::new(self, 7)
118 }
119 #[inline(always)]
121 pub fn i2scfg(&mut self) -> I2SCFG_W<I2SCFGRrs> {
122 I2SCFG_W::new(self, 8)
123 }
124 #[inline(always)]
126 pub fn i2se(&mut self) -> I2SE_W<I2SCFGRrs> {
127 I2SE_W::new(self, 10)
128 }
129 #[inline(always)]
131 pub fn i2smod(&mut self) -> I2SMOD_W<I2SCFGRrs> {
132 I2SMOD_W::new(self, 11)
133 }
134}
135pub struct I2SCFGRrs;
141impl crate::RegisterSpec for I2SCFGRrs {
142 type Ux = u16;
143}
144impl crate::Readable for I2SCFGRrs {}
146impl crate::Writable for I2SCFGRrs {
148 type Safety = crate::Unsafe;
149}
150impl crate::Resettable for I2SCFGRrs {}