Skip to main content

mcxa_pac/sgi0/
sgi_config.rs

1#[doc = "Register `sgi_config` reader"]
2pub type R = crate::R<SgiConfigSpec>;
3#[doc = "Field `row` reader - SGI Diversified for 'ROW'"]
4pub type RowR = crate::BitReader;
5#[doc = "Field `china` reader - SGI Diversified for 'CHINA'"]
6pub type ChinaR = crate::BitReader;
7#[doc = "Field `cc` reader - SGI Diversified for 'CC'"]
8pub type CcR = crate::BitReader;
9#[doc = "Field `has_aes` reader - HAS AES"]
10pub type HasAesR = crate::BitReader;
11#[doc = "Field `has_des` reader - HAS DES"]
12pub type HasDesR = crate::BitReader;
13#[doc = "Field `has_sha` reader - HAS SHA"]
14pub type HasShaR = crate::BitReader;
15#[doc = "Field `has_movem` reader - HAS MOVEM"]
16pub type HasMovemR = crate::BitReader;
17#[doc = "Field `has_cmac` reader - HAS CMAC"]
18pub type HasCmacR = crate::BitReader;
19#[doc = "Field `has_gfmul` reader - HAS GFMUL"]
20pub type HasGfmulR = crate::BitReader;
21#[doc = "Field `internal_prng` reader - HAS INTERNAL PRNG"]
22pub type InternalPrngR = crate::BitReader;
23#[doc = "Field `key_digest` reader - HAS KEY DIGEST"]
24pub type KeyDigestR = crate::BitReader;
25#[doc = "Field `count_size` reader - 0 - COUNT=16, 1 - COUNT=32"]
26pub type CountSizeR = crate::BitReader;
27#[doc = "Field `configc_rsvd` reader - reserved"]
28pub type ConfigcRsvdR = crate::BitReader;
29#[doc = "Field `fa` reader - HAS FA protection"]
30pub type FaR = crate::BitReader;
31#[doc = "Field `configb2_rsvd` reader - reserved"]
32pub type Configb2RsvdR = crate::BitReader;
33#[doc = "Field `bus_width` reader - 0 - BUS_WIDTH=16, 1 - BUS_WIDTH=32"]
34pub type BusWidthR = crate::BitReader;
35#[doc = "Field `num_datin` reader - NUMBER OF DATIN REGBANKS"]
36pub type NumDatinR = crate::FieldReader;
37#[doc = "Field `num_key` reader - NUMBER OR KEY REGBANKS"]
38pub type NumKeyR = crate::FieldReader;
39#[doc = "Field `edc` reader - DATIN to KERNEL End-to-end EDC is enabled"]
40pub type EdcR = crate::BitReader;
41#[doc = "Field `configb_rsvd` reader - reserved"]
42pub type ConfigbRsvdR = crate::FieldReader;
43#[doc = "Field `sha_256_only` reader - HAS SHA-256 ONLY"]
44pub type Sha256OnlyR = crate::BitReader;
45#[doc = "Field `spb_support` reader - ID_CFG_SGI_SPB_SUPPORT is set"]
46pub type SpbSupportR = crate::BitReader;
47#[doc = "Field `spb_masking` reader - ID_CFG_SGI_SPB_MASKING is set"]
48pub type SpbMaskingR = crate::BitReader;
49#[doc = "Field `sfr_sw_mask` reader - ID_CFG_SGI_USE_SFR_SW_MASK is set"]
50pub type SfrSwMaskR = crate::BitReader;
51#[doc = "Field `configa_rsvd` reader - reserved"]
52pub type ConfigaRsvdR = crate::FieldReader;
53impl R {
54    #[doc = "Bit 0 - SGI Diversified for 'ROW'"]
55    #[inline(always)]
56    pub fn row(&self) -> RowR {
57        RowR::new((self.bits & 1) != 0)
58    }
59    #[doc = "Bit 1 - SGI Diversified for 'CHINA'"]
60    #[inline(always)]
61    pub fn china(&self) -> ChinaR {
62        ChinaR::new(((self.bits >> 1) & 1) != 0)
63    }
64    #[doc = "Bit 2 - SGI Diversified for 'CC'"]
65    #[inline(always)]
66    pub fn cc(&self) -> CcR {
67        CcR::new(((self.bits >> 2) & 1) != 0)
68    }
69    #[doc = "Bit 3 - HAS AES"]
70    #[inline(always)]
71    pub fn has_aes(&self) -> HasAesR {
72        HasAesR::new(((self.bits >> 3) & 1) != 0)
73    }
74    #[doc = "Bit 4 - HAS DES"]
75    #[inline(always)]
76    pub fn has_des(&self) -> HasDesR {
77        HasDesR::new(((self.bits >> 4) & 1) != 0)
78    }
79    #[doc = "Bit 5 - HAS SHA"]
80    #[inline(always)]
81    pub fn has_sha(&self) -> HasShaR {
82        HasShaR::new(((self.bits >> 5) & 1) != 0)
83    }
84    #[doc = "Bit 6 - HAS MOVEM"]
85    #[inline(always)]
86    pub fn has_movem(&self) -> HasMovemR {
87        HasMovemR::new(((self.bits >> 6) & 1) != 0)
88    }
89    #[doc = "Bit 7 - HAS CMAC"]
90    #[inline(always)]
91    pub fn has_cmac(&self) -> HasCmacR {
92        HasCmacR::new(((self.bits >> 7) & 1) != 0)
93    }
94    #[doc = "Bit 8 - HAS GFMUL"]
95    #[inline(always)]
96    pub fn has_gfmul(&self) -> HasGfmulR {
97        HasGfmulR::new(((self.bits >> 8) & 1) != 0)
98    }
99    #[doc = "Bit 9 - HAS INTERNAL PRNG"]
100    #[inline(always)]
101    pub fn internal_prng(&self) -> InternalPrngR {
102        InternalPrngR::new(((self.bits >> 9) & 1) != 0)
103    }
104    #[doc = "Bit 10 - HAS KEY DIGEST"]
105    #[inline(always)]
106    pub fn key_digest(&self) -> KeyDigestR {
107        KeyDigestR::new(((self.bits >> 10) & 1) != 0)
108    }
109    #[doc = "Bit 11 - 0 - COUNT=16, 1 - COUNT=32"]
110    #[inline(always)]
111    pub fn count_size(&self) -> CountSizeR {
112        CountSizeR::new(((self.bits >> 11) & 1) != 0)
113    }
114    #[doc = "Bit 12 - reserved"]
115    #[inline(always)]
116    pub fn configc_rsvd(&self) -> ConfigcRsvdR {
117        ConfigcRsvdR::new(((self.bits >> 12) & 1) != 0)
118    }
119    #[doc = "Bit 13 - HAS FA protection"]
120    #[inline(always)]
121    pub fn fa(&self) -> FaR {
122        FaR::new(((self.bits >> 13) & 1) != 0)
123    }
124    #[doc = "Bit 14 - reserved"]
125    #[inline(always)]
126    pub fn configb2_rsvd(&self) -> Configb2RsvdR {
127        Configb2RsvdR::new(((self.bits >> 14) & 1) != 0)
128    }
129    #[doc = "Bit 15 - 0 - BUS_WIDTH=16, 1 - BUS_WIDTH=32"]
130    #[inline(always)]
131    pub fn bus_width(&self) -> BusWidthR {
132        BusWidthR::new(((self.bits >> 15) & 1) != 0)
133    }
134    #[doc = "Bits 16:17 - NUMBER OF DATIN REGBANKS"]
135    #[inline(always)]
136    pub fn num_datin(&self) -> NumDatinR {
137        NumDatinR::new(((self.bits >> 16) & 3) as u8)
138    }
139    #[doc = "Bits 18:20 - NUMBER OR KEY REGBANKS"]
140    #[inline(always)]
141    pub fn num_key(&self) -> NumKeyR {
142        NumKeyR::new(((self.bits >> 18) & 7) as u8)
143    }
144    #[doc = "Bit 21 - DATIN to KERNEL End-to-end EDC is enabled"]
145    #[inline(always)]
146    pub fn edc(&self) -> EdcR {
147        EdcR::new(((self.bits >> 21) & 1) != 0)
148    }
149    #[doc = "Bits 22:23 - reserved"]
150    #[inline(always)]
151    pub fn configb_rsvd(&self) -> ConfigbRsvdR {
152        ConfigbRsvdR::new(((self.bits >> 22) & 3) as u8)
153    }
154    #[doc = "Bit 24 - HAS SHA-256 ONLY"]
155    #[inline(always)]
156    pub fn sha_256_only(&self) -> Sha256OnlyR {
157        Sha256OnlyR::new(((self.bits >> 24) & 1) != 0)
158    }
159    #[doc = "Bit 25 - ID_CFG_SGI_SPB_SUPPORT is set"]
160    #[inline(always)]
161    pub fn spb_support(&self) -> SpbSupportR {
162        SpbSupportR::new(((self.bits >> 25) & 1) != 0)
163    }
164    #[doc = "Bit 26 - ID_CFG_SGI_SPB_MASKING is set"]
165    #[inline(always)]
166    pub fn spb_masking(&self) -> SpbMaskingR {
167        SpbMaskingR::new(((self.bits >> 26) & 1) != 0)
168    }
169    #[doc = "Bit 27 - ID_CFG_SGI_USE_SFR_SW_MASK is set"]
170    #[inline(always)]
171    pub fn sfr_sw_mask(&self) -> SfrSwMaskR {
172        SfrSwMaskR::new(((self.bits >> 27) & 1) != 0)
173    }
174    #[doc = "Bits 28:31 - reserved"]
175    #[inline(always)]
176    pub fn configa_rsvd(&self) -> ConfigaRsvdR {
177        ConfigaRsvdR::new(((self.bits >> 28) & 0x0f) as u8)
178    }
179}
180#[cfg(feature = "debug")]
181impl core::fmt::Debug for R {
182    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
183        f.debug_struct("sgi_config")
184            .field("row", &self.row())
185            .field("china", &self.china())
186            .field("cc", &self.cc())
187            .field("has_aes", &self.has_aes())
188            .field("has_des", &self.has_des())
189            .field("has_sha", &self.has_sha())
190            .field("has_movem", &self.has_movem())
191            .field("has_cmac", &self.has_cmac())
192            .field("has_gfmul", &self.has_gfmul())
193            .field("internal_prng", &self.internal_prng())
194            .field("key_digest", &self.key_digest())
195            .field("count_size", &self.count_size())
196            .field("configc_rsvd", &self.configc_rsvd())
197            .field("fa", &self.fa())
198            .field("configb2_rsvd", &self.configb2_rsvd())
199            .field("bus_width", &self.bus_width())
200            .field("num_datin", &self.num_datin())
201            .field("num_key", &self.num_key())
202            .field("edc", &self.edc())
203            .field("configb_rsvd", &self.configb_rsvd())
204            .field("sha_256_only", &self.sha_256_only())
205            .field("spb_support", &self.spb_support())
206            .field("spb_masking", &self.spb_masking())
207            .field("sfr_sw_mask", &self.sfr_sw_mask())
208            .field("configa_rsvd", &self.configa_rsvd())
209            .finish()
210    }
211}
212#[doc = "SHA Configuration Reg\n\nYou can [`read`](crate::Reg::read) this register and get [`sgi_config::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
213pub struct SgiConfigSpec;
214impl crate::RegisterSpec for SgiConfigSpec {
215    type Ux = u32;
216}
217#[doc = "`read()` method returns [`sgi_config::R`](R) reader structure"]
218impl crate::Readable for SgiConfigSpec {}
219#[doc = "`reset()` method sets sgi_config to value 0"]
220impl crate::Resettable for SgiConfigSpec {}