atsamd51p/i2s/
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 `CKEN0` reader - Clock Unit 0 Enable"]
14pub type Cken0R = crate::BitReader;
15#[doc = "Field `CKEN0` writer - Clock Unit 0 Enable"]
16pub type Cken0W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `CKEN1` reader - Clock Unit 1 Enable"]
18pub type Cken1R = crate::BitReader;
19#[doc = "Field `CKEN1` writer - Clock Unit 1 Enable"]
20pub type Cken1W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TXEN` reader - Tx Serializer Enable"]
22pub type TxenR = crate::BitReader;
23#[doc = "Field `TXEN` writer - Tx Serializer Enable"]
24pub type TxenW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `RXEN` reader - Rx Serializer Enable"]
26pub type RxenR = crate::BitReader;
27#[doc = "Field `RXEN` writer - Rx Serializer Enable"]
28pub type RxenW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bit 0 - Software Reset"]
31 #[inline(always)]
32 pub fn swrst(&self) -> SwrstR {
33 SwrstR::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bit 1 - Enable"]
36 #[inline(always)]
37 pub fn enable(&self) -> EnableR {
38 EnableR::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[doc = "Bit 2 - Clock Unit 0 Enable"]
41 #[inline(always)]
42 pub fn cken0(&self) -> Cken0R {
43 Cken0R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[doc = "Bit 3 - Clock Unit 1 Enable"]
46 #[inline(always)]
47 pub fn cken1(&self) -> Cken1R {
48 Cken1R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[doc = "Bit 4 - Tx Serializer Enable"]
51 #[inline(always)]
52 pub fn txen(&self) -> TxenR {
53 TxenR::new(((self.bits >> 4) & 1) != 0)
54 }
55 #[doc = "Bit 5 - Rx Serializer Enable"]
56 #[inline(always)]
57 pub fn rxen(&self) -> RxenR {
58 RxenR::new(((self.bits >> 5) & 1) != 0)
59 }
60}
61impl W {
62 #[doc = "Bit 0 - Software Reset"]
63 #[inline(always)]
64 #[must_use]
65 pub fn swrst(&mut self) -> SwrstW<CtrlaSpec> {
66 SwrstW::new(self, 0)
67 }
68 #[doc = "Bit 1 - Enable"]
69 #[inline(always)]
70 #[must_use]
71 pub fn enable(&mut self) -> EnableW<CtrlaSpec> {
72 EnableW::new(self, 1)
73 }
74 #[doc = "Bit 2 - Clock Unit 0 Enable"]
75 #[inline(always)]
76 #[must_use]
77 pub fn cken0(&mut self) -> Cken0W<CtrlaSpec> {
78 Cken0W::new(self, 2)
79 }
80 #[doc = "Bit 3 - Clock Unit 1 Enable"]
81 #[inline(always)]
82 #[must_use]
83 pub fn cken1(&mut self) -> Cken1W<CtrlaSpec> {
84 Cken1W::new(self, 3)
85 }
86 #[doc = "Bit 4 - Tx Serializer Enable"]
87 #[inline(always)]
88 #[must_use]
89 pub fn txen(&mut self) -> TxenW<CtrlaSpec> {
90 TxenW::new(self, 4)
91 }
92 #[doc = "Bit 5 - Rx Serializer Enable"]
93 #[inline(always)]
94 #[must_use]
95 pub fn rxen(&mut self) -> RxenW<CtrlaSpec> {
96 RxenW::new(self, 5)
97 }
98}
99#[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)."]
100pub struct CtrlaSpec;
101impl crate::RegisterSpec for CtrlaSpec {
102 type Ux = u8;
103}
104#[doc = "`read()` method returns [`ctrla::R`](R) reader structure"]
105impl crate::Readable for CtrlaSpec {}
106#[doc = "`write(|w| ..)` method takes [`ctrla::W`](W) writer structure"]
107impl crate::Writable for CtrlaSpec {
108 type Safety = crate::Unsafe;
109 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
110 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
111}
112#[doc = "`reset()` method sets CTRLA to value 0"]
113impl crate::Resettable for CtrlaSpec {
114 const RESET_VALUE: u8 = 0;
115}