efm32pg22_pac/efm32pg22c200/timer1_ns/
dtlock.rs

1#[doc = "Register `DTLOCK` writer"]
2pub struct W(crate::W<DTLOCK_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<DTLOCK_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<DTLOCK_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<DTLOCK_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "DTI Lock Key\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24#[repr(u16)]
25pub enum DTILOCKKEY_AW {
26    #[doc = "52864: Write to unlock TIMER DTI registers"]
27    UNLOCK = 52864,
28}
29impl From<DTILOCKKEY_AW> for u16 {
30    #[inline(always)]
31    fn from(variant: DTILOCKKEY_AW) -> Self {
32        variant as _
33    }
34}
35#[doc = "Field `DTILOCKKEY` writer - DTI Lock Key"]
36pub type DTILOCKKEY_W<'a, const O: u8> =
37    crate::FieldWriter<'a, u32, DTLOCK_SPEC, u16, DTILOCKKEY_AW, 16, O>;
38impl<'a, const O: u8> DTILOCKKEY_W<'a, O> {
39    #[doc = "Write to unlock TIMER DTI registers"]
40    #[inline(always)]
41    pub fn unlock(self) -> &'a mut W {
42        self.variant(DTILOCKKEY_AW::UNLOCK)
43    }
44}
45impl W {
46    #[doc = "Bits 0:15 - DTI Lock Key"]
47    #[inline(always)]
48    #[must_use]
49    pub fn dtilockkey(&mut self) -> DTILOCKKEY_W<0> {
50        DTILOCKKEY_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 [dtlock](index.html) module"]
60pub struct DTLOCK_SPEC;
61impl crate::RegisterSpec for DTLOCK_SPEC {
62    type Ux = u32;
63}
64#[doc = "`write(|w| ..)` method takes [dtlock::W](W) writer structure"]
65impl crate::Writable for DTLOCK_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 DTLOCK to value 0"]
71impl crate::Resettable for DTLOCK_SPEC {
72    const RESET_VALUE: Self::Ux = 0;
73}