mcxa_pac/pkc0/
pkc_zrptr2.rs

1#[doc = "Register `PKC_ZRPTR2` reader"]
2pub type R = crate::R<PkcZrptr2Spec>;
3#[doc = "Register `PKC_ZRPTR2` writer"]
4pub type W = crate::W<PkcZrptr2Spec>;
5#[doc = "Field `ZPTR` reader - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST"]
6pub type ZptrR = crate::FieldReader<u16>;
7#[doc = "Field `ZPTR` writer - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST"]
8pub type ZptrW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `RPTR` reader - Start address of R result in PKCRAM with byte granularity"]
10pub type RptrR = crate::FieldReader<u16>;
11#[doc = "Field `RPTR` writer - Start address of R result in PKCRAM with byte granularity"]
12pub type RptrW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    #[doc = "Bits 0:15 - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST"]
15    #[inline(always)]
16    pub fn zptr(&self) -> ZptrR {
17        ZptrR::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bits 16:31 - Start address of R result in PKCRAM with byte granularity"]
20    #[inline(always)]
21    pub fn rptr(&self) -> RptrR {
22        RptrR::new(((self.bits >> 16) & 0xffff) as u16)
23    }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("PKC_ZRPTR2")
29            .field("zptr", &self.zptr())
30            .field("rptr", &self.rptr())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:15 - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST"]
36    #[inline(always)]
37    pub fn zptr(&mut self) -> ZptrW<'_, PkcZrptr2Spec> {
38        ZptrW::new(self, 0)
39    }
40    #[doc = "Bits 16:31 - Start address of R result in PKCRAM with byte granularity"]
41    #[inline(always)]
42    pub fn rptr(&mut self) -> RptrW<'_, PkcZrptr2Spec> {
43        RptrW::new(self, 16)
44    }
45}
46#[doc = "Z+R pointer register, parameter set 2\n\nYou can [`read`](crate::Reg::read) this register and get [`pkc_zrptr2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pkc_zrptr2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct PkcZrptr2Spec;
48impl crate::RegisterSpec for PkcZrptr2Spec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`pkc_zrptr2::R`](R) reader structure"]
52impl crate::Readable for PkcZrptr2Spec {}
53#[doc = "`write(|w| ..)` method takes [`pkc_zrptr2::W`](W) writer structure"]
54impl crate::Writable for PkcZrptr2Spec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets PKC_ZRPTR2 to value 0"]
58impl crate::Resettable for PkcZrptr2Spec {}