atsam4lc2b_pac/bscif/
unlock.rs1#[doc = "Register `UNLOCK` writer"]
2pub struct W(crate::W<UNLOCK_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<UNLOCK_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<UNLOCK_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<UNLOCK_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Field `ADDR` writer - Unlock Address"]
23pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, UNLOCK_SPEC, u16, u16, 10, O>;
24#[doc = "Unlock Key\n\nValue on reset: 0"]
25#[derive(Clone, Copy, Debug, PartialEq, Eq)]
26#[repr(u8)]
27pub enum KEYSELECT_AW {
28 #[doc = "170: Valid Key to Unlock register"]
29 VALID = 170,
30}
31impl From<KEYSELECT_AW> for u8 {
32 #[inline(always)]
33 fn from(variant: KEYSELECT_AW) -> Self {
34 variant as _
35 }
36}
37#[doc = "Field `KEY` writer - Unlock Key"]
38pub type KEY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, UNLOCK_SPEC, u8, KEYSELECT_AW, 8, O>;
39impl<'a, const O: u8> KEY_W<'a, O> {
40 #[doc = "Valid Key to Unlock register"]
41 #[inline(always)]
42 pub fn valid(self) -> &'a mut W {
43 self.variant(KEYSELECT_AW::VALID)
44 }
45}
46impl W {
47 #[doc = "Bits 0:9 - Unlock Address"]
48 #[inline(always)]
49 #[must_use]
50 pub fn addr(&mut self) -> ADDR_W<0> {
51 ADDR_W::new(self)
52 }
53 #[doc = "Bits 24:31 - Unlock Key"]
54 #[inline(always)]
55 #[must_use]
56 pub fn key(&mut self) -> KEY_W<24> {
57 KEY_W::new(self)
58 }
59 #[doc = "Writes raw bits to the register."]
60 #[inline(always)]
61 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
62 self.0.bits(bits);
63 self
64 }
65}
66#[doc = "Unlock Register\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 [unlock](index.html) module"]
67pub struct UNLOCK_SPEC;
68impl crate::RegisterSpec for UNLOCK_SPEC {
69 type Ux = u32;
70}
71#[doc = "`write(|w| ..)` method takes [unlock::W](W) writer structure"]
72impl crate::Writable for UNLOCK_SPEC {
73 type Writer = W;
74 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
75 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
76}
77#[doc = "`reset()` method sets UNLOCK to value 0"]
78impl crate::Resettable for UNLOCK_SPEC {
79 const RESET_VALUE: Self::Ux = 0;
80}