stm32l4/stm32l4x1/dfsdm/ch/
awscdr.rs1pub type R = crate::R<AWSCDRrs>;
3pub type W = crate::W<AWSCDRrs>;
5pub type SCDT_R = crate::FieldReader;
7pub type SCDT_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
9pub type BKSCD_R = crate::FieldReader;
11pub type BKSCD_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
13pub type AWFOSR_R = crate::FieldReader;
15pub type AWFOSR_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
17#[cfg_attr(feature = "defmt", derive(defmt::Format))]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22#[repr(u8)]
23pub enum AWFORD {
24 FastSinc = 0,
26 Sinc1 = 1,
28 Sinc2 = 2,
30 Sinc3 = 3,
32}
33impl From<AWFORD> for u8 {
34 #[inline(always)]
35 fn from(variant: AWFORD) -> Self {
36 variant as _
37 }
38}
39impl crate::FieldSpec for AWFORD {
40 type Ux = u8;
41}
42impl crate::IsEnum for AWFORD {}
43pub type AWFORD_R = crate::FieldReader<AWFORD>;
45impl AWFORD_R {
46 #[inline(always)]
48 pub const fn variant(&self) -> AWFORD {
49 match self.bits {
50 0 => AWFORD::FastSinc,
51 1 => AWFORD::Sinc1,
52 2 => AWFORD::Sinc2,
53 3 => AWFORD::Sinc3,
54 _ => unreachable!(),
55 }
56 }
57 #[inline(always)]
59 pub fn is_fast_sinc(&self) -> bool {
60 *self == AWFORD::FastSinc
61 }
62 #[inline(always)]
64 pub fn is_sinc1(&self) -> bool {
65 *self == AWFORD::Sinc1
66 }
67 #[inline(always)]
69 pub fn is_sinc2(&self) -> bool {
70 *self == AWFORD::Sinc2
71 }
72 #[inline(always)]
74 pub fn is_sinc3(&self) -> bool {
75 *self == AWFORD::Sinc3
76 }
77}
78pub type AWFORD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, AWFORD, crate::Safe>;
80impl<'a, REG> AWFORD_W<'a, REG>
81where
82 REG: crate::Writable + crate::RegisterSpec,
83 REG::Ux: From<u8>,
84{
85 #[inline(always)]
87 pub fn fast_sinc(self) -> &'a mut crate::W<REG> {
88 self.variant(AWFORD::FastSinc)
89 }
90 #[inline(always)]
92 pub fn sinc1(self) -> &'a mut crate::W<REG> {
93 self.variant(AWFORD::Sinc1)
94 }
95 #[inline(always)]
97 pub fn sinc2(self) -> &'a mut crate::W<REG> {
98 self.variant(AWFORD::Sinc2)
99 }
100 #[inline(always)]
102 pub fn sinc3(self) -> &'a mut crate::W<REG> {
103 self.variant(AWFORD::Sinc3)
104 }
105}
106impl R {
107 #[inline(always)]
109 pub fn scdt(&self) -> SCDT_R {
110 SCDT_R::new((self.bits & 0xff) as u8)
111 }
112 #[inline(always)]
114 pub fn bkscd(&self) -> BKSCD_R {
115 BKSCD_R::new(((self.bits >> 12) & 0x0f) as u8)
116 }
117 #[inline(always)]
119 pub fn awfosr(&self) -> AWFOSR_R {
120 AWFOSR_R::new(((self.bits >> 16) & 0x1f) as u8)
121 }
122 #[inline(always)]
124 pub fn awford(&self) -> AWFORD_R {
125 AWFORD_R::new(((self.bits >> 22) & 3) as u8)
126 }
127}
128impl core::fmt::Debug for R {
129 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
130 f.debug_struct("AWSCDR")
131 .field("awford", &self.awford())
132 .field("awfosr", &self.awfosr())
133 .field("bkscd", &self.bkscd())
134 .field("scdt", &self.scdt())
135 .finish()
136 }
137}
138impl W {
139 #[inline(always)]
141 pub fn scdt(&mut self) -> SCDT_W<AWSCDRrs> {
142 SCDT_W::new(self, 0)
143 }
144 #[inline(always)]
146 pub fn bkscd(&mut self) -> BKSCD_W<AWSCDRrs> {
147 BKSCD_W::new(self, 12)
148 }
149 #[inline(always)]
151 pub fn awfosr(&mut self) -> AWFOSR_W<AWSCDRrs> {
152 AWFOSR_W::new(self, 16)
153 }
154 #[inline(always)]
156 pub fn awford(&mut self) -> AWFORD_W<AWSCDRrs> {
157 AWFORD_W::new(self, 22)
158 }
159}
160pub struct AWSCDRrs;
164impl crate::RegisterSpec for AWSCDRrs {
165 type Ux = u32;
166}
167impl crate::Readable for AWSCDRrs {}
169impl crate::Writable for AWSCDRrs {
171 type Safety = crate::Unsafe;
172}
173impl crate::Resettable for AWSCDRrs {}