stm32u5/stm32u585/rtc/
wpr.rs1pub type W = crate::W<WPRrs>;
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum KEY {
10 Activate = 0,
12 Deactivate2 = 83,
14 Deactivate1 = 202,
16}
17impl From<KEY> for u8 {
18 #[inline(always)]
19 fn from(variant: KEY) -> Self {
20 variant as _
21 }
22}
23impl crate::FieldSpec for KEY {
24 type Ux = u8;
25}
26impl crate::IsEnum for KEY {}
27pub type KEY_W<'a, REG> = crate::FieldWriter<'a, REG, 8, KEY>;
29impl<'a, REG> KEY_W<'a, REG>
30where
31 REG: crate::Writable + crate::RegisterSpec,
32 REG::Ux: From<u8>,
33{
34 #[inline(always)]
36 pub fn activate(self) -> &'a mut crate::W<REG> {
37 self.variant(KEY::Activate)
38 }
39 #[inline(always)]
41 pub fn deactivate2(self) -> &'a mut crate::W<REG> {
42 self.variant(KEY::Deactivate2)
43 }
44 #[inline(always)]
46 pub fn deactivate1(self) -> &'a mut crate::W<REG> {
47 self.variant(KEY::Deactivate1)
48 }
49}
50impl core::fmt::Debug for crate::generic::Reg<WPRrs> {
51 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
52 write!(f, "(not readable)")
53 }
54}
55impl W {
56 #[inline(always)]
58 pub fn key(&mut self) -> KEY_W<WPRrs> {
59 KEY_W::new(self, 0)
60 }
61}
62pub struct WPRrs;
68impl crate::RegisterSpec for WPRrs {
69 type Ux = u32;
70}
71impl crate::Writable for WPRrs {
73 type Safety = crate::Unsafe;
74}
75impl crate::Resettable for WPRrs {}