atsamd11d/dac/
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 `SWRST` reader - Software Reset"]
6pub type SwrstR = crate::BitReader;
7#[doc = "Field `SWRST` writer - Software Reset"]
8pub type SwrstW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ENABLE` reader - Enable"]
10pub type EnableR = crate::BitReader;
11#[doc = "Field `ENABLE` writer - Enable"]
12pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RUNSTDBY` reader - Run in Standby"]
14pub type RunstdbyR = crate::BitReader;
15#[doc = "Field `RUNSTDBY` writer - Run in Standby"]
16pub type RunstdbyW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 0 - Software Reset"]
19    #[inline(always)]
20    pub fn swrst(&self) -> SwrstR {
21        SwrstR::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1 - Enable"]
24    #[inline(always)]
25    pub fn enable(&self) -> EnableR {
26        EnableR::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bit 2 - Run in Standby"]
29    #[inline(always)]
30    pub fn runstdby(&self) -> RunstdbyR {
31        RunstdbyR::new(((self.bits >> 2) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bit 0 - Software Reset"]
36    #[inline(always)]
37    #[must_use]
38    pub fn swrst(&mut self) -> SwrstW<CtrlaSpec> {
39        SwrstW::new(self, 0)
40    }
41    #[doc = "Bit 1 - Enable"]
42    #[inline(always)]
43    #[must_use]
44    pub fn enable(&mut self) -> EnableW<CtrlaSpec> {
45        EnableW::new(self, 1)
46    }
47    #[doc = "Bit 2 - Run in Standby"]
48    #[inline(always)]
49    #[must_use]
50    pub fn runstdby(&mut self) -> RunstdbyW<CtrlaSpec> {
51        RunstdbyW::new(self, 2)
52    }
53}
54#[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)."]
55pub struct CtrlaSpec;
56impl crate::RegisterSpec for CtrlaSpec {
57    type Ux = u8;
58}
59#[doc = "`read()` method returns [`ctrla::R`](R) reader structure"]
60impl crate::Readable for CtrlaSpec {}
61#[doc = "`write(|w| ..)` method takes [`ctrla::W`](W) writer structure"]
62impl crate::Writable for CtrlaSpec {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
66}
67#[doc = "`reset()` method sets CTRLA to value 0"]
68impl crate::Resettable for CtrlaSpec {
69    const RESET_VALUE: u8 = 0;
70}