atsamd51p/freqm/
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>;
13impl R {
14    #[doc = "Bit 0 - Software Reset"]
15    #[inline(always)]
16    pub fn swrst(&self) -> SwrstR {
17        SwrstR::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - Enable"]
20    #[inline(always)]
21    pub fn enable(&self) -> EnableR {
22        EnableR::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25impl W {
26    #[doc = "Bit 0 - Software Reset"]
27    #[inline(always)]
28    #[must_use]
29    pub fn swrst(&mut self) -> SwrstW<CtrlaSpec> {
30        SwrstW::new(self, 0)
31    }
32    #[doc = "Bit 1 - Enable"]
33    #[inline(always)]
34    #[must_use]
35    pub fn enable(&mut self) -> EnableW<CtrlaSpec> {
36        EnableW::new(self, 1)
37    }
38}
39#[doc = "Control A Register\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}