efm32pg22_pac/efm32pg22c200/hfrco0_ns/
lock.rs1#[doc = "Register `LOCK` writer"]
2pub struct W(crate::W<LOCK_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<LOCK_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl core::ops::DerefMut for W {
11 #[inline(always)]
12 fn deref_mut(&mut self) -> &mut Self::Target {
13 &mut self.0
14 }
15}
16impl From<crate::W<LOCK_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<LOCK_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Lock Key\n\nValue on reset: 33173"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24#[repr(u16)]
25pub enum LOCKKEY_AW {
26 #[doc = "33173: Unlock code"]
27 UNLOCK = 33173,
28}
29impl From<LOCKKEY_AW> for u16 {
30 #[inline(always)]
31 fn from(variant: LOCKKEY_AW) -> Self {
32 variant as _
33 }
34}
35#[doc = "Field `LOCKKEY` writer - Lock Key"]
36pub type LOCKKEY_W<'a, const O: u8> =
37 crate::FieldWriter<'a, u32, LOCK_SPEC, u16, LOCKKEY_AW, 16, O>;
38impl<'a, const O: u8> LOCKKEY_W<'a, O> {
39 #[doc = "Unlock code"]
40 #[inline(always)]
41 pub fn unlock(self) -> &'a mut W {
42 self.variant(LOCKKEY_AW::UNLOCK)
43 }
44}
45impl W {
46 #[doc = "Bits 0:15 - Lock Key"]
47 #[inline(always)]
48 #[must_use]
49 pub fn lockkey(&mut self) -> LOCKKEY_W<0> {
50 LOCKKEY_W::new(self)
51 }
52 #[doc = "Writes raw bits to the register."]
53 #[inline(always)]
54 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
55 self.0.bits(bits);
56 self
57 }
58}
59#[doc = "No Description\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lock](index.html) module"]
60pub struct LOCK_SPEC;
61impl crate::RegisterSpec for LOCK_SPEC {
62 type Ux = u32;
63}
64#[doc = "`write(|w| ..)` method takes [lock::W](W) writer structure"]
65impl crate::Writable for LOCK_SPEC {
66 type Writer = W;
67 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
68 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
69}
70#[doc = "`reset()` method sets LOCK to value 0x8195"]
71impl crate::Resettable for LOCK_SPEC {
72 const RESET_VALUE: Self::Ux = 0x8195;
73}