mcxa_pac/glikey0/
ctrl_1.rs

1#[doc = "Register `CTRL_1` reader"]
2pub type R = crate::R<Ctrl1Spec>;
3#[doc = "Register `CTRL_1` writer"]
4pub type W = crate::W<Ctrl1Spec>;
5#[doc = "Field `READ_INDEX` reader - Index status, Writing an index value to this register will request the block to return the lock status of this index."]
6pub type ReadIndexR = crate::FieldReader;
7#[doc = "Field `READ_INDEX` writer - Index status, Writing an index value to this register will request the block to return the lock status of this index."]
8pub type ReadIndexW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `RESERVED15` reader - Reserved for Future Use"]
10pub type Reserved15R = crate::FieldReader;
11#[doc = "Field `WR_EN_1` reader - Write Enable One"]
12pub type WrEn1R = crate::FieldReader;
13#[doc = "Field `WR_EN_1` writer - Write Enable One"]
14pub type WrEn1W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
15#[doc = "Field `SFR_LOCK` reader - LOCK register for GLIKEY"]
16pub type SfrLockR = crate::FieldReader;
17#[doc = "Field `SFR_LOCK` writer - LOCK register for GLIKEY"]
18pub type SfrLockW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
19#[doc = "Field `RESERVED31` reader - Reserved for Future Use"]
20pub type Reserved31R = crate::FieldReader<u16>;
21impl R {
22    #[doc = "Bits 0:7 - Index status, Writing an index value to this register will request the block to return the lock status of this index."]
23    #[inline(always)]
24    pub fn read_index(&self) -> ReadIndexR {
25        ReadIndexR::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - Reserved for Future Use"]
28    #[inline(always)]
29    pub fn reserved15(&self) -> Reserved15R {
30        Reserved15R::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:17 - Write Enable One"]
33    #[inline(always)]
34    pub fn wr_en_1(&self) -> WrEn1R {
35        WrEn1R::new(((self.bits >> 16) & 3) as u8)
36    }
37    #[doc = "Bits 18:21 - LOCK register for GLIKEY"]
38    #[inline(always)]
39    pub fn sfr_lock(&self) -> SfrLockR {
40        SfrLockR::new(((self.bits >> 18) & 0x0f) as u8)
41    }
42    #[doc = "Bits 22:31 - Reserved for Future Use"]
43    #[inline(always)]
44    pub fn reserved31(&self) -> Reserved31R {
45        Reserved31R::new(((self.bits >> 22) & 0x03ff) as u16)
46    }
47}
48#[cfg(feature = "debug")]
49impl core::fmt::Debug for R {
50    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
51        f.debug_struct("CTRL_1")
52            .field("read_index", &self.read_index())
53            .field("reserved15", &self.reserved15())
54            .field("wr_en_1", &self.wr_en_1())
55            .field("sfr_lock", &self.sfr_lock())
56            .field("reserved31", &self.reserved31())
57            .finish()
58    }
59}
60impl W {
61    #[doc = "Bits 0:7 - Index status, Writing an index value to this register will request the block to return the lock status of this index."]
62    #[inline(always)]
63    pub fn read_index(&mut self) -> ReadIndexW<'_, Ctrl1Spec> {
64        ReadIndexW::new(self, 0)
65    }
66    #[doc = "Bits 16:17 - Write Enable One"]
67    #[inline(always)]
68    pub fn wr_en_1(&mut self) -> WrEn1W<'_, Ctrl1Spec> {
69        WrEn1W::new(self, 16)
70    }
71    #[doc = "Bits 18:21 - LOCK register for GLIKEY"]
72    #[inline(always)]
73    pub fn sfr_lock(&mut self) -> SfrLockW<'_, Ctrl1Spec> {
74        SfrLockW::new(self, 18)
75    }
76}
77#[doc = "Control Register 1 SFR\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl_1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl_1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
78pub struct Ctrl1Spec;
79impl crate::RegisterSpec for Ctrl1Spec {
80    type Ux = u32;
81}
82#[doc = "`read()` method returns [`ctrl_1::R`](R) reader structure"]
83impl crate::Readable for Ctrl1Spec {}
84#[doc = "`write(|w| ..)` method takes [`ctrl_1::W`](W) writer structure"]
85impl crate::Writable for Ctrl1Spec {
86    type Safety = crate::Unsafe;
87}
88#[doc = "`reset()` method sets CTRL_1 to value 0x0028_0000"]
89impl crate::Resettable for Ctrl1Spec {
90    const RESET_VALUE: u32 = 0x0028_0000;
91}