stm32l4/stm32l4x5/dfsdm/flt/
awhtr.rs1pub type R = crate::R<AWHTRrs>;
3pub type W = crate::W<AWHTRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum BKAWH0 {
11 NotAssigned = 0,
13 Assigned = 1,
15}
16impl From<BKAWH0> for bool {
17 #[inline(always)]
18 fn from(variant: BKAWH0) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type BKAWH_R = crate::BitReader<BKAWH0>;
24impl BKAWH_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> BKAWH0 {
28 match self.bits {
29 false => BKAWH0::NotAssigned,
30 true => BKAWH0::Assigned,
31 }
32 }
33 #[inline(always)]
35 pub fn is_not_assigned(&self) -> bool {
36 *self == BKAWH0::NotAssigned
37 }
38 #[inline(always)]
40 pub fn is_assigned(&self) -> bool {
41 *self == BKAWH0::Assigned
42 }
43}
44pub type BKAWH_W<'a, REG> = crate::BitWriter<'a, REG, BKAWH0>;
46impl<'a, REG> BKAWH_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn not_assigned(self) -> &'a mut crate::W<REG> {
53 self.variant(BKAWH0::NotAssigned)
54 }
55 #[inline(always)]
57 pub fn assigned(self) -> &'a mut crate::W<REG> {
58 self.variant(BKAWH0::Assigned)
59 }
60}
61pub type AWHT_R = crate::FieldReader<u32>;
63pub type AWHT_W<'a, REG> = crate::FieldWriter<'a, REG, 24, u32, crate::Safe>;
65impl R {
66 #[inline(always)]
70 pub fn bkawh(&self, n: u8) -> BKAWH_R {
71 #[allow(clippy::no_effect)]
72 [(); 4][n as usize];
73 BKAWH_R::new(((self.bits >> n) & 1) != 0)
74 }
75 #[inline(always)]
78 pub fn bkawh_iter(&self) -> impl Iterator<Item = BKAWH_R> + '_ {
79 (0..4).map(move |n| BKAWH_R::new(((self.bits >> n) & 1) != 0))
80 }
81 #[inline(always)]
83 pub fn bkawh0(&self) -> BKAWH_R {
84 BKAWH_R::new((self.bits & 1) != 0)
85 }
86 #[inline(always)]
88 pub fn bkawh1(&self) -> BKAWH_R {
89 BKAWH_R::new(((self.bits >> 1) & 1) != 0)
90 }
91 #[inline(always)]
93 pub fn bkawh2(&self) -> BKAWH_R {
94 BKAWH_R::new(((self.bits >> 2) & 1) != 0)
95 }
96 #[inline(always)]
98 pub fn bkawh3(&self) -> BKAWH_R {
99 BKAWH_R::new(((self.bits >> 3) & 1) != 0)
100 }
101 #[inline(always)]
103 pub fn awht(&self) -> AWHT_R {
104 AWHT_R::new((self.bits >> 8) & 0x00ff_ffff)
105 }
106}
107impl core::fmt::Debug for R {
108 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
109 f.debug_struct("AWHTR")
110 .field("awht", &self.awht())
111 .field("bkawh0", &self.bkawh0())
112 .field("bkawh1", &self.bkawh1())
113 .field("bkawh2", &self.bkawh2())
114 .field("bkawh3", &self.bkawh3())
115 .finish()
116 }
117}
118impl W {
119 #[inline(always)]
123 pub fn bkawh(&mut self, n: u8) -> BKAWH_W<AWHTRrs> {
124 #[allow(clippy::no_effect)]
125 [(); 4][n as usize];
126 BKAWH_W::new(self, n)
127 }
128 #[inline(always)]
130 pub fn bkawh0(&mut self) -> BKAWH_W<AWHTRrs> {
131 BKAWH_W::new(self, 0)
132 }
133 #[inline(always)]
135 pub fn bkawh1(&mut self) -> BKAWH_W<AWHTRrs> {
136 BKAWH_W::new(self, 1)
137 }
138 #[inline(always)]
140 pub fn bkawh2(&mut self) -> BKAWH_W<AWHTRrs> {
141 BKAWH_W::new(self, 2)
142 }
143 #[inline(always)]
145 pub fn bkawh3(&mut self) -> BKAWH_W<AWHTRrs> {
146 BKAWH_W::new(self, 3)
147 }
148 #[inline(always)]
150 pub fn awht(&mut self) -> AWHT_W<AWHTRrs> {
151 AWHT_W::new(self, 8)
152 }
153}
154pub struct AWHTRrs;
158impl crate::RegisterSpec for AWHTRrs {
159 type Ux = u32;
160}
161impl crate::Readable for AWHTRrs {}
163impl crate::Writable for AWHTRrs {
165 type Safety = crate::Unsafe;
166}
167impl crate::Resettable for AWHTRrs {}