efm32gg11b/timer1/
dtogen.rs1#[doc = "Reader of register DTOGEN"]
2pub type R = crate::R<u32, super::DTOGEN>;
3#[doc = "Writer for register DTOGEN"]
4pub type W = crate::W<u32, super::DTOGEN>;
5#[doc = "Register DTOGEN `reset()`'s with value 0"]
6impl crate::ResetValue for super::DTOGEN {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type { 0 }
10}
11#[doc = "Reader of field `DTOGCC0EN`"]
12pub type DTOGCC0EN_R = crate::R<bool, bool>;
13#[doc = "Write proxy for field `DTOGCC0EN`"]
14pub struct DTOGCC0EN_W<'a> {
15 w: &'a mut W,
16}
17impl<'a> DTOGCC0EN_W<'a> {
18 #[doc = r"Sets the field bit"]
19 #[inline(always)]
20 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
21 #[doc = r"Clears the field bit"]
22 #[inline(always)]
23 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
24 #[doc = r"Writes raw bits to the field"]
25 #[inline(always)]
26 pub fn bit(self, value: bool) -> &'a mut W {
27 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
28 self.w
29 }
30}
31#[doc = "Reader of field `DTOGCC1EN`"]
32pub type DTOGCC1EN_R = crate::R<bool, bool>;
33#[doc = "Write proxy for field `DTOGCC1EN`"]
34pub struct DTOGCC1EN_W<'a> {
35 w: &'a mut W,
36}
37impl<'a> DTOGCC1EN_W<'a> {
38 #[doc = r"Sets the field bit"]
39 #[inline(always)]
40 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
41 #[doc = r"Clears the field bit"]
42 #[inline(always)]
43 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
44 #[doc = r"Writes raw bits to the field"]
45 #[inline(always)]
46 pub fn bit(self, value: bool) -> &'a mut W {
47 self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
48 self.w
49 }
50}
51#[doc = "Reader of field `DTOGCC2EN`"]
52pub type DTOGCC2EN_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `DTOGCC2EN`"]
54pub struct DTOGCC2EN_W<'a> {
55 w: &'a mut W,
56}
57impl<'a> DTOGCC2EN_W<'a> {
58 #[doc = r"Sets the field bit"]
59 #[inline(always)]
60 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
61 #[doc = r"Clears the field bit"]
62 #[inline(always)]
63 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
64 #[doc = r"Writes raw bits to the field"]
65 #[inline(always)]
66 pub fn bit(self, value: bool) -> &'a mut W {
67 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
68 self.w
69 }
70}
71#[doc = "Reader of field `DTOGCDTI0EN`"]
72pub type DTOGCDTI0EN_R = crate::R<bool, bool>;
73#[doc = "Write proxy for field `DTOGCDTI0EN`"]
74pub struct DTOGCDTI0EN_W<'a> {
75 w: &'a mut W,
76}
77impl<'a> DTOGCDTI0EN_W<'a> {
78 #[doc = r"Sets the field bit"]
79 #[inline(always)]
80 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
81 #[doc = r"Clears the field bit"]
82 #[inline(always)]
83 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
84 #[doc = r"Writes raw bits to the field"]
85 #[inline(always)]
86 pub fn bit(self, value: bool) -> &'a mut W {
87 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
88 self.w
89 }
90}
91#[doc = "Reader of field `DTOGCDTI1EN`"]
92pub type DTOGCDTI1EN_R = crate::R<bool, bool>;
93#[doc = "Write proxy for field `DTOGCDTI1EN`"]
94pub struct DTOGCDTI1EN_W<'a> {
95 w: &'a mut W,
96}
97impl<'a> DTOGCDTI1EN_W<'a> {
98 #[doc = r"Sets the field bit"]
99 #[inline(always)]
100 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
101 #[doc = r"Clears the field bit"]
102 #[inline(always)]
103 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
104 #[doc = r"Writes raw bits to the field"]
105 #[inline(always)]
106 pub fn bit(self, value: bool) -> &'a mut W {
107 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
108 self.w
109 }
110}
111#[doc = "Reader of field `DTOGCDTI2EN`"]
112pub type DTOGCDTI2EN_R = crate::R<bool, bool>;
113#[doc = "Write proxy for field `DTOGCDTI2EN`"]
114pub struct DTOGCDTI2EN_W<'a> {
115 w: &'a mut W,
116}
117impl<'a> DTOGCDTI2EN_W<'a> {
118 #[doc = r"Sets the field bit"]
119 #[inline(always)]
120 pub fn set_bit(self) -> &'a mut W { self.bit(true) }
121 #[doc = r"Clears the field bit"]
122 #[inline(always)]
123 pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
124 #[doc = r"Writes raw bits to the field"]
125 #[inline(always)]
126 pub fn bit(self, value: bool) -> &'a mut W {
127 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
128 self.w
129 }
130}
131impl R {
132 #[doc = "Bit 0 - DTI CC0 Output Generation Enable"]
133 #[inline(always)]
134 pub fn dtogcc0en(&self) -> DTOGCC0EN_R { DTOGCC0EN_R::new((self.bits & 0x01) != 0) }
135 #[doc = "Bit 1 - DTI CC1 Output Generation Enable"]
136 #[inline(always)]
137 pub fn dtogcc1en(&self) -> DTOGCC1EN_R { DTOGCC1EN_R::new(((self.bits >> 1) & 0x01) != 0) }
138 #[doc = "Bit 2 - DTI CC2 Output Generation Enable"]
139 #[inline(always)]
140 pub fn dtogcc2en(&self) -> DTOGCC2EN_R { DTOGCC2EN_R::new(((self.bits >> 2) & 0x01) != 0) }
141 #[doc = "Bit 3 - DTI CDTI0 Output Generation Enable"]
142 #[inline(always)]
143 pub fn dtogcdti0en(&self) -> DTOGCDTI0EN_R {
144 DTOGCDTI0EN_R::new(((self.bits >> 3) & 0x01) != 0)
145 }
146 #[doc = "Bit 4 - DTI CDTI1 Output Generation Enable"]
147 #[inline(always)]
148 pub fn dtogcdti1en(&self) -> DTOGCDTI1EN_R {
149 DTOGCDTI1EN_R::new(((self.bits >> 4) & 0x01) != 0)
150 }
151 #[doc = "Bit 5 - DTI CDTI2 Output Generation Enable"]
152 #[inline(always)]
153 pub fn dtogcdti2en(&self) -> DTOGCDTI2EN_R {
154 DTOGCDTI2EN_R::new(((self.bits >> 5) & 0x01) != 0)
155 }
156}
157impl W {
158 #[doc = "Bit 0 - DTI CC0 Output Generation Enable"]
159 #[inline(always)]
160 pub fn dtogcc0en(&mut self) -> DTOGCC0EN_W { DTOGCC0EN_W { w: self } }
161 #[doc = "Bit 1 - DTI CC1 Output Generation Enable"]
162 #[inline(always)]
163 pub fn dtogcc1en(&mut self) -> DTOGCC1EN_W { DTOGCC1EN_W { w: self } }
164 #[doc = "Bit 2 - DTI CC2 Output Generation Enable"]
165 #[inline(always)]
166 pub fn dtogcc2en(&mut self) -> DTOGCC2EN_W { DTOGCC2EN_W { w: self } }
167 #[doc = "Bit 3 - DTI CDTI0 Output Generation Enable"]
168 #[inline(always)]
169 pub fn dtogcdti0en(&mut self) -> DTOGCDTI0EN_W { DTOGCDTI0EN_W { w: self } }
170 #[doc = "Bit 4 - DTI CDTI1 Output Generation Enable"]
171 #[inline(always)]
172 pub fn dtogcdti1en(&mut self) -> DTOGCDTI1EN_W { DTOGCDTI1EN_W { w: self } }
173 #[doc = "Bit 5 - DTI CDTI2 Output Generation Enable"]
174 #[inline(always)]
175 pub fn dtogcdti2en(&mut self) -> DTOGCDTI2EN_W { DTOGCDTI2EN_W { w: self } }
176}