stm32f7_staging/stm32f733/wwdg/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type T_R = crate::FieldReader;
7pub type T_W<'a, REG> = crate::FieldWriter<'a, REG, 7, u8, crate::Safe>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14pub enum WDGA {
15 Disabled = 0,
17 Enabled = 1,
19}
20impl From<WDGA> for bool {
21 #[inline(always)]
22 fn from(variant: WDGA) -> Self {
23 variant as u8 != 0
24 }
25}
26pub type WDGA_R = crate::BitReader<WDGA>;
28impl WDGA_R {
29 #[inline(always)]
31 pub const fn variant(&self) -> WDGA {
32 match self.bits {
33 false => WDGA::Disabled,
34 true => WDGA::Enabled,
35 }
36 }
37 #[inline(always)]
39 pub fn is_disabled(&self) -> bool {
40 *self == WDGA::Disabled
41 }
42 #[inline(always)]
44 pub fn is_enabled(&self) -> bool {
45 *self == WDGA::Enabled
46 }
47}
48pub type WDGA_W<'a, REG> = crate::BitWriter<'a, REG, WDGA>;
50impl<'a, REG> WDGA_W<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53{
54 #[inline(always)]
56 pub fn disabled(self) -> &'a mut crate::W<REG> {
57 self.variant(WDGA::Disabled)
58 }
59 #[inline(always)]
61 pub fn enabled(self) -> &'a mut crate::W<REG> {
62 self.variant(WDGA::Enabled)
63 }
64}
65impl R {
66 #[inline(always)]
68 pub fn t(&self) -> T_R {
69 T_R::new((self.bits & 0x7f) as u8)
70 }
71 #[inline(always)]
73 pub fn wdga(&self) -> WDGA_R {
74 WDGA_R::new(((self.bits >> 7) & 1) != 0)
75 }
76}
77impl core::fmt::Debug for R {
78 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
79 f.debug_struct("CR")
80 .field("wdga", &self.wdga())
81 .field("t", &self.t())
82 .finish()
83 }
84}
85impl W {
86 #[inline(always)]
88 pub fn t(&mut self) -> T_W<CRrs> {
89 T_W::new(self, 0)
90 }
91 #[inline(always)]
93 pub fn wdga(&mut self) -> WDGA_W<CRrs> {
94 WDGA_W::new(self, 7)
95 }
96}
97pub struct CRrs;
103impl crate::RegisterSpec for CRrs {
104 type Ux = u16;
105}
106impl crate::Readable for CRrs {}
108impl crate::Writable for CRrs {
110 type Safety = crate::Unsafe;
111}
112impl crate::Resettable for CRrs {
114 const RESET_VALUE: u16 = 0x7f;
115}