Skip to main content

mcxa_pac/pkc0/
pkc_len1.rs

1#[doc = "Register `PKC_LEN1` reader"]
2pub type R = crate::R<PkcLen1Spec>;
3#[doc = "Register `PKC_LEN1` writer"]
4pub type W = crate::W<PkcLen1Spec>;
5#[doc = "Field `LEN` reader - Operand length"]
6pub type LenR = crate::FieldReader<u16>;
7#[doc = "Field `LEN` writer - Operand length"]
8pub type LenW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `MCLEN` reader - Loop counter for microcode pattern"]
10pub type MclenR = crate::FieldReader<u16>;
11#[doc = "Field `MCLEN` writer - Loop counter for microcode pattern"]
12pub type MclenW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    #[doc = "Bits 0:15 - Operand length"]
15    #[inline(always)]
16    pub fn len(&self) -> LenR {
17        LenR::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bits 16:31 - Loop counter for microcode pattern"]
20    #[inline(always)]
21    pub fn mclen(&self) -> MclenR {
22        MclenR::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_LEN1")
29            .field("len", &self.len())
30            .field("mclen", &self.mclen())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:15 - Operand length"]
36    #[inline(always)]
37    pub fn len(&mut self) -> LenW<'_, PkcLen1Spec> {
38        LenW::new(self, 0)
39    }
40    #[doc = "Bits 16:31 - Loop counter for microcode pattern"]
41    #[inline(always)]
42    pub fn mclen(&mut self) -> MclenW<'_, PkcLen1Spec> {
43        MclenW::new(self, 16)
44    }
45}
46#[doc = "Length register, parameter set 1\n\nYou can [`read`](crate::Reg::read) this register and get [`pkc_len1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pkc_len1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct PkcLen1Spec;
48impl crate::RegisterSpec for PkcLen1Spec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`pkc_len1::R`](R) reader structure"]
52impl crate::Readable for PkcLen1Spec {}
53#[doc = "`write(|w| ..)` method takes [`pkc_len1::W`](W) writer structure"]
54impl crate::Writable for PkcLen1Spec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets PKC_LEN1 to value 0"]
58impl crate::Resettable for PkcLen1Spec {}