stm32f4/stm32f469/spi1/
i2spr.rs1pub type R = crate::R<I2SPRrs>;
3pub type W = crate::W<I2SPRrs>;
5pub type I2SDIV_R = crate::FieldReader;
7pub type I2SDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14pub enum ODD {
15 Even = 0,
17 Odd = 1,
19}
20impl From<ODD> for bool {
21 #[inline(always)]
22 fn from(variant: ODD) -> Self {
23 variant as u8 != 0
24 }
25}
26pub type ODD_R = crate::BitReader<ODD>;
28impl ODD_R {
29 #[inline(always)]
31 pub const fn variant(&self) -> ODD {
32 match self.bits {
33 false => ODD::Even,
34 true => ODD::Odd,
35 }
36 }
37 #[inline(always)]
39 pub fn is_even(&self) -> bool {
40 *self == ODD::Even
41 }
42 #[inline(always)]
44 pub fn is_odd(&self) -> bool {
45 *self == ODD::Odd
46 }
47}
48pub type ODD_W<'a, REG> = crate::BitWriter<'a, REG, ODD>;
50impl<'a, REG> ODD_W<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53{
54 #[inline(always)]
56 pub fn even(self) -> &'a mut crate::W<REG> {
57 self.variant(ODD::Even)
58 }
59 #[inline(always)]
61 pub fn odd(self) -> &'a mut crate::W<REG> {
62 self.variant(ODD::Odd)
63 }
64}
65#[cfg_attr(feature = "defmt", derive(defmt::Format))]
69#[derive(Clone, Copy, Debug, PartialEq, Eq)]
70pub enum MCKOE {
71 Disabled = 0,
73 Enabled = 1,
75}
76impl From<MCKOE> for bool {
77 #[inline(always)]
78 fn from(variant: MCKOE) -> Self {
79 variant as u8 != 0
80 }
81}
82pub type MCKOE_R = crate::BitReader<MCKOE>;
84impl MCKOE_R {
85 #[inline(always)]
87 pub const fn variant(&self) -> MCKOE {
88 match self.bits {
89 false => MCKOE::Disabled,
90 true => MCKOE::Enabled,
91 }
92 }
93 #[inline(always)]
95 pub fn is_disabled(&self) -> bool {
96 *self == MCKOE::Disabled
97 }
98 #[inline(always)]
100 pub fn is_enabled(&self) -> bool {
101 *self == MCKOE::Enabled
102 }
103}
104pub type MCKOE_W<'a, REG> = crate::BitWriter<'a, REG, MCKOE>;
106impl<'a, REG> MCKOE_W<'a, REG>
107where
108 REG: crate::Writable + crate::RegisterSpec,
109{
110 #[inline(always)]
112 pub fn disabled(self) -> &'a mut crate::W<REG> {
113 self.variant(MCKOE::Disabled)
114 }
115 #[inline(always)]
117 pub fn enabled(self) -> &'a mut crate::W<REG> {
118 self.variant(MCKOE::Enabled)
119 }
120}
121impl R {
122 #[inline(always)]
124 pub fn i2sdiv(&self) -> I2SDIV_R {
125 I2SDIV_R::new((self.bits & 0xff) as u8)
126 }
127 #[inline(always)]
129 pub fn odd(&self) -> ODD_R {
130 ODD_R::new(((self.bits >> 8) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn mckoe(&self) -> MCKOE_R {
135 MCKOE_R::new(((self.bits >> 9) & 1) != 0)
136 }
137}
138impl core::fmt::Debug for R {
139 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
140 f.debug_struct("I2SPR")
141 .field("mckoe", &self.mckoe())
142 .field("odd", &self.odd())
143 .field("i2sdiv", &self.i2sdiv())
144 .finish()
145 }
146}
147impl W {
148 #[inline(always)]
150 pub fn i2sdiv(&mut self) -> I2SDIV_W<I2SPRrs> {
151 I2SDIV_W::new(self, 0)
152 }
153 #[inline(always)]
155 pub fn odd(&mut self) -> ODD_W<I2SPRrs> {
156 ODD_W::new(self, 8)
157 }
158 #[inline(always)]
160 pub fn mckoe(&mut self) -> MCKOE_W<I2SPRrs> {
161 MCKOE_W::new(self, 9)
162 }
163}
164pub struct I2SPRrs;
170impl crate::RegisterSpec for I2SPRrs {
171 type Ux = u16;
172}
173impl crate::Readable for I2SPRrs {}
175impl crate::Writable for I2SPRrs {
177 type Safety = crate::Unsafe;
178}
179impl crate::Resettable for I2SPRrs {
181 const RESET_VALUE: u16 = 0x0a;
182}