atsamd51g/trng/
ctrla.rs
1#[doc = "Register `CTRLA` reader"]
2pub type R = crate::R<CtrlaSpec>;
3#[doc = "Register `CTRLA` writer"]
4pub type W = crate::W<CtrlaSpec>;
5#[doc = "Field `ENABLE` reader - Enable"]
6pub type EnableR = crate::BitReader;
7#[doc = "Field `ENABLE` writer - Enable"]
8pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `RUNSTDBY` reader - Run in Standby"]
10pub type RunstdbyR = crate::BitReader;
11#[doc = "Field `RUNSTDBY` writer - Run in Standby"]
12pub type RunstdbyW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bit 1 - Enable"]
15 #[inline(always)]
16 pub fn enable(&self) -> EnableR {
17 EnableR::new(((self.bits >> 1) & 1) != 0)
18 }
19 #[doc = "Bit 6 - Run in Standby"]
20 #[inline(always)]
21 pub fn runstdby(&self) -> RunstdbyR {
22 RunstdbyR::new(((self.bits >> 6) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bit 1 - Enable"]
27 #[inline(always)]
28 #[must_use]
29 pub fn enable(&mut self) -> EnableW<CtrlaSpec> {
30 EnableW::new(self, 1)
31 }
32 #[doc = "Bit 6 - Run in Standby"]
33 #[inline(always)]
34 #[must_use]
35 pub fn runstdby(&mut self) -> RunstdbyW<CtrlaSpec> {
36 RunstdbyW::new(self, 6)
37 }
38}
39#[doc = "Control A\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrla::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrla::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct CtrlaSpec;
41impl crate::RegisterSpec for CtrlaSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`ctrla::R`](R) reader structure"]
45impl crate::Readable for CtrlaSpec {}
46#[doc = "`write(|w| ..)` method takes [`ctrla::W`](W) writer structure"]
47impl crate::Writable for CtrlaSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets CTRLA to value 0"]
53impl crate::Resettable for CtrlaSpec {
54 const RESET_VALUE: u8 = 0;
55}