stm32g4_staging/stm32g441/tim1/
ecr.rs1pub type R = crate::R<ECRrs>;
3pub type W = crate::W<ECRrs>;
5pub type IE_R = crate::BitReader;
7pub type IE_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type IDIR_R = crate::FieldReader;
11pub type IDIR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13pub type IBLK_R = crate::FieldReader;
15pub type IBLK_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17pub type FIDX_R = crate::BitReader;
19pub type FIDX_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type IPOS_R = crate::FieldReader;
23pub type IPOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25pub type PW_R = crate::FieldReader;
27pub type PW_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
29pub type PWPRSC_R = crate::FieldReader;
31pub type PWPRSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
33impl R {
34 #[inline(always)]
36 pub fn ie(&self) -> IE_R {
37 IE_R::new((self.bits & 1) != 0)
38 }
39 #[inline(always)]
41 pub fn idir(&self) -> IDIR_R {
42 IDIR_R::new(((self.bits >> 1) & 3) as u8)
43 }
44 #[inline(always)]
46 pub fn iblk(&self) -> IBLK_R {
47 IBLK_R::new(((self.bits >> 3) & 3) as u8)
48 }
49 #[inline(always)]
51 pub fn fidx(&self) -> FIDX_R {
52 FIDX_R::new(((self.bits >> 5) & 1) != 0)
53 }
54 #[inline(always)]
56 pub fn ipos(&self) -> IPOS_R {
57 IPOS_R::new(((self.bits >> 6) & 3) as u8)
58 }
59 #[inline(always)]
61 pub fn pw(&self) -> PW_R {
62 PW_R::new(((self.bits >> 16) & 0xff) as u8)
63 }
64 #[inline(always)]
66 pub fn pwprsc(&self) -> PWPRSC_R {
67 PWPRSC_R::new(((self.bits >> 24) & 7) as u8)
68 }
69}
70impl core::fmt::Debug for R {
71 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
72 f.debug_struct("ECR")
73 .field("ie", &self.ie())
74 .field("idir", &self.idir())
75 .field("iblk", &self.iblk())
76 .field("fidx", &self.fidx())
77 .field("ipos", &self.ipos())
78 .field("pw", &self.pw())
79 .field("pwprsc", &self.pwprsc())
80 .finish()
81 }
82}
83impl W {
84 #[inline(always)]
86 pub fn ie(&mut self) -> IE_W<ECRrs> {
87 IE_W::new(self, 0)
88 }
89 #[inline(always)]
91 pub fn idir(&mut self) -> IDIR_W<ECRrs> {
92 IDIR_W::new(self, 1)
93 }
94 #[inline(always)]
96 pub fn iblk(&mut self) -> IBLK_W<ECRrs> {
97 IBLK_W::new(self, 3)
98 }
99 #[inline(always)]
101 pub fn fidx(&mut self) -> FIDX_W<ECRrs> {
102 FIDX_W::new(self, 5)
103 }
104 #[inline(always)]
106 pub fn ipos(&mut self) -> IPOS_W<ECRrs> {
107 IPOS_W::new(self, 6)
108 }
109 #[inline(always)]
111 pub fn pw(&mut self) -> PW_W<ECRrs> {
112 PW_W::new(self, 16)
113 }
114 #[inline(always)]
116 pub fn pwprsc(&mut self) -> PWPRSC_W<ECRrs> {
117 PWPRSC_W::new(self, 24)
118 }
119}
120pub struct ECRrs;
126impl crate::RegisterSpec for ECRrs {
127 type Ux = u32;
128}
129impl crate::Readable for ECRrs {}
131impl crate::Writable for ECRrs {
133 type Safety = crate::Unsafe;
134}
135impl crate::Resettable for ECRrs {}