cc2538_pac/soc_adc/
rndl.rs1#[doc = "Register `RNDL` reader"]
2pub type R = crate::R<RndlSpec>;
3#[doc = "Register `RNDL` writer"]
4pub type W = crate::W<RndlSpec>;
5#[doc = "Field `RNDL` reader - Random value/seed or CRC result, low byte When used for random-number generation, writing to this register twice seeds the random-number generator. Writing to this register copies the 8 LSBs of the LFSR to the 8 MSBs and replaces the 8 LSBs with the data value written. The value returned when reading from this register is the 8 LSBs of the LFSR. When used for random-number generation, reading this register returns the 8 LSBs of the random number. When used for CRC calculations, reading this register returns the 8 LSBs of the CRC result."]
6pub type RndlR = crate::FieldReader;
7#[doc = "Field `RNDL` writer - Random value/seed or CRC result, low byte When used for random-number generation, writing to this register twice seeds the random-number generator. Writing to this register copies the 8 LSBs of the LFSR to the 8 MSBs and replaces the 8 LSBs with the data value written. The value returned when reading from this register is the 8 LSBs of the LFSR. When used for random-number generation, reading this register returns the 8 LSBs of the random number. When used for CRC calculations, reading this register returns the 8 LSBs of the CRC result."]
8pub type RndlW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9impl R {
10 #[doc = "Bits 0:7 - Random value/seed or CRC result, low byte When used for random-number generation, writing to this register twice seeds the random-number generator. Writing to this register copies the 8 LSBs of the LFSR to the 8 MSBs and replaces the 8 LSBs with the data value written. The value returned when reading from this register is the 8 LSBs of the LFSR. When used for random-number generation, reading this register returns the 8 LSBs of the random number. When used for CRC calculations, reading this register returns the 8 LSBs of the CRC result."]
11 #[inline(always)]
12 pub fn rndl(&self) -> RndlR {
13 RndlR::new((self.bits & 0xff) as u8)
14 }
15}
16impl W {
17 #[doc = "Bits 0:7 - Random value/seed or CRC result, low byte When used for random-number generation, writing to this register twice seeds the random-number generator. Writing to this register copies the 8 LSBs of the LFSR to the 8 MSBs and replaces the 8 LSBs with the data value written. The value returned when reading from this register is the 8 LSBs of the LFSR. When used for random-number generation, reading this register returns the 8 LSBs of the random number. When used for CRC calculations, reading this register returns the 8 LSBs of the CRC result."]
18 #[inline(always)]
19 pub fn rndl(&mut self) -> RndlW<RndlSpec> {
20 RndlW::new(self, 0)
21 }
22}
23#[doc = "This registers contains random-number-generator data; low byte.\n\nYou can [`read`](crate::Reg::read) this register and get [`rndl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rndl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
24pub struct RndlSpec;
25impl crate::RegisterSpec for RndlSpec {
26 type Ux = u32;
27}
28#[doc = "`read()` method returns [`rndl::R`](R) reader structure"]
29impl crate::Readable for RndlSpec {}
30#[doc = "`write(|w| ..)` method takes [`rndl::W`](W) writer structure"]
31impl crate::Writable for RndlSpec {
32 type Safety = crate::Unsafe;
33 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
34 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
35}
36#[doc = "`reset()` method sets RNDL to value 0"]
37impl crate::Resettable for RndlSpec {
38 const RESET_VALUE: u32 = 0;
39}