Skip to main content

mcxa_pac/pkc0/
pkc_version.rs

1#[doc = "Register `PKC_VERSION` reader"]
2pub type R = crate::R<PkcVersionSpec>;
3#[doc = "Native multiplier size and operand granularity\n\nValue on reset: 2"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6#[repr(u8)]
7pub enum Mulsize {
8    #[doc = "2: 64-bit multiplier"]
9    Bit64 = 2,
10}
11impl From<Mulsize> for u8 {
12    #[inline(always)]
13    fn from(variant: Mulsize) -> Self {
14        variant as _
15    }
16}
17impl crate::FieldSpec for Mulsize {
18    type Ux = u8;
19}
20impl crate::IsEnum for Mulsize {}
21#[doc = "Field `MULSIZE` reader - Native multiplier size and operand granularity"]
22pub type MulsizeR = crate::FieldReader<Mulsize>;
23impl MulsizeR {
24    #[doc = "Get enumerated values variant"]
25    #[inline(always)]
26    pub const fn variant(&self) -> Option<Mulsize> {
27        match self.bits {
28            2 => Some(Mulsize::Bit64),
29            _ => None,
30        }
31    }
32    #[doc = "64-bit multiplier"]
33    #[inline(always)]
34    pub fn is_bit64(&self) -> bool {
35        *self == Mulsize::Bit64
36    }
37}
38#[doc = "Field `MCAVAIL` reader - MC feature (layer1 calculation) is available"]
39pub type McavailR = crate::BitReader;
40#[doc = "Field `UPAVAIL` reader - UP feature (layer2 calculation) is available"]
41pub type UpavailR = crate::BitReader;
42#[doc = "Field `UPCACHEAVAIL` reader - UP cache is available"]
43pub type UpcacheavailR = crate::BitReader;
44#[doc = "Field `GF2AVAIL` reader - GF2 calculation modes are available"]
45pub type Gf2availR = crate::BitReader;
46#[doc = "Field `PARAMNUM` reader - Number of parameter sets for real calculation"]
47pub type ParamnumR = crate::FieldReader;
48#[doc = "Field `SBX0AVAIL` reader - SBX0 operation is available"]
49pub type Sbx0availR = crate::BitReader;
50#[doc = "Field `SBX1AVAIL` reader - SBX1 operation is available"]
51pub type Sbx1availR = crate::BitReader;
52#[doc = "Field `SBX2AVAIL` reader - SBX2 operation is available"]
53pub type Sbx2availR = crate::BitReader;
54#[doc = "Field `SBX3AVAIL` reader - SBX3 operation is available"]
55pub type Sbx3availR = crate::BitReader;
56#[doc = "Field `MCRECONF_SIZE` reader - Size of reconfigurable MC table in bytes."]
57pub type McreconfSizeR = crate::FieldReader;
58impl R {
59    #[doc = "Bits 0:1 - Native multiplier size and operand granularity"]
60    #[inline(always)]
61    pub fn mulsize(&self) -> MulsizeR {
62        MulsizeR::new((self.bits & 3) as u8)
63    }
64    #[doc = "Bit 2 - MC feature (layer1 calculation) is available"]
65    #[inline(always)]
66    pub fn mcavail(&self) -> McavailR {
67        McavailR::new(((self.bits >> 2) & 1) != 0)
68    }
69    #[doc = "Bit 3 - UP feature (layer2 calculation) is available"]
70    #[inline(always)]
71    pub fn upavail(&self) -> UpavailR {
72        UpavailR::new(((self.bits >> 3) & 1) != 0)
73    }
74    #[doc = "Bit 4 - UP cache is available"]
75    #[inline(always)]
76    pub fn upcacheavail(&self) -> UpcacheavailR {
77        UpcacheavailR::new(((self.bits >> 4) & 1) != 0)
78    }
79    #[doc = "Bit 5 - GF2 calculation modes are available"]
80    #[inline(always)]
81    pub fn gf2avail(&self) -> Gf2availR {
82        Gf2availR::new(((self.bits >> 5) & 1) != 0)
83    }
84    #[doc = "Bits 6:7 - Number of parameter sets for real calculation"]
85    #[inline(always)]
86    pub fn paramnum(&self) -> ParamnumR {
87        ParamnumR::new(((self.bits >> 6) & 3) as u8)
88    }
89    #[doc = "Bit 8 - SBX0 operation is available"]
90    #[inline(always)]
91    pub fn sbx0avail(&self) -> Sbx0availR {
92        Sbx0availR::new(((self.bits >> 8) & 1) != 0)
93    }
94    #[doc = "Bit 9 - SBX1 operation is available"]
95    #[inline(always)]
96    pub fn sbx1avail(&self) -> Sbx1availR {
97        Sbx1availR::new(((self.bits >> 9) & 1) != 0)
98    }
99    #[doc = "Bit 10 - SBX2 operation is available"]
100    #[inline(always)]
101    pub fn sbx2avail(&self) -> Sbx2availR {
102        Sbx2availR::new(((self.bits >> 10) & 1) != 0)
103    }
104    #[doc = "Bit 11 - SBX3 operation is available"]
105    #[inline(always)]
106    pub fn sbx3avail(&self) -> Sbx3availR {
107        Sbx3availR::new(((self.bits >> 11) & 1) != 0)
108    }
109    #[doc = "Bits 12:19 - Size of reconfigurable MC table in bytes."]
110    #[inline(always)]
111    pub fn mcreconf_size(&self) -> McreconfSizeR {
112        McreconfSizeR::new(((self.bits >> 12) & 0xff) as u8)
113    }
114}
115#[cfg(feature = "debug")]
116impl core::fmt::Debug for R {
117    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
118        f.debug_struct("PKC_VERSION")
119            .field("mulsize", &self.mulsize())
120            .field("mcavail", &self.mcavail())
121            .field("upavail", &self.upavail())
122            .field("upcacheavail", &self.upcacheavail())
123            .field("gf2avail", &self.gf2avail())
124            .field("paramnum", &self.paramnum())
125            .field("sbx0avail", &self.sbx0avail())
126            .field("sbx1avail", &self.sbx1avail())
127            .field("sbx2avail", &self.sbx2avail())
128            .field("sbx3avail", &self.sbx3avail())
129            .field("mcreconf_size", &self.mcreconf_size())
130            .finish()
131    }
132}
133#[doc = "PKC version register\n\nYou can [`read`](crate::Reg::read) this register and get [`pkc_version::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
134pub struct PkcVersionSpec;
135impl crate::RegisterSpec for PkcVersionSpec {
136    type Ux = u32;
137}
138#[doc = "`read()` method returns [`pkc_version::R`](R) reader structure"]
139impl crate::Readable for PkcVersionSpec {}
140#[doc = "`reset()` method sets PKC_VERSION to value 0xbe"]
141impl crate::Resettable for PkcVersionSpec {
142    const RESET_VALUE: u32 = 0xbe;
143}