1#[doc = "Register `ICR` reader"]
2pub type R = crate::R<IcrSpec>;
3#[doc = "Register `ICR` writer"]
4pub type W = crate::W<IcrSpec>;
5#[doc = "Field `EHR_VALID` reader - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\] registers have been read"]
6pub type EhrValidR = crate::BitReader;
7#[doc = "Field `EHR_VALID` writer - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\] registers have been read"]
8pub type EhrValidW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `AUTOCORR_ERR` reader - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
10pub type AutocorrErrR = crate::BitReader;
11#[doc = "Field `AUTOCORR_ERR` writer - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
12pub type AutocorrErrW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CRNGT_ERR` reader - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
14pub type CrngtErrR = crate::BitReader;
15#[doc = "Field `CRNGT_ERR` writer - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
16pub type CrngtErrW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `VN_ERR` reader - Clears a Von Neumann error"]
18pub type VnErrR = crate::BitReader;
19#[doc = "Field `VN_ERR` writer - Clears a Von Neumann error"]
20pub type VnErrW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\] registers have been read"]
23    #[inline(always)]
24    pub fn ehr_valid(&self) -> EhrValidR {
25        EhrValidR::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
28    #[inline(always)]
29    pub fn autocorr_err(&self) -> AutocorrErrR {
30        AutocorrErrR::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
33    #[inline(always)]
34    pub fn crngt_err(&self) -> CrngtErrR {
35        CrngtErrR::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3 - Clears a Von Neumann error"]
38    #[inline(always)]
39    pub fn vn_err(&self) -> VnErrR {
40        VnErrR::new(((self.bits >> 3) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - Set to 1 after the EHR_DATA\\[0,1,2,3,4,5\\] registers have been read"]
45    #[inline(always)]
46    pub fn ehr_valid(&mut self) -> EhrValidW<'_, IcrSpec> {
47        EhrValidW::new(self, 0)
48    }
49    #[doc = "Bit 1 - Software cannot clear this bit. Only a TRNG reset can clear this bit"]
50    #[inline(always)]
51    pub fn autocorr_err(&mut self) -> AutocorrErrW<'_, IcrSpec> {
52        AutocorrErrW::new(self, 1)
53    }
54    #[doc = "Bit 2 - Clear a Continuous Random Number Generation Testing (CRNGT) error"]
55    #[inline(always)]
56    pub fn crngt_err(&mut self) -> CrngtErrW<'_, IcrSpec> {
57        CrngtErrW::new(self, 2)
58    }
59    #[doc = "Bit 3 - Clears a Von Neumann error"]
60    #[inline(always)]
61    pub fn vn_err(&mut self) -> VnErrW<'_, IcrSpec> {
62        VnErrW::new(self, 3)
63    }
64}
65#[doc = "Interrupt Clear Register\n\nYou can [`read`](crate::Reg::read) this register and get [`icr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`icr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
66pub struct IcrSpec;
67impl crate::RegisterSpec for IcrSpec {
68    type Ux = u32;
69}
70#[doc = "`read()` method returns [`icr::R`](R) reader structure"]
71impl crate::Readable for IcrSpec {}
72#[doc = "`write(|w| ..)` method takes [`icr::W`](W) writer structure"]
73impl crate::Writable for IcrSpec {
74    type Safety = crate::Unsafe;
75}
76#[doc = "`reset()` method sets ICR to value 0"]
77impl crate::Resettable for IcrSpec {}