Monorepo for Rust support of VA416XX family of radiation hardened MCUs
This commit is contained in:
55
va416xx/src/trng/autocorr_statistic.rs
Normal file
55
va416xx/src/trng/autocorr_statistic.rs
Normal file
@ -0,0 +1,55 @@
|
||||
#[doc = "Register `AUTOCORR_STATISTIC` reader"]
|
||||
pub type R = crate::R<AutocorrStatisticSpec>;
|
||||
#[doc = "Register `AUTOCORR_STATISTIC` writer"]
|
||||
pub type W = crate::W<AutocorrStatisticSpec>;
|
||||
#[doc = "Field `AUTOCORR_TRYS` reader - Count each time an autocorrelation test starts"]
|
||||
pub type AutocorrTrysR = crate::FieldReader<u16>;
|
||||
#[doc = "Field `AUTOCORR_TRYS` writer - Count each time an autocorrelation test starts"]
|
||||
pub type AutocorrTrysW<'a, REG> = crate::FieldWriter<'a, REG, 14, u16>;
|
||||
#[doc = "Field `AUTOCORR_FAILS` reader - Count each time an autocorrelation test fails"]
|
||||
pub type AutocorrFailsR = crate::FieldReader;
|
||||
#[doc = "Field `AUTOCORR_FAILS` writer - Count each time an autocorrelation test fails"]
|
||||
pub type AutocorrFailsW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:13 - Count each time an autocorrelation test starts"]
|
||||
#[inline(always)]
|
||||
pub fn autocorr_trys(&self) -> AutocorrTrysR {
|
||||
AutocorrTrysR::new((self.bits & 0x3fff) as u16)
|
||||
}
|
||||
#[doc = "Bits 14:21 - Count each time an autocorrelation test fails"]
|
||||
#[inline(always)]
|
||||
pub fn autocorr_fails(&self) -> AutocorrFailsR {
|
||||
AutocorrFailsR::new(((self.bits >> 14) & 0xff) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:13 - Count each time an autocorrelation test starts"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn autocorr_trys(&mut self) -> AutocorrTrysW<AutocorrStatisticSpec> {
|
||||
AutocorrTrysW::new(self, 0)
|
||||
}
|
||||
#[doc = "Bits 14:21 - Count each time an autocorrelation test fails"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn autocorr_fails(&mut self) -> AutocorrFailsW<AutocorrStatisticSpec> {
|
||||
AutocorrFailsW::new(self, 14)
|
||||
}
|
||||
}
|
||||
#[doc = "Auto-correlator Statistic Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`autocorr_statistic::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`autocorr_statistic::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct AutocorrStatisticSpec;
|
||||
impl crate::RegisterSpec for AutocorrStatisticSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`autocorr_statistic::R`](R) reader structure"]
|
||||
impl crate::Readable for AutocorrStatisticSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`autocorr_statistic::W`](W) writer structure"]
|
||||
impl crate::Writable for AutocorrStatisticSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets AUTOCORR_STATISTIC to value 0"]
|
||||
impl crate::Resettable for AutocorrStatisticSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
22
va416xx/src/trng/bist_cntr0.rs
Normal file
22
va416xx/src/trng/bist_cntr0.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#[doc = "Register `BIST_CNTR0` reader"]
|
||||
pub type R = crate::R<BistCntr0Spec>;
|
||||
#[doc = "Field `ROSC_CNTR_VAL` reader - Returns the results of the TRNG BIST counter"]
|
||||
pub type RoscCntrValR = crate::FieldReader<u32>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:21 - Returns the results of the TRNG BIST counter"]
|
||||
#[inline(always)]
|
||||
pub fn rosc_cntr_val(&self) -> RoscCntrValR {
|
||||
RoscCntrValR::new(self.bits & 0x003f_ffff)
|
||||
}
|
||||
}
|
||||
#[doc = "BIST Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bist_cntr0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct BistCntr0Spec;
|
||||
impl crate::RegisterSpec for BistCntr0Spec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`bist_cntr0::R`](R) reader structure"]
|
||||
impl crate::Readable for BistCntr0Spec {}
|
||||
#[doc = "`reset()` method sets BIST_CNTR0 to value 0"]
|
||||
impl crate::Resettable for BistCntr0Spec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
22
va416xx/src/trng/busy.rs
Normal file
22
va416xx/src/trng/busy.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#[doc = "Register `BUSY` reader"]
|
||||
pub type R = crate::R<BusySpec>;
|
||||
#[doc = "Field `BUSY` reader - Reflects the status of the rng_busy signal"]
|
||||
pub type BusyR = crate::BitReader;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Reflects the status of the rng_busy signal"]
|
||||
#[inline(always)]
|
||||
pub fn busy(&self) -> BusyR {
|
||||
BusyR::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Busy Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`busy::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct BusySpec;
|
||||
impl crate::RegisterSpec for BusySpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`busy::R`](R) reader structure"]
|
||||
impl crate::Readable for BusySpec {}
|
||||
#[doc = "`reset()` method sets BUSY to value 0"]
|
||||
impl crate::Resettable for BusySpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
40
va416xx/src/trng/config.rs
Normal file
40
va416xx/src/trng/config.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[doc = "Register `CONFIG` reader"]
|
||||
pub type R = crate::R<ConfigSpec>;
|
||||
#[doc = "Register `CONFIG` writer"]
|
||||
pub type W = crate::W<ConfigSpec>;
|
||||
#[doc = "Field `RND_SRC_SEL` reader - Selects the number of inverters (out of four possible selections) in the ring oscillator"]
|
||||
pub type RndSrcSelR = crate::FieldReader;
|
||||
#[doc = "Field `RND_SRC_SEL` writer - Selects the number of inverters (out of four possible selections) in the ring oscillator"]
|
||||
pub type RndSrcSelW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:1 - Selects the number of inverters (out of four possible selections) in the ring oscillator"]
|
||||
#[inline(always)]
|
||||
pub fn rnd_src_sel(&self) -> RndSrcSelR {
|
||||
RndSrcSelR::new((self.bits & 3) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:1 - Selects the number of inverters (out of four possible selections) in the ring oscillator"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn rnd_src_sel(&mut self) -> RndSrcSelW<ConfigSpec> {
|
||||
RndSrcSelW::new(self, 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`config::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`config::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct ConfigSpec;
|
||||
impl crate::RegisterSpec for ConfigSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`config::R`](R) reader structure"]
|
||||
impl crate::Readable for ConfigSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`config::W`](W) writer structure"]
|
||||
impl crate::Writable for ConfigSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets CONFIG to value 0"]
|
||||
impl crate::Resettable for ConfigSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
70
va416xx/src/trng/debug_control.rs
Normal file
70
va416xx/src/trng/debug_control.rs
Normal file
@ -0,0 +1,70 @@
|
||||
#[doc = "Register `DEBUG_CONTROL` reader"]
|
||||
pub type R = crate::R<DebugControlSpec>;
|
||||
#[doc = "Register `DEBUG_CONTROL` writer"]
|
||||
pub type W = crate::W<DebugControlSpec>;
|
||||
#[doc = "Field `VNC_PYPASS` reader - The Von Neumann balancer is bypassed"]
|
||||
pub type VncPypassR = crate::BitReader;
|
||||
#[doc = "Field `VNC_PYPASS` writer - The Von Neumann balancer is bypassed"]
|
||||
pub type VncPypassW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `CRNGT_BYPASS` reader - The CRNGT test in the TRNG is bypassed"]
|
||||
pub type CrngtBypassR = crate::BitReader;
|
||||
#[doc = "Field `CRNGT_BYPASS` writer - The CRNGT test in the TRNG is bypassed"]
|
||||
pub type CrngtBypassW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `AUTO_CORRELATE_BYPASS` reader - The autocorrelation test in the TRNG module is bypassed"]
|
||||
pub type AutoCorrelateBypassR = crate::BitReader;
|
||||
#[doc = "Field `AUTO_CORRELATE_BYPASS` writer - The autocorrelation test in the TRNG module is bypassed"]
|
||||
pub type AutoCorrelateBypassW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 1 - The Von Neumann balancer is bypassed"]
|
||||
#[inline(always)]
|
||||
pub fn vnc_pypass(&self) -> VncPypassR {
|
||||
VncPypassR::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - The CRNGT test in the TRNG is bypassed"]
|
||||
#[inline(always)]
|
||||
pub fn crngt_bypass(&self) -> CrngtBypassR {
|
||||
CrngtBypassR::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - The autocorrelation test in the TRNG module is bypassed"]
|
||||
#[inline(always)]
|
||||
pub fn auto_correlate_bypass(&self) -> AutoCorrelateBypassR {
|
||||
AutoCorrelateBypassR::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 1 - The Von Neumann balancer is bypassed"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn vnc_pypass(&mut self) -> VncPypassW<DebugControlSpec> {
|
||||
VncPypassW::new(self, 1)
|
||||
}
|
||||
#[doc = "Bit 2 - The CRNGT test in the TRNG is bypassed"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn crngt_bypass(&mut self) -> CrngtBypassW<DebugControlSpec> {
|
||||
CrngtBypassW::new(self, 2)
|
||||
}
|
||||
#[doc = "Bit 3 - The autocorrelation test in the TRNG module is bypassed"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn auto_correlate_bypass(&mut self) -> AutoCorrelateBypassW<DebugControlSpec> {
|
||||
AutoCorrelateBypassW::new(self, 3)
|
||||
}
|
||||
}
|
||||
#[doc = "Section TBD\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`debug_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`debug_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct DebugControlSpec;
|
||||
impl crate::RegisterSpec for DebugControlSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`debug_control::R`](R) reader structure"]
|
||||
impl crate::Readable for DebugControlSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`debug_control::W`](W) writer structure"]
|
||||
impl crate::Writable for DebugControlSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets DEBUG_CONTROL to value 0"]
|
||||
impl crate::Resettable for DebugControlSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
22
va416xx/src/trng/ehr_data0.rs
Normal file
22
va416xx/src/trng/ehr_data0.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#[doc = "Register `EHR_DATA0` reader"]
|
||||
pub type R = crate::R<EhrData0Spec>;
|
||||
#[doc = "Field `EHR_DATA` reader - 32 Bits of Entropy Holding Register"]
|
||||
pub type EhrDataR = crate::FieldReader<u32>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:31 - 32 Bits of Entropy Holding Register"]
|
||||
#[inline(always)]
|
||||
pub fn ehr_data(&self) -> EhrDataR {
|
||||
EhrDataR::new(self.bits)
|
||||
}
|
||||
}
|
||||
#[doc = "Entropy Holding Register Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ehr_data0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct EhrData0Spec;
|
||||
impl crate::RegisterSpec for EhrData0Spec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`ehr_data0::R`](R) reader structure"]
|
||||
impl crate::Readable for EhrData0Spec {}
|
||||
#[doc = "`reset()` method sets EHR_DATA0 to value 0"]
|
||||
impl crate::Resettable for EhrData0Spec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
89
va416xx/src/trng/icr.rs
Normal file
89
va416xx/src/trng/icr.rs
Normal file
@ -0,0 +1,89 @@
|
||||
#[doc = "Register `ICR` reader"]
|
||||
pub type R = crate::R<IcrSpec>;
|
||||
#[doc = "Register `ICR` writer"]
|
||||
pub type W = crate::W<IcrSpec>;
|
||||
#[doc = "Field `EHR_VALID` reader - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\]
|
||||
registers have been read"]
|
||||
pub type EhrValidR = crate::BitReader;
|
||||
#[doc = "Field `EHR_VALID` writer - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\]
|
||||
registers have been read"]
|
||||
pub type EhrValidW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `AUTOCORR_ERR` reader - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
|
||||
pub type AutocorrErrR = crate::BitReader;
|
||||
#[doc = "Field `AUTOCORR_ERR` writer - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
|
||||
pub type AutocorrErrW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `CRNGT_ERR` reader - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
pub type CrngtErrR = crate::BitReader;
|
||||
#[doc = "Field `CRNGT_ERR` writer - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
pub type CrngtErrW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `VN_ERR` reader - Clears a Von Neumann error"]
|
||||
pub type VnErrR = crate::BitReader;
|
||||
#[doc = "Field `VN_ERR` writer - Clears a Von Neumann error"]
|
||||
pub type VnErrW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\]
|
||||
registers have been read"]
|
||||
#[inline(always)]
|
||||
pub fn ehr_valid(&self) -> EhrValidR {
|
||||
EhrValidR::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
|
||||
#[inline(always)]
|
||||
pub fn autocorr_err(&self) -> AutocorrErrR {
|
||||
AutocorrErrR::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
#[inline(always)]
|
||||
pub fn crngt_err(&self) -> CrngtErrR {
|
||||
CrngtErrR::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Clears a Von Neumann error"]
|
||||
#[inline(always)]
|
||||
pub fn vn_err(&self) -> VnErrR {
|
||||
VnErrR::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\]
|
||||
registers have been read"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn ehr_valid(&mut self) -> EhrValidW<IcrSpec> {
|
||||
EhrValidW::new(self, 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn autocorr_err(&mut self) -> AutocorrErrW<IcrSpec> {
|
||||
AutocorrErrW::new(self, 1)
|
||||
}
|
||||
#[doc = "Bit 2 - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn crngt_err(&mut self) -> CrngtErrW<IcrSpec> {
|
||||
CrngtErrW::new(self, 2)
|
||||
}
|
||||
#[doc = "Bit 3 - Clears a Von Neumann error"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn vn_err(&mut self) -> VnErrW<IcrSpec> {
|
||||
VnErrW::new(self, 3)
|
||||
}
|
||||
}
|
||||
#[doc = "Interrupt Clear Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`icr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`icr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct IcrSpec;
|
||||
impl crate::RegisterSpec for IcrSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`icr::R`](R) reader structure"]
|
||||
impl crate::Readable for IcrSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`icr::W`](W) writer structure"]
|
||||
impl crate::Writable for IcrSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets ICR to value 0"]
|
||||
impl crate::Resettable for IcrSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
85
va416xx/src/trng/imr.rs
Normal file
85
va416xx/src/trng/imr.rs
Normal file
@ -0,0 +1,85 @@
|
||||
#[doc = "Register `IMR` reader"]
|
||||
pub type R = crate::R<ImrSpec>;
|
||||
#[doc = "Register `IMR` writer"]
|
||||
pub type W = crate::W<ImrSpec>;
|
||||
#[doc = "Field `EHR_VALID_INT_MASK` reader - Mask when the TRNG has collected 192 bits"]
|
||||
pub type EhrValidIntMaskR = crate::BitReader;
|
||||
#[doc = "Field `EHR_VALID_INT_MASK` writer - Mask when the TRNG has collected 192 bits"]
|
||||
pub type EhrValidIntMaskW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `AUTOCORR_ERR_INT_MASK` reader - Mask the Autocorrelation error"]
|
||||
pub type AutocorrErrIntMaskR = crate::BitReader;
|
||||
#[doc = "Field `AUTOCORR_ERR_INT_MASK` writer - Mask the Autocorrelation error"]
|
||||
pub type AutocorrErrIntMaskW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `CRNGT_ERR_INT_MASK` reader - Mask the CRNGT error"]
|
||||
pub type CrngtErrIntMaskR = crate::BitReader;
|
||||
#[doc = "Field `CRNGT_ERR_INT_MASK` writer - Mask the CRNGT error"]
|
||||
pub type CrngtErrIntMaskW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
#[doc = "Field `VN_ERR_INT_MASK` reader - Mask the Von Neumann error"]
|
||||
pub type VnErrIntMaskR = crate::BitReader;
|
||||
#[doc = "Field `VN_ERR_INT_MASK` writer - Mask the Von Neumann error"]
|
||||
pub type VnErrIntMaskW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Mask when the TRNG has collected 192 bits"]
|
||||
#[inline(always)]
|
||||
pub fn ehr_valid_int_mask(&self) -> EhrValidIntMaskR {
|
||||
EhrValidIntMaskR::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Mask the Autocorrelation error"]
|
||||
#[inline(always)]
|
||||
pub fn autocorr_err_int_mask(&self) -> AutocorrErrIntMaskR {
|
||||
AutocorrErrIntMaskR::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Mask the CRNGT error"]
|
||||
#[inline(always)]
|
||||
pub fn crngt_err_int_mask(&self) -> CrngtErrIntMaskR {
|
||||
CrngtErrIntMaskR::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Mask the Von Neumann error"]
|
||||
#[inline(always)]
|
||||
pub fn vn_err_int_mask(&self) -> VnErrIntMaskR {
|
||||
VnErrIntMaskR::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Mask when the TRNG has collected 192 bits"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn ehr_valid_int_mask(&mut self) -> EhrValidIntMaskW<ImrSpec> {
|
||||
EhrValidIntMaskW::new(self, 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Mask the Autocorrelation error"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn autocorr_err_int_mask(&mut self) -> AutocorrErrIntMaskW<ImrSpec> {
|
||||
AutocorrErrIntMaskW::new(self, 1)
|
||||
}
|
||||
#[doc = "Bit 2 - Mask the CRNGT error"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn crngt_err_int_mask(&mut self) -> CrngtErrIntMaskW<ImrSpec> {
|
||||
CrngtErrIntMaskW::new(self, 2)
|
||||
}
|
||||
#[doc = "Bit 3 - Mask the Von Neumann error"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn vn_err_int_mask(&mut self) -> VnErrIntMaskW<ImrSpec> {
|
||||
VnErrIntMaskW::new(self, 3)
|
||||
}
|
||||
}
|
||||
#[doc = "Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`imr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`imr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct ImrSpec;
|
||||
impl crate::RegisterSpec for ImrSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`imr::R`](R) reader structure"]
|
||||
impl crate::Readable for ImrSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`imr::W`](W) writer structure"]
|
||||
impl crate::Writable for ImrSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets IMR to value 0x0f"]
|
||||
impl crate::Resettable for ImrSpec {
|
||||
const RESET_VALUE: u32 = 0x0f;
|
||||
}
|
43
va416xx/src/trng/isr.rs
Normal file
43
va416xx/src/trng/isr.rs
Normal file
@ -0,0 +1,43 @@
|
||||
#[doc = "Register `ISR` reader"]
|
||||
pub type R = crate::R<IsrSpec>;
|
||||
#[doc = "Field `EHR_VALID` reader - 192 bits have been collected in the TRNG"]
|
||||
pub type EhrValidR = crate::BitReader;
|
||||
#[doc = "Field `AUTOCORR_ERR` reader - Indicates that the Autocorrelation test failed four times in a row"]
|
||||
pub type AutocorrErrR = crate::BitReader;
|
||||
#[doc = "Field `CRNGT_ERR` reader - Indicates a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
pub type CrngtErrR = crate::BitReader;
|
||||
#[doc = "Field `VN_ERR` reader - Indicates a Von Neumann error"]
|
||||
pub type VnErrR = crate::BitReader;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - 192 bits have been collected in the TRNG"]
|
||||
#[inline(always)]
|
||||
pub fn ehr_valid(&self) -> EhrValidR {
|
||||
EhrValidR::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Indicates that the Autocorrelation test failed four times in a row"]
|
||||
#[inline(always)]
|
||||
pub fn autocorr_err(&self) -> AutocorrErrR {
|
||||
AutocorrErrR::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Indicates a Continuous Random Number Generation Testing (CRNGT) error"]
|
||||
#[inline(always)]
|
||||
pub fn crngt_err(&self) -> CrngtErrR {
|
||||
CrngtErrR::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Indicates a Von Neumann error"]
|
||||
#[inline(always)]
|
||||
pub fn vn_err(&self) -> VnErrR {
|
||||
VnErrR::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Interrupt Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`isr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct IsrSpec;
|
||||
impl crate::RegisterSpec for IsrSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`isr::R`](R) reader structure"]
|
||||
impl crate::Readable for IsrSpec {}
|
||||
#[doc = "`reset()` method sets ISR to value 0"]
|
||||
impl crate::Resettable for IsrSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
40
va416xx/src/trng/rnd_source_enable.rs
Normal file
40
va416xx/src/trng/rnd_source_enable.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[doc = "Register `RND_SOURCE_ENABLE` reader"]
|
||||
pub type R = crate::R<RndSourceEnableSpec>;
|
||||
#[doc = "Register `RND_SOURCE_ENABLE` writer"]
|
||||
pub type W = crate::W<RndSourceEnableSpec>;
|
||||
#[doc = "Field `RND_SRC_EN` reader - The entropy source, ring oscillator, is enabled"]
|
||||
pub type RndSrcEnR = crate::BitReader;
|
||||
#[doc = "Field `RND_SRC_EN` writer - The entropy source, ring oscillator, is enabled"]
|
||||
pub type RndSrcEnW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - The entropy source, ring oscillator, is enabled"]
|
||||
#[inline(always)]
|
||||
pub fn rnd_src_en(&self) -> RndSrcEnR {
|
||||
RndSrcEnR::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - The entropy source, ring oscillator, is enabled"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn rnd_src_en(&mut self) -> RndSrcEnW<RndSourceEnableSpec> {
|
||||
RndSrcEnW::new(self, 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Random Source Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rnd_source_enable::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rnd_source_enable::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct RndSourceEnableSpec;
|
||||
impl crate::RegisterSpec for RndSourceEnableSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`rnd_source_enable::R`](R) reader structure"]
|
||||
impl crate::Readable for RndSourceEnableSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`rnd_source_enable::W`](W) writer structure"]
|
||||
impl crate::Writable for RndSourceEnableSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets RND_SOURCE_ENABLE to value 0"]
|
||||
impl crate::Resettable for RndSourceEnableSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
40
va416xx/src/trng/rst_bits_counter.rs
Normal file
40
va416xx/src/trng/rst_bits_counter.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[doc = "Register `RST_BITS_COUNTER` reader"]
|
||||
pub type R = crate::R<RstBitsCounterSpec>;
|
||||
#[doc = "Register `RST_BITS_COUNTER` writer"]
|
||||
pub type W = crate::W<RstBitsCounterSpec>;
|
||||
#[doc = "Field `RST_BITS_COUNTER` reader - Writing any value to this bit resets the bits counter and TRNG valid registers"]
|
||||
pub type RstBitsCounterR = crate::BitReader;
|
||||
#[doc = "Field `RST_BITS_COUNTER` writer - Writing any value to this bit resets the bits counter and TRNG valid registers"]
|
||||
pub type RstBitsCounterW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Writing any value to this bit resets the bits counter and TRNG valid registers"]
|
||||
#[inline(always)]
|
||||
pub fn rst_bits_counter(&self) -> RstBitsCounterR {
|
||||
RstBitsCounterR::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Writing any value to this bit resets the bits counter and TRNG valid registers"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn rst_bits_counter(&mut self) -> RstBitsCounterW<RstBitsCounterSpec> {
|
||||
RstBitsCounterW::new(self, 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Reset Bits Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rst_bits_counter::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rst_bits_counter::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct RstBitsCounterSpec;
|
||||
impl crate::RegisterSpec for RstBitsCounterSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`rst_bits_counter::R`](R) reader structure"]
|
||||
impl crate::Readable for RstBitsCounterSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`rst_bits_counter::W`](W) writer structure"]
|
||||
impl crate::Writable for RstBitsCounterSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets RST_BITS_COUNTER to value 0"]
|
||||
impl crate::Resettable for RstBitsCounterSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
40
va416xx/src/trng/sample_cnt1.rs
Normal file
40
va416xx/src/trng/sample_cnt1.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[doc = "Register `SAMPLE_CNT1` reader"]
|
||||
pub type R = crate::R<SampleCnt1Spec>;
|
||||
#[doc = "Register `SAMPLE_CNT1` writer"]
|
||||
pub type W = crate::W<SampleCnt1Spec>;
|
||||
#[doc = "Field `SAMPLE_CNTR1` reader - Sets the number of clk cycles between two consecutive ring oscillator samples"]
|
||||
pub type SampleCntr1R = crate::FieldReader<u32>;
|
||||
#[doc = "Field `SAMPLE_CNTR1` writer - Sets the number of clk cycles between two consecutive ring oscillator samples"]
|
||||
pub type SampleCntr1W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:31 - Sets the number of clk cycles between two consecutive ring oscillator samples"]
|
||||
#[inline(always)]
|
||||
pub fn sample_cntr1(&self) -> SampleCntr1R {
|
||||
SampleCntr1R::new(self.bits)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:31 - Sets the number of clk cycles between two consecutive ring oscillator samples"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn sample_cntr1(&mut self) -> SampleCntr1W<SampleCnt1Spec> {
|
||||
SampleCntr1W::new(self, 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Section TBD\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sample_cnt1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sample_cnt1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct SampleCnt1Spec;
|
||||
impl crate::RegisterSpec for SampleCnt1Spec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`sample_cnt1::R`](R) reader structure"]
|
||||
impl crate::Readable for SampleCnt1Spec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`sample_cnt1::W`](W) writer structure"]
|
||||
impl crate::Writable for SampleCnt1Spec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets SAMPLE_CNT1 to value 0xffff"]
|
||||
impl crate::Resettable for SampleCnt1Spec {
|
||||
const RESET_VALUE: u32 = 0xffff;
|
||||
}
|
40
va416xx/src/trng/sw_reset.rs
Normal file
40
va416xx/src/trng/sw_reset.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[doc = "Register `SW_RESET` reader"]
|
||||
pub type R = crate::R<SwResetSpec>;
|
||||
#[doc = "Register `SW_RESET` writer"]
|
||||
pub type W = crate::W<SwResetSpec>;
|
||||
#[doc = "Field `SW_RESET` reader - Writing 1 to this register causes an internal TRNG reset"]
|
||||
pub type SwResetR = crate::BitReader;
|
||||
#[doc = "Field `SW_RESET` writer - Writing 1 to this register causes an internal TRNG reset"]
|
||||
pub type SwResetW<'a, REG> = crate::BitWriter<'a, REG>;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Writing 1 to this register causes an internal TRNG reset"]
|
||||
#[inline(always)]
|
||||
pub fn sw_reset(&self) -> SwResetR {
|
||||
SwResetR::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Writing 1 to this register causes an internal TRNG reset"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn sw_reset(&mut self) -> SwResetW<SwResetSpec> {
|
||||
SwResetW::new(self, 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Reset Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sw_reset::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sw_reset::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct SwResetSpec;
|
||||
impl crate::RegisterSpec for SwResetSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`sw_reset::R`](R) reader structure"]
|
||||
impl crate::Readable for SwResetSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`sw_reset::W`](W) writer structure"]
|
||||
impl crate::Writable for SwResetSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets SW_RESET to value 0"]
|
||||
impl crate::Resettable for SwResetSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
22
va416xx/src/trng/valid.rs
Normal file
22
va416xx/src/trng/valid.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#[doc = "Register `VALID` reader"]
|
||||
pub type R = crate::R<ValidSpec>;
|
||||
#[doc = "Field `EHR_VALID` reader - Indicates that the collection of bits in the TRNG is complete"]
|
||||
pub type EhrValidR = crate::BitReader;
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Indicates that the collection of bits in the TRNG is complete"]
|
||||
#[inline(always)]
|
||||
pub fn ehr_valid(&self) -> EhrValidR {
|
||||
EhrValidR::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Valid Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`valid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct ValidSpec;
|
||||
impl crate::RegisterSpec for ValidSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`valid::R`](R) reader structure"]
|
||||
impl crate::Readable for ValidSpec {}
|
||||
#[doc = "`reset()` method sets VALID to value 0"]
|
||||
impl crate::Resettable for ValidSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
Reference in New Issue
Block a user